From e649432e7234dfe6905f4663bd0ce7b37ef2c5e7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 14 Apr 2019 23:20:01 +0200 Subject: 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 --- lib/setopt.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/setopt.c') diff --git a/lib/setopt.c b/lib/setopt.c index 1df38fbb4..594303eff 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -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); -- cgit v1.2.1