summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-05-27 20:07:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:57:01 -0500
commit96f179752d338b9958f645e769e562c43e8eb156 (patch)
tree15c4385f2561e86b219c2816eec9bc84436518d3 /source3/lib
parent4b417655f7724bf09021cf72ee8174f74a0bd578 (diff)
downloadsamba-96f179752d338b9958f645e769e562c43e8eb156.tar.gz
samba-96f179752d338b9958f645e769e562c43e8eb156.tar.bz2
samba-96f179752d338b9958f645e769e562c43e8eb156.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. (This used to be commit 09c9a62aa53ed26e59ed57e577614d02a796c492)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_sock.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 72837d73d9..20dbdf8054 100644
--- a/source3/lib/util_sock.c
+++ b/source3/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;