buffer: use data->set.buffer_size instead of BUFSIZE

... to properly use the dynamically set buffer size!
This commit is contained in:
Daniel Stenberg 2017-04-25 14:38:34 +02:00
parent c79f4908d4
commit e40e9d7f0d
8 changed files with 26 additions and 27 deletions

View file

@ -680,8 +680,6 @@ static CURLcode readwrite_data(struct Curl_easy *data,
excess = (size_t)(k->bytecount + nread - k->maxdownload);
if(excess > 0 && !k->ignorebody) {
if(Curl_pipeline_wanted(conn->data->multi, CURLPIPE_HTTP1)) {
/* The 'excess' amount below can't be more than BUFSIZE which
always will fit in a size_t */
infof(data,
"Rewinding stream by : %zu"
" bytes on url %s (size = %" CURL_FORMAT_CURL_OFF_T
@ -936,7 +934,7 @@ static CURLcode readwrite_upload(struct Curl_easy *data,
(data->set.crlf))) {
/* Do we need to allocate a scratch buffer? */
if(!data->state.scratch) {
data->state.scratch = malloc(2 * BUFSIZE);
data->state.scratch = malloc(2 * data->set.buffer_size);
if(!data->state.scratch) {
failf(data, "Failed to alloc scratch buffer!");