summaryrefslogtreecommitdiff
path: root/lib/conncache.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-12-10 10:39:16 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-12-10 10:39:16 +0100
commit46c2c9823c82bfbca40a3f5fee620c27807dacd7 (patch)
treeb32918ffda7df945c3f3199d0ec32a7c840ae62b /lib/conncache.c
parentc6deecd7e9ea7dd10de0934f8ec30952648aba2d (diff)
downloadcurl-46c2c9823c82bfbca40a3f5fee620c27807dacd7.tar.gz
conncache: CONNECT_ONLY connections are now assumed in-use alwaysbagder/connect-only-always-used
This makes them never to be considered "the oldest" to be discarded when reaching the connection cache limit. The reasoning here is that CONNECT_ONLY is primarily used in combination with using the connection's socket post connect and since that is used outside of curl's knowledge we must assume that it is in use until explicitly closed. Reported-by: Pavel Pavlov Reported-by: Pavel Löbl Fixes #4426 Fixes #4369
Diffstat (limited to 'lib/conncache.c')
-rw-r--r--lib/conncache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/conncache.c b/lib/conncache.c
index a23244cf6..28044644b 100644
--- a/lib/conncache.c
+++ b/lib/conncache.c
@@ -519,7 +519,8 @@ Curl_conncache_extract_oldest(struct Curl_easy *data)
while(curr) {
conn = curr->ptr;
- if(!CONN_INUSE(conn) && !conn->data && !conn->bits.close) {
+ if(!CONN_INUSE(conn) && !conn->data && !conn->bits.close &&
+ !conn->bits.connect_only) {
/* Set higher score for the age passed since the connection was used */
score = Curl_timediff(now, conn->lastused);