diff options
author | Kunal Ekawde <kunal_ekawde@affirmednetworks.com> | 2019-09-24 08:56:11 -0400 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-10-02 07:47:48 +0200 |
commit | c124e6b3c04bfd254e24312bc66c2bc9db919442 (patch) | |
tree | 861a66bb058eb9f51fd7c2d93cf133dd505e577f /lib/multi.c | |
parent | f0f053fed034bacf956a9f32ea65529b0b123247 (diff) | |
download | curl-c124e6b3c04bfd254e24312bc66c2bc9db919442.tar.gz |
CURLMOPT_MAX_CONCURRENT_STREAMS: new setopt
Closes #4410
Diffstat (limited to 'lib/multi.c')
-rwxr-xr-x | lib/multi.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/multi.c b/lib/multi.c index 22e0dcfd1..6dfe8842e 100755 --- a/lib/multi.c +++ b/lib/multi.c @@ -2772,6 +2772,16 @@ CURLMcode curl_multi_setopt(struct Curl_multi *multi, break; case CURLMOPT_PIPELINING_SERVER_BL: break; + case CURLMOPT_MAX_CONCURRENT_STREAMS: + { + long streams = va_arg(param, long); + if(streams < 1) + streams = 100; + multi->max_concurrent_streams = + (streams > (long)INITIAL_MAX_CONCURRENT_STREAMS)? + (long)INITIAL_MAX_CONCURRENT_STREAMS : streams; + } + break; default: res = CURLM_UNKNOWN_OPTION; break; @@ -3210,3 +3220,9 @@ void Curl_multi_dump(struct Curl_multi *multi) } } #endif + +size_t Curl_multi_max_concurrent_streams(struct Curl_multi *multi) +{ + return multi ? ((size_t)multi->max_concurrent_streams ? + (size_t)multi->max_concurrent_streams : 100) : 0; +} |