diff options
author | Jeffrey Tolar <tolar@yahooinc.com> | 2021-09-18 11:29:44 -0500 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-10-06 14:38:59 +0200 |
commit | 5f563495f1f9cf7ef4f23f997e4c2707dd3e74a8 (patch) | |
tree | e6d017874795f4c0bfe61105b1a245f44699ae2c /lib/setopt.c | |
parent | 013cb2ff7d3a37cab6910cc2e4d255377d341b6e (diff) | |
download | curl-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.c | 6 |
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); |