Subject: [PATCH v7 0/1] http: add support selecting http version

From: "Force.Charlie-I via GitGitGadget" <[email-masked]>
Date: Thu, 08 Nov 2018 15:15:17 -0800 (PST)

Usually we don't need to set libcurl to choose which version of the HTTP
protocol to use to communicate with a server. But different versions of
libcurl, the default value is not the same.

CURL >= 7.62.0: CURL_HTTP_VERSION_2TLS CURL < 7.62: CURL_HTTP_VERSION_1_1

In order to give users the freedom to control the HTTP version, we need to
add a setting to choose which HTTP version to use.

This patch support force enable HTTP/2 or HTTP/1.1. 

example: 

GIT_CURL_VERBOSE=1 git2 -c http.version=HTTP/2 ls-remote https://bitbucket.org/aquariusjay/deeplab-public-ver2.git

Force Charlie (1):
  http: add support selecting http version

 Documentation/config.txt |  9 +++++++++
 http.c                   | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)

base-commit: 8858448bb49332d353febc078ce4a3abcc962efe
Published-As: https://github.com/gitgitgadget/git/releases/tags/pr-69%2Ffcharlie%2Fmaster-v7
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-69/fcharlie/master-v7
Pull-Request: https://github.com/gitgitgadget/git/pull/69

Range-diff vs v6:

 1:  93fda67198 ! 1:  e26fc0d8c7 http: add support selecting http version
     @@ -49,7 +49,7 @@
       
       static int http_options(const char *var, const char *value, void *cb)
       {
     -+	if (!strcmp("http.version",var)) {
     ++	if (!strcmp("http.version", var)) {
      +		return git_config_string(&curl_http_version, var, value);
      +	}
       	if (!strcmp("http.sslverify", var)) {
     @@ -95,7 +95,7 @@
      +		long opt;
      +		if (!get_curl_http_version_opt(curl_http_version, &opt)) {
      +			/* Set request use http version */
     -+			curl_easy_setopt(result, CURLOPT_HTTP_VERSION,opt);
     ++			curl_easy_setopt(result, CURLOPT_HTTP_VERSION, opt);
      +		}
      +    }
      +#endif

-- 
gitgitgadget