From 9671547d17fa8152dbad127fde2a963b2ba834a0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 15 Aug 2010 15:23:47 +0200 Subject: s3: Lift smbd_server_fd() from read_fd_with_timeout() --- source3/smbd/process.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source3/smbd') diff --git a/source3/smbd/process.c b/source3/smbd/process.c index c44d86a6b8..8c781c8955 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -206,11 +206,21 @@ static bool valid_packet_size(size_t len) static NTSTATUS read_packet_remainder(int fd, char *buffer, unsigned int timeout, ssize_t len) { + NTSTATUS status; + if (len <= 0) { return NT_STATUS_OK; } - return read_fd_with_timeout(fd, buffer, len, len, timeout, NULL); + status = read_fd_with_timeout(fd, buffer, len, len, timeout, NULL); + if (!NT_STATUS_IS_OK(status)) { + char addr[INET6_ADDRSTRLEN]; + DEBUG(0, ("read_fd_with_timeout failed for client %s read " + "error = %s.\n", + get_peer_addr(fd, addr, sizeof(addr)), + nt_errstr(status))); + } + return status; } /**************************************************************************** @@ -251,6 +261,11 @@ static NTSTATUS receive_smb_raw_talloc_partial_read(TALLOC_CTX *mem_ctx, timeout, NULL); if (!NT_STATUS_IS_OK(status)) { + char addr[INET6_ADDRSTRLEN]; + DEBUG(0, ("read_fd_with_timeout failed for client %s read " + "error = %s.\n", + get_peer_addr(fd, addr, sizeof(addr)), + nt_errstr(status))); return status; } -- cgit