diff options
Diffstat (limited to 'source3/smbd/process.c')
-rw-r--r-- | source3/smbd/process.c | 17 |
1 files changed, 16 insertions, 1 deletions
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; } |