summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2017-02-05 16:30:35 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2018-08-08 18:17:05 +0100
commitc7dcf3476bcdf0225bf86248606c4228a1c30b20 (patch)
tree6e91fc6661473f31556d3605042138a64d395872
parent0df7ceb8f1483f5764d46c3c1da3fc51c04639bf (diff)
downloadnetsurf-c7dcf3476bcdf0225bf86248606c4228a1c30b20.tar.gz
netsurf-c7dcf3476bcdf0225bf86248606c4228a1c30b20.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 bf9d88bc1..a358492ab 100644
--- a/content/fetchers/curl.c
+++ b/content/fetchers/curl.c
@@ -602,6 +602,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);
@@ -1492,6 +1497,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