mirror of
https://github.com/curl/curl.git
synced 2026-08-26 16:13:32 +03:00
buffer: use data->set.buffer_size instead of BUFSIZE
... to properly use the dynamically set buffer size!
This commit is contained in:
parent
c79f4908d4
commit
e40e9d7f0d
8 changed files with 26 additions and 27 deletions
|
|
@ -558,12 +558,11 @@ static CURLcode file_do(struct connectdata *conn, bool *done)
|
|||
size_t bytestoread;
|
||||
|
||||
if(size_known) {
|
||||
bytestoread =
|
||||
(expected_size < CURL_OFF_T_C(BUFSIZE) - CURL_OFF_T_C(1)) ?
|
||||
curlx_sotouz(expected_size) : BUFSIZE - 1;
|
||||
bytestoread = (expected_size < data->set.buffer_size) ?
|
||||
curlx_sotouz(expected_size) : (size_t)data->set.buffer_size;
|
||||
}
|
||||
else
|
||||
bytestoread = BUFSIZE-1;
|
||||
bytestoread = data->set.buffer_size-1;
|
||||
|
||||
nread = read(fd, buf, bytestoread);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue