mirror of https://github.com/BOINC/boinc.git
Fixed nonblocking bug.
svn path=/trunk/boinc/; revision=378
This commit is contained in:
parent
03f4790bf2
commit
615ff954a9
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue