summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2017-02-05 16:30:35 (GMT)
committer Chris Young <chris@unsatisfactorysoftware.co.uk>2017-02-05 16:30:35 (GMT)
commitae094cff2938104e5a3a46c430bd35b5b32a039b (patch)
treef38eaa3d88559a9278d717d00885ba266005302d
parentf1c98ccfa404f1890fa6299a69b165a226dc4d35 (diff)
downloadnetsurf-ae094cff2938104e5a3a46c430bd35b5b32a039b.tar.gz
netsurf-ae094cff2938104e5a3a46c430bd35b5b32a039b.tar.bz2
Prefer HTTP/2+multiplexing on encrypted connectionschris/http2
-rw-r--r--content/fetchers/curl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c
index 7d0e40c..c8e4caf 100644
--- a/content/fetchers/curl.c
+++ b/content/fetchers/curl.c
@@ -569,6 +569,11 @@ static CURLcode fetch_curl_set_options(struct curl_fetch_info *f)
return code; \
}
+#if LIBCURL_VERSION_NUM >= 0x072f00
+ /* Added in 7.47 */
+ /* Prefer HTTP/2 on encrypted connections */
+ SETOPT(CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS);
+#endif
SETOPT(CURLOPT_URL, nsurl_access(f->url));
SETOPT(CURLOPT_PRIVATE, f);
SETOPT(CURLOPT_WRITEDATA, f);
@@ -1457,6 +1462,13 @@ nserror fetch_curl_register(void)
SETOPT(CURLMOPT_MAXCONNECTS, maxconnects);
SETOPT(CURLMOPT_MAX_TOTAL_CONNECTIONS, maxconnects);
SETOPT(CURLMOPT_MAX_HOST_CONNECTIONS, nsoption_int(max_fetchers_per_host));
+
+#if LIBCURL_VERSION_NUM >= 0x072b00
+ /* Added in 7.43.0 */
+ /* Use HTTP/2 multiplexing */
+ SETOPT(CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
+#endif
+
}
#endif