CURLOPT_MAXAGE_CONN: set the maximum allowed age for conn reuse

... and disconnect too old ones instead of trying to reuse.

Default max age is set to 118 seconds.

Ref: #3722
Closes #3782
This commit is contained in:
Daniel Stenberg 2019-04-14 23:20:01 +02:00
parent 060f870b85
commit e649432e72
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
10 changed files with 106 additions and 14 deletions

View file

@ -2645,6 +2645,12 @@ static CURLcode vsetopt(struct Curl_easy *data, CURLoption option,
return CURLE_BAD_FUNCTION_ARGUMENT;
data->set.upkeep_interval_ms = arg;
break;
case CURLOPT_MAXAGE_CONN:
arg = va_arg(param, long);
if(arg < 0)
return CURLE_BAD_FUNCTION_ARGUMENT;
data->set.maxage_conn = arg;
break;
case CURLOPT_TRAILERFUNCTION:
#ifndef CURL_DISABLE_HTTP
data->set.trailer_callback = va_arg(param, curl_trailer_callback);