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

2018-11-08 Thread Force.Charlie-I via GitGitGadget
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   | 39 +++
 2 files changed, 48 insertions(+)


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

Range-diff vs v7:

 1:  e26fc0d8c7 ! 1:  71f8b71b34 http: add support selecting http version
 @@ -78,6 +78,7 @@
  + }
  + }
  +
 ++ warning("unknown value given to http.version: '%s'", version_string);
  + return -1; /* not found */
  +}
  +

-- 
gitgitgadget


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

2018-11-08 Thread Force.Charlie-I via GitGitGadget
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(_http_version, var, value);
  + }
if (!strcmp("http.sslverify", var)) {
 @@ -95,7 +95,7 @@
  + long opt;
  + if (!get_curl_http_version_opt(curl_http_version, )) {
  + /* Set request use http version */
 -+ curl_easy_setopt(result, CURLOPT_HTTP_VERSION,opt);
 ++ curl_easy_setopt(result, CURLOPT_HTTP_VERSION, opt);
  + }
  +}
  +#endif

-- 
gitgitgadget


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

2018-11-07 Thread Force.Charlie-I via GitGitGadget
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-v6
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git 
pr-69/fcharlie/master-v6
Pull-Request: https://github.com/gitgitgadget/git/pull/69

Range-diff vs v5:

 1:  cdd93048ba ! 1:  93fda67198 http: add support selecting http version
 @@ -2,8 +2,38 @@
  
  http: add support selecting http version
  
 +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.
 +
  Signed-off-by: Force Charlie 
  
 +diff --git a/Documentation/config.txt b/Documentation/config.txt
 +--- a/Documentation/config.txt
  b/Documentation/config.txt
 +@@
 +  If set, store cookies received during requests to the file specified by
 +  http.cookieFile. Has no effect if http.cookieFile is unset.
 + 
 ++http.version::
 ++ Use the specified HTTP protocol version when communicating with a 
server.
 ++ If you want to force the default. The available and default version 
depend
 ++ on libcurl. Actually the possible values of
 ++ this option are:
 ++
 ++ - HTTP/2
 ++ - HTTP/1.1
 ++
 + http.sslVersion::
 +  The SSL version to use when negotiating an SSL connection, if you
 +  want to force the default.  The available and default version
 +
  diff --git a/http.c b/http.c
  --- a/http.c
  +++ b/http.c

-- 
gitgitgadget


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

2018-11-07 Thread Force.Charlie-I via GitGitGadget
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 
  
 -http: change http.version value type
 +http: add support selecting http version
  
  Signed-off-by: Force Charlie 
  
 @@ -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(_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, )) {
  + /* 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


[PATCH v4 0/4] http: add support selecting http version

2018-11-07 Thread Force.Charlie-I via GitGitGadget
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 (4):
  http: add support selecting http version
  support force use http 1.1
  fix curl version to support CURL_HTTP_VERSION_2TLS
  http: change http.version value type

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


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

Range-diff vs v3:

 1:  4f5a935c43 = 1:  4f5a935c43 http: add support selecting http version
 2:  06e9685d2b = 2:  06e9685d2b support force use http 1.1
 3:  eee67d8356 = 3:  eee67d8356 fix curl version to support 
CURL_HTTP_VERSION_2TLS
 4:  ef975b6093 ! 4:  0a7794722b http: change http.version value type
 @@ -67,10 +67,12 @@
  - 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);
 -+long opt=-1;
 -+if (curl_http_version 
&&!get_curl_http_version_opt(curl_http_version, )) {
 -+ /* Set request use http version */
 -+ curl_easy_setopt(result, CURLOPT_HTTP_VERSION,opt);
 ++if (curl_http_version) {
 ++ long opt;
 ++ if (!get_curl_http_version_opt(curl_http_version, )) {
 ++ /* Set request use http version */
 ++ curl_easy_setopt(result, CURLOPT_HTTP_VERSION,opt);
 ++ }
   }
   #endif
   

-- 
gitgitgadget


[PATCH v3 0/4] http: add support selecting http version

2018-11-07 Thread Force.Charlie-I via GitGitGadget
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 (4):
  http: add support selecting http version
  support force use http 1.1
  fix curl version to support CURL_HTTP_VERSION_2TLS
  http: change http.version value type

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


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

Range-diff vs v2:

 1:  4f5a935c43 = 1:  4f5a935c43 http: add support selecting http version
 2:  06e9685d2b = 2:  06e9685d2b support force use http 1.1
 3:  eee67d8356 = 3:  eee67d8356 fix curl version to support 
CURL_HTTP_VERSION_2TLS
 -:  -- > 4:  ef975b6093 http: change http.version value type

-- 
gitgitgadget


[PATCH v2 0/3] http: add support selecting http version

2018-11-07 Thread Force.Charlie-I via GitGitGadget
Normally, git doesn't need to set curl to select the HTTP version, it works
fine without HTTP2. Adding HTTP2 support is a icing on the cake.

When http.version=20 is set, git will attempt to request the server using
HTTP2. If the remote server does not support HTTP2, it is no different.
Currently bitbucket supports HTTP2 and is available for testing.

example: 

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

Force Charlie (3):
  http: add support selecting http version
  support force use http 1.1
  fix curl version to support CURL_HTTP_VERSION_2TLS

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


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

Range-diff vs v1:

 1:  4f5a935c43 = 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

-- 
gitgitgadget


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

2018-11-07 Thread Force.Charlie-I via GitGitGadget
Normally, git doesn't need to set curl to select the HTTP version, it works
fine without HTTP2. Adding HTTP2 support is a icing on the cake.

When http.version=20 is set, git will attempt to request the server using
HTTP2. If the remote server does not support HTTP2, it is no different.
Currently bitbucket supports HTTP2 and is available for testing.

example: 

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

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

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


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