CURLOPT_MAXLIFETIME_CONN: make default 24 hours

Set a default value to only reuse existing connections if less than 24
hours old. This makes the TLS certificate check get redone for the new
connection. An application can still set it to zero.

Closes #18527
This commit is contained in:
Daniel Stenberg 2025-09-11 17:50:59 +02:00
parent 53f90cb3b5
commit c184f464f7
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 11 additions and 9 deletions

View file

@ -35,16 +35,18 @@ connection to have to be considered for reuse for this request.
libcurl features a connection cache that holds previously used connections.
When a new request is to be done, libcurl considers any connection that
matches for reuse. The CURLOPT_MAXLIFETIME_CONN(3) limit prevents
libcurl from trying too old connections for reuse. This can be used for
client-side load balancing. If a connection is found in the cache that is
older than this set *maxlifetime*, it is instead marked for closure.
matches for reuse. The CURLOPT_MAXLIFETIME_CONN(3) limit prevents libcurl from
trying too old connections for reuse. This can be used for client-side load
balancing. If a connection is found in the cache that is older than this set
*maxlifetime*, it is instead marked for closure.
If set to 0, this behavior is disabled: all connections are eligible for reuse.
If set to 0, this behavior is disabled: all connections are eligible for
reuse.
# DEFAULT
0 seconds (i.e., disabled)
24 hours (since 8.17.0). Before that, the default was 0 seconds (i.e.,
disabled)
# %PROTOCOLS%