mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
smbd: Move read_packet_remainder to smb2_process.c
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
e287f7c27b
commit
cd111f7269
@ -310,26 +310,6 @@ static bool valid_packet_size(size_t len)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS read_packet_remainder(int fd, char *buffer,
|
|
||||||
unsigned int timeout, ssize_t len)
|
|
||||||
{
|
|
||||||
NTSTATUS status;
|
|
||||||
|
|
||||||
if (len <= 0) {
|
|
||||||
return NT_STATUS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
Attempt a zerocopy writeX read. We know here that len > smb_size-4
|
Attempt a zerocopy writeX read. We know here that len > smb_size-4
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -900,6 +900,8 @@ size_t srv_set_message(char *buf,
|
|||||||
size_t num_words,
|
size_t num_words,
|
||||||
size_t num_bytes,
|
size_t num_bytes,
|
||||||
bool zero);
|
bool zero);
|
||||||
|
NTSTATUS read_packet_remainder(int fd, char *buffer,
|
||||||
|
unsigned int timeout, ssize_t len);
|
||||||
|
|
||||||
/* The following definitions come from smbd/quotas.c */
|
/* The following definitions come from smbd/quotas.c */
|
||||||
|
|
||||||
|
@ -125,3 +125,23 @@ size_t srv_set_message(char *buf,
|
|||||||
smb_setlen(buf,(smb_size + num_words*2 + num_bytes - 4));
|
smb_setlen(buf,(smb_size + num_words*2 + num_bytes - 4));
|
||||||
return (smb_size + num_words*2 + num_bytes);
|
return (smb_size + num_words*2 + num_bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NTSTATUS read_packet_remainder(int fd, char *buffer,
|
||||||
|
unsigned int timeout, ssize_t len)
|
||||||
|
{
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
if (len <= 0) {
|
||||||
|
return NT_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user