]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
url: allow DoH transfers to override max connection limit
authorDaniel Stenberg <daniel@haxx.se>
Tue, 4 Jun 2024 15:00:05 +0000 (17:00 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 5 Jun 2024 06:35:12 +0000 (08:35 +0200)
When reaching the set maximum limit of allowed connections, allow a new
connection anyway if the transfer is created for the (internal) purpose
of doing a DoH name resolve. Otherwise, unrelated "normal" transfers can
starve out new DoH requests making it impossible to name resolve for new
transfers.

Bug: https://curl.se/mail/lib-2024-06/0001.html
Reported-by: kartatz
Closes #13880

lib/url.c

index 41e35e1531422c4092fd56303e99229a92c05b0c..4eabf0c8769696a6cff513aba0b1dc834baf9e16 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -3662,10 +3662,16 @@ static CURLcode create_conn(struct Curl_easy *data,
       conn_candidate = Curl_conncache_extract_oldest(data);
       if(conn_candidate)
         Curl_disconnect(data, conn_candidate, FALSE);
-      else {
-        infof(data, "No connections available in cache");
-        connections_available = FALSE;
-      }
+      else
+#ifndef CURL_DISABLE_DOH
+        if(data->set.dohfor)
+          infof(data, "Allowing DoH to override max connection limit");
+        else
+#endif
+        {
+          infof(data, "No connections available in cache");
+          connections_available = FALSE;
+        }
     }
 
     if(!connections_available) {