summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-08-15 15:36:28 +0200
committerVolker Lendecke <vl@samba.org>2010-08-17 22:44:03 +0200
commit1f0afe1aed5cc267c3c24322992bfcb7c82847b1 (patch)
tree842e366abbc54f92f2304181c7b87f806b225fa7 /source3/lib
parent7d164498dbad77e2072eaae9e421ee1c45336257 (diff)
downloadsamba-1f0afe1aed5cc267c3c24322992bfcb7c82847b1.tar.gz
samba-1f0afe1aed5cc267c3c24322992bfcb7c82847b1.tar.bz2
samba-1f0afe1aed5cc267c3c24322992bfcb7c82847b1.zip
s3: Lift smbd_server_fd() from read_smb_length_return_keepalive
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_sock.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 74a3e343ac..9950a416f5 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -652,18 +652,6 @@ NTSTATUS read_smb_length_return_keepalive(int fd, char *inbuf,
status = read_fd_with_timeout(fd, inbuf, 4, 4, timeout, NULL);
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;
}
@@ -697,6 +685,18 @@ NTSTATUS read_smb_length(int fd, char *inbuf, unsigned int timeout,
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;
}
@@ -727,7 +727,18 @@ NTSTATUS receive_smb_raw(int fd, char *buffer, size_t buflen, unsigned int timeo
status = read_smb_length_return_keepalive(fd,buffer,timeout,&len);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(10, ("receive_smb_raw: %s!\n", nt_errstr(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;
}