diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2017-09-29 17:06:42 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2017-09-29 17:06:42 -0400 |
commit | 586d697475da239060abd8df030778fbdfb0cf51 (patch) | |
tree | d06ec751e6a1ad5e695938a602b2a95552b39742 /indra/llcorehttp/_httplibcurl.cpp | |
parent | ee2a1902a59f41326bea2dccb79f920640cad7c0 (diff) |
MAINT-7081: Try requesting HTTP/2 when a request wants pipelining.
Diffstat (limited to 'indra/llcorehttp/_httplibcurl.cpp')
-rw-r--r-- | indra/llcorehttp/_httplibcurl.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/indra/llcorehttp/_httplibcurl.cpp b/indra/llcorehttp/_httplibcurl.cpp index c25e01a318..947a065d0a 100644 --- a/indra/llcorehttp/_httplibcurl.cpp +++ b/indra/llcorehttp/_httplibcurl.cpp @@ -40,6 +40,15 @@ namespace void check_curl_multi_code(CURLMcode code); void check_curl_multi_code(CURLMcode code, int curl_setopt_option); +// This is a template because different 'option' values require different +// types for 'ARG'. Just pass them through unchanged (by value). +template <typename ARG> +void check_curl_multi_setopt(CURLM* handle, CURLMoption option, ARG argument) +{ + CURLMcode code = curl_multi_setopt(handle, option, argument); + check_curl_multi_code(code, option); +} + static const char * const LOG_CORE("CoreHttp"); } // end anonymous namespace @@ -466,41 +475,34 @@ void HttpLibcurl::policyUpdated(int policy_class) // Enable policy if stalled policy.stallPolicy(policy_class, false); mDirtyPolicy[policy_class] = false; - + if (options.mPipelining > 1) { // We'll try to do pipelining on this multihandle - code = curl_multi_setopt(multi_handle, + check_curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, 1L); - check_curl_multi_code(code, CURLMOPT_PIPELINING); - code = curl_multi_setopt(multi_handle, + check_curl_multi_setopt(multi_handle, CURLMOPT_MAX_PIPELINE_LENGTH, long(options.mPipelining)); - check_curl_multi_code(code, CURLMOPT_MAX_PIPELINE_LENGTH); - code = curl_multi_setopt(multi_handle, + check_curl_multi_setopt(multi_handle, CURLMOPT_MAX_HOST_CONNECTIONS, long(options.mPerHostConnectionLimit)); - check_curl_multi_code(code, CURLMOPT_MAX_HOST_CONNECTIONS); - code = curl_multi_setopt(multi_handle, + check_curl_multi_setopt(multi_handle, CURLMOPT_MAX_TOTAL_CONNECTIONS, long(options.mConnectionLimit)); - check_curl_multi_code(code, CURLMOPT_MAX_TOTAL_CONNECTIONS); } else { - code = curl_multi_setopt(multi_handle, + check_curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, 0L); - check_curl_multi_code(code, CURLMOPT_PIPELINING); - code = curl_multi_setopt(multi_handle, + check_curl_multi_setopt(multi_handle, CURLMOPT_MAX_HOST_CONNECTIONS, 0L); - check_curl_multi_code(code, CURLMOPT_MAX_HOST_CONNECTIONS); - code = curl_multi_setopt(multi_handle, + check_curl_multi_setopt(multi_handle, CURLMOPT_MAX_TOTAL_CONNECTIONS, long(options.mConnectionLimit)); - check_curl_multi_code(code, CURLMOPT_MAX_TOTAL_CONNECTIONS); } } else if (! mDirtyPolicy[policy_class]) |