Fixed nonblocking bug.

svn path=/trunk/boinc/; revision=378
This commit is contained in:
Eric Heien 2002-08-25 03:24:55 +00:00
parent 03f4790bf2
commit 615ff954a9
1 changed files with 5 additions and 6 deletions

View File

@ -351,12 +351,11 @@ int NET_XFER::do_xfer(int& nbytes_transferred) {
if (log_flags.net_xfer_debug) { if (log_flags.net_xfer_debug) {
printf("wrote %d bytes to socket %d\n", n, socket); printf("wrote %d bytes to socket %d\n", n, socket);
} }
if (n < 0 && errno != EAGAIN) { if (n < 0) {
error = ERR_WRITE; error = ERR_WRITE;
io_done = true; io_done = true;
goto done; goto done;
} else if (errno == EAGAIN) { } else if (n < nleft) {
if (n<0) n = 0;
fseek( file, n+nbytes_transferred-blocksize, SEEK_CUR ); fseek( file, n+nbytes_transferred-blocksize, SEEK_CUR );
nbytes_transferred += n; nbytes_transferred += n;
goto done; goto done;