summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-01-25 09:28:19 +0100
committerVolker Lendecke <vl@samba.org>2008-01-25 20:55:51 +0100
commite2ad28509c4e31fa4d397290b61e376d55e3abb2 (patch)
tree3cbd726b59dabeb6038ba4bb123eba46fb339dde /source3
parent31a6f807842259ded10dff549f2f57d77ee79c6e (diff)
downloadsamba-e2ad28509c4e31fa4d397290b61e376d55e3abb2.tar.gz
samba-e2ad28509c4e31fa4d397290b61e376d55e3abb2.tar.bz2
samba-e2ad28509c4e31fa4d397290b61e376d55e3abb2.zip
Tiny simplification
(This used to be commit e78f6872bfc19ce0476b8d79c856a8d9c646a913)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/util_sock.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index ce1569d021..ced1130536 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -1150,16 +1150,15 @@ ssize_t read_smb_length_return_keepalive(int fd,
ssize_t read_smb_length(int fd, char *inbuf, unsigned int timeout, enum smb_read_errors *pre)
{
ssize_t len;
+ uint8_t msgtype = SMBkeepalive;
- for(;;) {
- len = read_smb_length_return_keepalive(fd, inbuf, timeout, pre);
-
- if(len < 0)
+ while (msgtype == SMBkeepalive) {
+ len = read_smb_length_return_keepalive(fd, inbuf, timeout,
+ pre);
+ if (len < 0) {
return len;
-
- /* Ignore session keepalives. */
- if(CVAL(inbuf,0) != SMBkeepalive)
- break;
+ }
+ msgtype = CVAL(inbuf, 0);
}
DEBUG(10,("read_smb_length: got smb length of %lu\n",