Merge branch 'tc/curl-with-backports'
authorJunio C Hamano <gitster@pobox.com>
Thu, 24 Aug 2017 17:20:02 +0000 (10:20 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 24 Aug 2017 17:20:02 +0000 (10:20 -0700)
Updates to the HTTP layer we made recently unconditionally used
features of libCurl without checking the existence of them, causing
compilation errors, which has been fixed. Also migrate the code to
check feature macros, not version numbers, to cope better with
libCurl that vendor ships with backported features.

* tc/curl-with-backports:
http: use a feature check to enable GSSAPI delegation control
http: fix handling of missing CURLPROTO_*

1  2 
http.c
diff --combined http.c
index 76ff63c14d44057f78b532fb9d873c94ae56231e,e24725f32a52ffda9d1cc438d4182143f1830e4a..fa8666a21f7a2f59f0e70bd97bc8482f18ef7e38
--- 1/http.c
--- 2/http.c
+++ b/http.c
@@@ -91,7 -91,7 +91,7 @@@ static struct 
         * here, too
         */
  };
- #if LIBCURL_VERSION_NUM >= 0x071600
+ #ifdef CURLGSSAPI_DELEGATION_FLAG
  static const char *curl_deleg;
  static struct {
        const char *name;
@@@ -272,10 -272,10 +272,10 @@@ static int http_options(const char *var
        if (!strcmp("http.sslversion", var))
                return git_config_string(&ssl_version, var, value);
        if (!strcmp("http.sslcert", var))
 -              return git_config_string(&ssl_cert, var, value);
 +              return git_config_pathname(&ssl_cert, var, value);
  #if LIBCURL_VERSION_NUM >= 0x070903
        if (!strcmp("http.sslkey", var))
 -              return git_config_string(&ssl_key, var, value);
 +              return git_config_pathname(&ssl_key, var, value);
  #endif
  #if LIBCURL_VERSION_NUM >= 0x070908
        if (!strcmp("http.sslcapath", var))
        }
  
        if (!strcmp("http.delegation", var)) {
- #if LIBCURL_VERSION_NUM >= 0x071600
+ #ifdef CURLGSSAPI_DELEGATION_FLAG
                return git_config_string(&curl_deleg, var, value);
  #else
                warning(_("Delegation control is not supported with cURL < 7.22.0"));
@@@ -677,6 -677,7 +677,7 @@@ void setup_curl_trace(CURL *handle
        curl_easy_setopt(handle, CURLOPT_DEBUGDATA, NULL);
  }
  
+ #ifdef CURLPROTO_HTTP
  static long get_curl_allowed_protocols(int from_user)
  {
        long allowed_protocols = 0;
  
        return allowed_protocols;
  }
+ #endif
  
  static CURL *get_curl_handle(void)
  {
        curl_easy_setopt(result, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
  #endif
  
- #if LIBCURL_VERSION_NUM >= 0x071600
+ #ifdef CURLGSSAPI_DELEGATION_FLAG
        if (curl_deleg) {
                int i;
                for (i = 0; i < ARRAY_SIZE(curl_deleg_levels); i++) {
  #elif LIBCURL_VERSION_NUM >= 0x071101
        curl_easy_setopt(result, CURLOPT_POST301, 1);
  #endif
- #if LIBCURL_VERSION_NUM >= 0x071304
+ #ifdef CURLPROTO_HTTP
        curl_easy_setopt(result, CURLOPT_REDIR_PROTOCOLS,
                         get_curl_allowed_protocols(0));
        curl_easy_setopt(result, CURLOPT_PROTOCOLS,