Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/bf8c0e8b256f245409b50...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/bf8c0e8b256f245409b50a4...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/bf8c0e8b256f245409b50a45c...
The branch, chris/http2 has been created
at bf8c0e8b256f245409b50a45c4fe765ff6dad03a (commit)
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=bf8c0e8b256f245409b...
commit bf8c0e8b256f245409b50a45c4fe765ff6dad03a
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Allow NetSurf to use HTTP 2.0 if libcurl is new enough (7.36.0)
NB: Choices option "enable_http2" must be set to enable this.
diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c
index 612b77d..1b77b30 100644
--- a/content/fetchers/curl.c
+++ b/content/fetchers/curl.c
@@ -223,6 +223,13 @@ void fetch_curl_register(void)
SETOPT(CURLOPT_LOW_SPEED_TIME, 180L);
SETOPT(CURLOPT_NOSIGNAL, 1L);
SETOPT(CURLOPT_CONNECTTIMEOUT, 30L);
+#if LIBCURL_VERSION_NUM >= 0x072400
+ /* We've been built against libcurl 7.36.0 or later: enable HTTP 2.0 */
+ if (nsoption_bool(enable_http2)) {
+ LOG(("Enabling HTTP 2.0"));
+ SETOPT(CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
+ }
+#endif
if (nsoption_charp(ca_bundle) &&
strcmp(nsoption_charp(ca_bundle), "")) {
diff --git a/desktop/options.h b/desktop/options.h
index 391dfbc..7f5a254 100644
--- a/desktop/options.h
+++ b/desktop/options.h
@@ -208,6 +208,9 @@ NSOPTION_INTEGER(max_cached_fetch_handles, 6)
/** Suppress debug output from cURL. */
NSOPTION_BOOL(suppress_curl_debug, true)
+/** Allow cURL to use HTTP 2.0 */
+NSOPTION_BOOL(enable_http2, false)
+
/** Whether to allow target="_blank" */
NSOPTION_BOOL(target_blank, true)
-----------------------------------------------------------------------
--
NetSurf Browser