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) {
printf("wrote %d bytes to socket %d\n", n, socket);
}
if (n < 0 && errno != EAGAIN) {
error = ERR_WRITE;
io_done = true;
goto done;
} else if (errno == EAGAIN) {
if (n<0) n = 0;
if (n < 0) {
error = ERR_WRITE;
io_done = true;
goto done;
} else if (n < nleft) {
fseek( file, n+nbytes_transferred-blocksize, SEEK_CUR );
nbytes_transferred += n;
goto done;