]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
setopt: CURLOPT_MAXCONNECTS set to 0 restores default value
authorDaniel Stenberg <daniel@haxx.se>
Mon, 1 Jun 2026 14:01:17 +0000 (16:01 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 1 Jun 2026 14:46:10 +0000 (16:46 +0200)
Closes #21829

lib/setopt.c

index 07fa60be7e26fb940b94887ed76ce16a37675fc1..d4c1ca69a42bc3d432b65799bc4abccad89940cc 100644 (file)
@@ -847,9 +847,9 @@ static CURLcode setopt_long_net(struct Curl_easy *data, CURLoption option,
     s->dns_cache_timeout_ms = -1;
     break;
   case CURLOPT_MAXCONNECTS:
-    result = value_range(&arg, 1, 1, INT_MAX);
+    result = value_range(&arg, 0, 0, INT_MAX);
     if(!result)
-      s->maxconnects = (uint32_t)arg;
+      s->maxconnects = arg ? (uint32_t)arg : DEFAULT_CONNCACHE_SIZE;
     break;
   case CURLOPT_SERVER_RESPONSE_TIMEOUT:
     return setopt_set_timeout_sec(&s->server_response_timeout, arg);