sim-card
/
qemu
Archived
10
0
Fork 0

fixed invalid received length

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1155 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
bellard 2004-11-21 20:02:08 +00:00
parent bf1b938fce
commit 17444c9c84
1 changed files with 6 additions and 2 deletions

View File

@ -175,8 +175,12 @@ soread(so)
* a close will be detected on next iteration.
* A return of -1 wont (shouldn't) happen, since it didn't happen above
*/
if (n == 2 && nn == iov[0].iov_len)
nn += recv(so->s, iov[1].iov_base, iov[1].iov_len,0);
if (n == 2 && nn == iov[0].iov_len) {
int ret;
ret = recv(so->s, iov[1].iov_base, iov[1].iov_len,0);
if (ret > 0)
nn += ret;
}
DEBUG_MISC((dfd, " ... read nn = %d bytes\n", nn));
#endif