From 840b0f523b978aa6cb9acbac26023a756afcea81 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 15 Aug 2010 15:45:21 +0200 Subject: s3: Move read_smb_length() to smbd/reply.c --- source3/lib/util_sock.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'source3/lib/util_sock.c') diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index 756ce96abc..3bc60db61e 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -667,48 +667,6 @@ NTSTATUS read_smb_length_return_keepalive(int fd, char *inbuf, return NT_STATUS_OK; } -/**************************************************************************** - Read 4 bytes of a smb packet and return the smb length of the packet. - Store the result in the buffer. This version of the function will - never return a session keepalive (length of zero). - Timeout is in milliseconds. -****************************************************************************/ - -NTSTATUS read_smb_length(int fd, char *inbuf, unsigned int timeout, - size_t *len) -{ - uint8_t msgtype = SMBkeepalive; - - while (msgtype == SMBkeepalive) { - NTSTATUS status; - - status = read_smb_length_return_keepalive(fd, inbuf, timeout, - len); - if (!NT_STATUS_IS_OK(status)) { - if (fd == smbd_server_fd()) { - char addr[INET6_ADDRSTRLEN]; - /* Try and give an error message - * saying what client failed. */ - DEBUG(0, ("read_fd_with_timeout failed for " - "client %s read error = %s.\n", - get_peer_addr(fd,addr,sizeof(addr)), - nt_errstr(status))); - } else { - DEBUG(0, ("read_fd_with_timeout failed, read " - "error = %s.\n", nt_errstr(status))); - } - return status; - } - - msgtype = CVAL(inbuf, 0); - } - - DEBUG(10,("read_smb_length: got smb length of %lu\n", - (unsigned long)len)); - - return NT_STATUS_OK; -} - /**************************************************************************** Read an smb from a fd. The timeout is in milliseconds. -- cgit