diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-05-01 00:31:56 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-05-02 00:04:52 +0200 |
commit | 4858c451ee54d0104f68408debb3a32947b7b273 (patch) | |
tree | 3a8acecc73c08b9024ad6e6ad33c054cea8a5c85 /lib | |
parent | e3ed5cb380e615e91d99b09da9f0ead0eaf3e0b5 (diff) |
url: let CURLOPT_BUFFERSIZE realloc to smaller sizes too
Closes #1449
Diffstat (limited to 'lib')
-rw-r--r-- | lib/url.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2298,8 +2298,8 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option, else if(arg < READBUFFER_MIN) arg = READBUFFER_MIN; - /* Resize only if larger than default buffer size. */ - if(arg > READBUFFER_SIZE) { + /* Resize if new size */ + if(arg != data->set.buffer_size) { char *newbuff = realloc(data->state.buffer, arg + 1); if(!newbuff) { DEBUGF(fprintf(stderr, "Error: realloc of buffer failed\n")); |