Skip to content

Commit 6ea13d8

Browse files
committed
Merge branch 'tc/curl-with-backports'
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_*
2 parents d1615f9 + dd5df53 commit 6ea13d8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

http.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static struct {
9191
* here, too
9292
*/
9393
};
94-
#if LIBCURL_VERSION_NUM >= 0x071600
94+
#ifdef CURLGSSAPI_DELEGATION_FLAG
9595
static const char *curl_deleg;
9696
static struct {
9797
const char *name;
@@ -352,7 +352,7 @@ static int http_options(const char *var, const char *value, void *cb)
352352
}
353353

354354
if (!strcmp("http.delegation", var)) {
355-
#if LIBCURL_VERSION_NUM >= 0x071600
355+
#ifdef CURLGSSAPI_DELEGATION_FLAG
356356
return git_config_string(&curl_deleg, var, value);
357357
#else
358358
warning(_("Delegation control is not supported with cURL < 7.22.0"));
@@ -677,6 +677,7 @@ void setup_curl_trace(CURL *handle)
677677
curl_easy_setopt(handle, CURLOPT_DEBUGDATA, NULL);
678678
}
679679

680+
#ifdef CURLPROTO_HTTP
680681
static long get_curl_allowed_protocols(int from_user)
681682
{
682683
long allowed_protocols = 0;
@@ -692,6 +693,7 @@ static long get_curl_allowed_protocols(int from_user)
692693

693694
return allowed_protocols;
694695
}
696+
#endif
695697

696698
static CURL *get_curl_handle(void)
697699
{
@@ -717,7 +719,7 @@ static CURL *get_curl_handle(void)
717719
curl_easy_setopt(result, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
718720
#endif
719721

720-
#if LIBCURL_VERSION_NUM >= 0x071600
722+
#ifdef CURLGSSAPI_DELEGATION_FLAG
721723
if (curl_deleg) {
722724
int i;
723725
for (i = 0; i < ARRAY_SIZE(curl_deleg_levels); i++) {
@@ -790,7 +792,7 @@ static CURL *get_curl_handle(void)
790792
#elif LIBCURL_VERSION_NUM >= 0x071101
791793
curl_easy_setopt(result, CURLOPT_POST301, 1);
792794
#endif
793-
#if LIBCURL_VERSION_NUM >= 0x071304
795+
#ifdef CURLPROTO_HTTP
794796
curl_easy_setopt(result, CURLOPT_REDIR_PROTOCOLS,
795797
get_curl_allowed_protocols(0));
796798
curl_easy_setopt(result, CURLOPT_PROTOCOLS,

0 commit comments

Comments
 (0)