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

Convert read_smb_length_return_keepalive to read_socket_with_timeout_ntstatus

(This used to be commit 59e8f22f36)
This commit is contained in:
Volker Lendecke 2008-01-25 21:02:52 +01:00
parent 3f970f91c2
commit 3e5b98555b

View File

@ -1146,10 +1146,27 @@ ssize_t read_smb_length_return_keepalive(int fd,
unsigned int timeout,
enum smb_read_errors *pre)
{
ssize_t len=0;
size_t len=0;
int msg_type;
NTSTATUS status;
if (read_socket_with_timeout(fd, inbuf, 4, 4, timeout, pre) != 4) {
set_smb_read_error(pre, SMB_READ_OK);
status = read_socket_with_timeout_ntstatus(fd, inbuf, 4, 4, timeout,
NULL);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE)) {
set_smb_read_error(pre, SMB_READ_EOF);
return -1;
}
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
set_smb_read_error(pre, SMB_READ_TIMEOUT);
return -1;
}
set_smb_read_error(pre, SMB_READ_ERROR);
return -1;
}