]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
CURLMOPT_MAX_CONCURRENT_STREAMS: make sure the set value is within range
authorDaniel Stenberg <daniel@haxx.se>
Wed, 22 Nov 2023 09:54:40 +0000 (10:54 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 22 Nov 2023 14:01:04 +0000 (15:01 +0100)
... or use the default value.

Also clarify the documentation language somewhat.

Closes #12382

docs/libcurl/opts/CURLMOPT_MAX_CONCURRENT_STREAMS.3
lib/multi.c

index 64dc2b563a4b7bea140cdce004492d2b0dde383b..d53f0460e8a8bfe8926015ef8762f19ce5daa53d 100644 (file)
@@ -34,8 +34,8 @@ CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_MAX_CONCURRENT_STREAMS,
 .fi
 .SH DESCRIPTION
 Pass a long indicating the \fBmax\fP. The set number is used as the maximum
-number of concurrent streams for a connections that libcurl should support on
-connections done using HTTP/2.
+number of concurrent streams libcurl should support on connections done using
+HTTP/2 or HTTP/3.
 
 Valid values range from 1 to 2147483647 (2^31 - 1) and defaults to 100.  The
 value passed here would be honored based on other system resources properties.
index 5fde0e75b08b7f73cbd27057ac46d519975dd407..e62f2376937a251865e66595f448580c1bd33211 100644 (file)
@@ -3293,9 +3293,9 @@ CURLMcode curl_multi_setopt(struct Curl_multi *multi,
   case CURLMOPT_MAX_CONCURRENT_STREAMS:
     {
       long streams = va_arg(param, long);
-      if(streams < 1)
+      if((streams < 1) || (streams > INT_MAX))
         streams = 100;
-      multi->max_concurrent_streams = curlx_sltoui(streams);
+      multi->max_concurrent_streams = (unsigned int)streams;
     }
     break;
   default: