mirror of
https://github.com/curl/curl.git
synced 2026-08-05 22:06:15 +03:00
parent
f0f053fed0
commit
c124e6b3c0
10 changed files with 97 additions and 6 deletions
|
|
@ -1159,7 +1159,7 @@ static void populate_settings(struct connectdata *conn,
|
|||
nghttp2_settings_entry *iv = httpc->local_settings;
|
||||
|
||||
iv[0].settings_id = NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS;
|
||||
iv[0].value = 100;
|
||||
iv[0].value = (uint32_t)Curl_multi_max_concurrent_streams(conn->data->multi);
|
||||
|
||||
iv[1].settings_id = NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE;
|
||||
iv[1].value = HTTP2_HUGE_WINDOW_SIZE;
|
||||
|
|
|
|||
16
lib/multi.c
16
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ struct Curl_multi {
|
|||
struct curltime timer_lastcall; /* the fixed time for the timeout for the
|
||||
previous callback */
|
||||
bool in_callback; /* true while executing a callback */
|
||||
long max_concurrent_streams; /* max concurrent streams client to support */
|
||||
};
|
||||
|
||||
#endif /* HEADER_CURL_MULTIHANDLE_H */
|
||||
|
|
|
|||
|
|
@ -89,4 +89,10 @@ CURLMcode Curl_multi_add_perform(struct Curl_multi *multi,
|
|||
struct Curl_easy *data,
|
||||
struct connectdata *conn);
|
||||
|
||||
|
||||
/* Return the value of the CURLMOPT_MAX_CONCURRENT_STREAMS option
|
||||
* If not specified or 0, default would be 100
|
||||
*/
|
||||
size_t Curl_multi_max_concurrent_streams(struct Curl_multi *multi);
|
||||
|
||||
#endif /* HEADER_CURL_MULTIIF_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue