mirror of
https://github.com/curl/curl.git
synced 2026-08-25 14:53:34 +03:00
CURLOPT_BUFFERSIZE allows an application to set a prefered buffer size
for receiving data from the network. It is meant as a hint, not as a forced limit.
This commit is contained in:
parent
5cb06d8fd6
commit
e54e0c7877
3 changed files with 17 additions and 1 deletions
13
lib/url.c
13
lib/url.c
|
|
@ -1011,6 +1011,19 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
|
|||
*/
|
||||
data->set.telnet_options = va_arg(param, struct curl_slist *);
|
||||
break;
|
||||
|
||||
case CURLOPT_BUFFERSIZE:
|
||||
/*
|
||||
* The application kindly asks for a differently sized receive buffer.
|
||||
* If it seems reasonable, we'll use it.
|
||||
*/
|
||||
data->set.buffer_size = va_arg(param, long);
|
||||
|
||||
if(data->set.buffer_size> (BUFSIZE -1 ))
|
||||
data->set.buffer_size = 0; /* huge internal default */
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
/* unknown tag and its companion, just ignore: */
|
||||
return CURLE_FAILED_INIT; /* correct this */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue