git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
From: "Force.Charlie-I via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v5 0/1] http: add support selecting http version
Date: Wed, 07 Nov 2018 22:18:40 -0800 (PST)
Message-ID: <pull.69.v5.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.69.v4.git.gitgitgadget@gmail.com>

Normally, git doesn't need to set curl to select the HTTP version, it works
fine without HTTP/2. Adding HTTP/2 support is a icing on the cake.

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

 http.c | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)


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

Range-diff vs v4:

 1:  4f5a935c43 < -:  ---------- http: add support selecting http version
 2:  06e9685d2b < -:  ---------- support force use http 1.1
 3:  eee67d8356 < -:  ---------- fix curl version to support CURL_HTTP_VERSION_2TLS
 4:  0a7794722b ! 1:  cdd93048ba http: change http.version value type
     @@ -1,6 +1,6 @@
      Author: Force Charlie <charlieio@outlook.com>
      
     -    http: change http.version value type
     +    http: add support selecting http version
      
          Signed-off-by: Force Charlie <charlieio@outlook.com>
      
     @@ -11,21 +11,20 @@
       
       static int curl_ssl_verify = -1;
       static int curl_ssl_try;
     --static int curl_http_version = 0;
      +static const char *curl_http_version = NULL;
       static const char *ssl_cert;
       static const char *ssl_cipherlist;
       static const char *ssl_version;
      @@
     + 
       static int http_options(const char *var, const char *value, void *cb)
       {
     - 	if (!strcmp("http.version",var)) {
     --		curl_http_version=git_config_int(var,value);
     --		return 0;
     ++	if (!strcmp("http.version",var)) {
      +		return git_config_string(&curl_http_version, var, value);
     - 	}
     ++	}
       	if (!strcmp("http.sslverify", var)) {
       		curl_ssl_verify = git_config_bool(var, value);
     + 		return 0;
      @@
       }
       #endif
     @@ -58,21 +57,19 @@
       {
       	CURL *result = curl_easy_init();
      @@
     + 		curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 2);
       	}
       
     - #if LIBCURL_VERSION_NUM >= 0x072f00 // 7.47.0
     --    // curl_http_version 0 is default.
     --    if (curl_http_version == 20) {
     --		/* Enable HTTP2*/
     --		curl_easy_setopt(result, CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_2TLS);
     --    } else if (curl_http_version == 11) {
     --		curl_easy_setopt(result, CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1);
     ++#if LIBCURL_VERSION_NUM >= 0x072f00 // 7.47.0
      +    if (curl_http_version) {
      +		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);
      +		}
     -     }
     ++    }
     ++#endif
     ++
     + #if LIBCURL_VERSION_NUM >= 0x070907
     + 	curl_easy_setopt(result, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
       #endif
     - 

-- 
gitgitgadget

  parent reply index

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 13:33 [PATCH " Force.Charlie-I via GitGitGadget
2018-11-07 13:33 ` [PATCH 1/1] " Force Charlie via GitGitGadget
2018-11-08  1:48   ` Junio C Hamano
2018-11-07 13:44 ` [PATCH 0/1] " Daniel Stenberg
2018-11-08  1:18   ` brian m. carlson
2018-11-08  3:35     ` Junio C Hamano
2018-11-08  1:35 ` [PATCH v2 0/3] " Force.Charlie-I via GitGitGadget
2018-11-08  1:35   ` [PATCH v2 1/3] " Force Charlie via GitGitGadget
2018-11-08  1:35   ` [PATCH v2 2/3] support force use http 1.1 Force Charlie via GitGitGadget
2018-11-08  1:35   ` [PATCH v2 3/3] fix curl version to support CURL_HTTP_VERSION_2TLS Force Charlie via GitGitGadget
2018-11-08  4:54   ` [PATCH v3 0/4] http: add support selecting http version Force.Charlie-I via GitGitGadget
2018-11-08  4:54     ` [PATCH v3 1/4] " Force Charlie via GitGitGadget
2018-11-08  4:55     ` [PATCH v3 2/4] support force use http 1.1 Force Charlie via GitGitGadget
2018-11-08  4:55     ` [PATCH v3 3/4] fix curl version to support CURL_HTTP_VERSION_2TLS Force Charlie via GitGitGadget
2018-11-08  4:55     ` [PATCH v3 4/4] http: change http.version value type Force Charlie via GitGitGadget
2018-11-08  6:14     ` [PATCH v4 0/4] http: add support selecting http version Force.Charlie-I via GitGitGadget
2018-11-08  6:14       ` [PATCH v4 1/4] " Force Charlie via GitGitGadget
2018-11-08  6:14       ` [PATCH v4 2/4] support force use http 1.1 Force Charlie via GitGitGadget
2018-11-08  6:14       ` [PATCH v4 3/4] fix curl version to support CURL_HTTP_VERSION_2TLS Force Charlie via GitGitGadget
2018-11-08  6:14       ` [PATCH v4 4/4] http: change http.version value type Force Charlie via GitGitGadget
2018-11-08  6:18       ` Force.Charlie-I via GitGitGadget [this message]
2018-11-08  6:18         ` [PATCH v5 1/1] http: add support selecting http version Force Charlie via GitGitGadget
2018-11-08  7:00         ` [PATCH v6 0/1] " Force.Charlie-I via GitGitGadget
2018-11-08  7:00           ` [PATCH v6 1/1] " Force Charlie via GitGitGadget
2018-11-08 18:02             ` Eric Sunshine
2018-11-09  2:57               ` Junio C Hamano
2018-11-09  2:56             ` Junio C Hamano
2018-11-08 23:15           ` [PATCH v7 0/1] " Force.Charlie-I via GitGitGadget
2018-11-08 23:15             ` [PATCH v7 1/1] " Force Charlie via GitGitGadget
2018-11-09  3:52               ` Junio C Hamano
2018-11-09  3:44             ` [PATCH v8 0/1] " Force.Charlie-I via GitGitGadget
2018-11-09  3:44               ` [PATCH v8 1/1] " Force Charlie via GitGitGadget
2018-11-08  6:14     ` [PATCH v3 0/4] " Junio C Hamano

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.69.v5.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox