From 96f179752d338b9958f645e769e562c43e8eb156 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 27 May 2005 20:07:28 +0000 Subject: 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) --- source3/lib/util_sock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3') 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; -- cgit