summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/util_sock.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 1a7cc02229..ce1569d021 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -1123,20 +1123,16 @@ ssize_t read_smb_length_return_keepalive(int fd,
{
ssize_t len=0;
int msg_type;
- bool ok = false;
- while (!ok) {
- ok = (read_socket_with_timeout(fd,inbuf,4,4,timeout,pre) == 4);
- if (!ok) {
- return -1;
- }
+ if (read_socket_with_timeout(fd, inbuf, 4, 4, timeout, pre) != 4) {
+ return -1;
+ }
- len = smb_len(inbuf);
- msg_type = CVAL(inbuf,0);
+ len = smb_len(inbuf);
+ msg_type = CVAL(inbuf,0);
- if (msg_type == SMBkeepalive) {
- DEBUG(5,("Got keepalive packet\n"));
- }
+ if (msg_type == SMBkeepalive) {
+ DEBUG(5,("Got keepalive packet\n"));
}
DEBUG(10,("got smb length of %lu\n",(unsigned long)len));