summaryrefslogtreecommitdiffstats
path: root/source/lib/util_sock.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-05-27 20:07:28 +0000
committerJeremy Allison <jra@samba.org>2005-05-27 20:07:28 +0000
commit1bac53375e4181f98fd9b600b694a7daec3cf3e2 (patch)
treee07d493c209275f49e25513c21bfa95707728f11 /source/lib/util_sock.c
parentecae248f494c0b97dd94cbdf09660752623d1332 (diff)
downloadsamba-1bac53375e4181f98fd9b600b694a7daec3cf3e2.tar.gz
samba-1bac53375e4181f98fd9b600b694a7daec3cf3e2.tar.xz
samba-1bac53375e4181f98fd9b600b694a7daec3cf3e2.zip
r7039: Ensure we always call read_socket_with_timeout() when
timeout > 0. Better solution after much helpful input from derrell@samba.org. We may eventually change the read_socket_with_timeout() interface to count down the timeout value. Jeremy.
Diffstat (limited to 'source/lib/util_sock.c')
-rw-r--r--source/lib/util_sock.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/lib/util_sock.c b/source/lib/util_sock.c
index 72837d73d92..20dbdf8054b 100644
--- a/source/lib/util_sock.c
+++ b/source/lib/util_sock.c
@@ -597,7 +597,12 @@ BOOL receive_smb_raw(int fd, char *buffer, unsigned int timeout)
}
if(len > 0) {
- ret = read_socket_data(fd,buffer+4,len);
+ if (timeout > 0) {
+ ret = read_socket_with_timeout(fd,buffer+4,len,len,timeout);
+ } else {
+ ret = read_socket_data(fd,buffer+4,len);
+ }
+
if (ret != len) {
if (smb_read_error == 0)
smb_read_error = READ_ERROR;