1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3: Lift smbd_server_fd() from read_data()

All callers have appropriate debug messages themselves
This commit is contained in:
Volker Lendecke 2010-08-15 15:30:21 +02:00
parent 9671547d17
commit 7d164498db
2 changed files with 9 additions and 22 deletions

View File

@ -531,25 +531,7 @@ NTSTATUS read_fd_with_timeout(int fd, char *buf,
NTSTATUS read_data(int fd, char *buffer, size_t N)
{
NTSTATUS status;
status = read_fd_with_timeout(fd, buffer, N, N, 0, NULL);
if (NT_STATUS_IS_OK(status)) {
return 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;
return read_fd_with_timeout(fd, buffer, N, N, 0, NULL);
}
/****************************************************************************

View File

@ -3966,9 +3966,14 @@ void reply_writebraw(struct smb_request *req)
status = read_data(req->sconn->sock, buf+4, numtowrite);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("reply_writebraw: Oversize secondary write "
"raw read failed (%s). Terminating\n",
nt_errstr(status)));
char addr[INET6_ADDRSTRLEN];
/* Try and give an error message
* saying what client failed. */
DEBUG(0, ("reply_writebraw: Oversize secondary write "
"raw read failed (%s) for client %s. "
"Terminating\n", nt_errstr(status),
get_peer_addr(req->sconn->sock, addr,
sizeof(addr))));
exit_server_cleanly("secondary writebraw failed");
}