mirror of
https://github.com/curl/curl.git
synced 2026-08-25 01:43:32 +03:00
http, use stack scratch buffer
- instead of data->state.buffer Closes #12791
This commit is contained in:
parent
8e9c304f4a
commit
a069c6aeb2
1 changed files with 4 additions and 3 deletions
|
|
@ -2940,13 +2940,14 @@ CURLcode Curl_http_resume(struct Curl_easy *data,
|
|||
}
|
||||
/* when seekerr == CURL_SEEKFUNC_CANTSEEK (can't seek to offset) */
|
||||
do {
|
||||
char scratch[4*1024];
|
||||
size_t readthisamountnow =
|
||||
(data->state.resume_from - passed > data->set.buffer_size) ?
|
||||
(size_t)data->set.buffer_size :
|
||||
(data->state.resume_from - passed > (curl_off_t)sizeof(scratch)) ?
|
||||
sizeof(scratch) :
|
||||
curlx_sotouz(data->state.resume_from - passed);
|
||||
|
||||
size_t actuallyread =
|
||||
data->state.fread_func(data->state.buffer, 1, readthisamountnow,
|
||||
data->state.fread_func(scratch, 1, readthisamountnow,
|
||||
data->state.in);
|
||||
|
||||
passed += actuallyread;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue