diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-11-21 20:02:08 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-11-21 20:02:08 +0000 |
commit | 17444c9c84fd0c8679499198fd4ee3b155fb297f (patch) | |
tree | 9c79188c72f5ca0bc8acaf99a1a619853a327e38 /slirp | |
parent | bf1b938fce39c8837899d11d074e2df983592a5b (diff) | |
download | hqemu-17444c9c84fd0c8679499198fd4ee3b155fb297f.zip hqemu-17444c9c84fd0c8679499198fd4ee3b155fb297f.tar.gz |
fixed invalid received length
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1155 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'slirp')
-rw-r--r-- | slirp/socket.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/slirp/socket.c b/slirp/socket.c index fe03d44..6713c4d 100644 --- a/slirp/socket.c +++ b/slirp/socket.c @@ -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 |