--- source/lib/util_sock.c.orig Sat Feb 26 00:59:32 2005 +++ source/lib/util_sock.c Wed Apr 27 02:20:29 2005 @@ -264,15 +264,16 @@ DEBUG(5,("read_socket_with_timeout: blocking read. EOF from client.\n")); smb_read_error = READ_EOF; return -1; } - if (readret == -1) { + if (readret == -1 && errno != EAGAIN) { DEBUG(0,("read_socket_with_timeout: read error = %s.\n", strerror(errno) )); smb_read_error = READ_ERROR; return -1; } + if (readret > 0) nread += readret; } return((ssize_t)nread); } @@ -348,15 +349,16 @@ DEBUG(10,("read_data: read of %d returned 0. Error = %s\n", (int)(N - total), strerror(errno) )); smb_read_error = READ_EOF; return 0; } - if (ret == -1) { + if (ret == -1 && errno != EAGAIN) { DEBUG(0,("read_data: read failure for %d. Error = %s\n", (int)(N - total), strerror(errno) )); smb_read_error = READ_ERROR; return -1; } + if (ret > 0) total += ret; } return (ssize_t)total; } @@ -378,15 +380,16 @@ DEBUG(10,("read_socket_data: recv of %d returned 0. Error = %s\n", (int)(N - total), strerror(errno) )); smb_read_error = READ_EOF; return 0; } - if (ret == -1) { + if (ret == -1 && errno != EAGAIN) { DEBUG(0,("read_socket_data: recv failure for %d. Error = %s\n", (int)(N - total), strerror(errno) )); smb_read_error = READ_ERROR; return -1; } + if (ret > 0) total += ret; } return (ssize_t)total; }