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
This commit is contained in:
Jeffrey Tolar 2021-09-18 11:29:44 -05:00 committed by Daniel Stenberg
parent 013cb2ff7d
commit 5f563495f1
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
16 changed files with 272 additions and 12 deletions

View file

@ -2058,7 +2058,8 @@ typedef enum {
/* alt-svc cache file name to possibly read from/write to */
CURLOPT(CURLOPT_ALTSVC, CURLOPTTYPE_STRINGPOINT, 287),
/* maximum age of a connection to consider it for reuse (in seconds) */
/* maximum age (idle time) of a connection to consider it for reuse
* (in seconds) */
CURLOPT(CURLOPT_MAXAGE_CONN, CURLOPTTYPE_LONG, 288),
/* SASL authorisation identity */
@ -2127,6 +2128,10 @@ typedef enum {
/* Data passed to the CURLOPT_PREREQFUNCTION callback */
CURLOPT(CURLOPT_PREREQDATA, CURLOPTTYPE_CBPOINT, 313),
/* maximum age (since creation) of a connection to consider it for reuse
* (in seconds) */
CURLOPT(CURLOPT_MAXLIFETIME_CONN, CURLOPTTYPE_LONG, 314),
CURLOPT_LASTENTRY /* the last unused */
} CURLoption;