summaryrefslogtreecommitdiff
path: root/lib/setopt.c
diff options
context:
space:
mode:
authorJeffrey Tolar <tolar@yahooinc.com>2021-09-18 11:29:44 -0500
committerDaniel Stenberg <daniel@haxx.se>2021-10-06 14:38:59 +0200
commit5f563495f1f9cf7ef4f23f997e4c2707dd3e74a8 (patch)
treee6d017874795f4c0bfe61105b1a245f44699ae2c /lib/setopt.c
parent013cb2ff7d3a37cab6910cc2e4d255377d341b6e (diff)
downloadcurl-5f563495f1f9cf7ef4f23f997e4c2707dd3e74a8.tar.gz
CURLOPT_MAXLIFETIME_CONN: maximum allowed lifetime for conn reuse
... and close connections that are too old instead of reusing them. By default, this behavior is disabled. Bug: https://curl.se/mail/lib-2021-09/0058.html Closes #7751
Diffstat (limited to 'lib/setopt.c')
-rw-r--r--lib/setopt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/setopt.c b/lib/setopt.c
index 8e19389ae..65fe252f4 100644
--- a/lib/setopt.c
+++ b/lib/setopt.c
@@ -2938,6 +2938,12 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
return CURLE_BAD_FUNCTION_ARGUMENT;
data->set.maxage_conn = arg;
break;
+ case CURLOPT_MAXLIFETIME_CONN:
+ arg = va_arg(param, long);
+ if(arg < 0)
+ return CURLE_BAD_FUNCTION_ARGUMENT;
+ data->set.maxlifetime_conn = arg;
+ break;
case CURLOPT_TRAILERFUNCTION:
#ifndef CURL_DISABLE_HTTP
data->set.trailer_callback = va_arg(param, curl_trailer_callback);