mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
More read_data -> read_socket_with_timeout
This commit is contained in:
parent
4c08725a42
commit
f1d7de462c
@ -1126,12 +1126,7 @@ ssize_t read_smb_length_return_keepalive(int fd,
|
|||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
|
||||||
while (!ok) {
|
while (!ok) {
|
||||||
if (timeout > 0) {
|
ok = (read_socket_with_timeout(fd,inbuf,4,4,timeout,pre) == 4);
|
||||||
ok = (read_socket_with_timeout(fd,inbuf,4,4,
|
|
||||||
timeout,pre) == 4);
|
|
||||||
} else {
|
|
||||||
ok = (read_data(fd,inbuf,4,pre) == 4);
|
|
||||||
}
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1237,16 +1232,8 @@ ssize_t receive_smb_raw(int fd,
|
|||||||
len = MIN(len,maxlen);
|
len = MIN(len,maxlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timeout > 0) {
|
ret = read_socket_with_timeout(fd, buffer+4, len, len, timeout,
|
||||||
ret = read_socket_with_timeout(fd,
|
pre);
|
||||||
buffer+4,
|
|
||||||
len,
|
|
||||||
len,
|
|
||||||
timeout,
|
|
||||||
pre);
|
|
||||||
} else {
|
|
||||||
ret = read_data(fd,buffer+4,len,pre);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret != len) {
|
if (ret != len) {
|
||||||
cond_set_smb_read_error(pre,SMB_READ_ERROR);
|
cond_set_smb_read_error(pre,SMB_READ_ERROR);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user