Skip to content

Commit f18777b

Browse files
tgcgitster
authored andcommitted
http: fix handling of missing CURLPROTO_*
Commit aeae4db refactored the handling of the curl protocol restriction support into a function but failed to add a version check for older versions of curl that lack CURLPROTO_* support. Add the missing check and at the same time convert it to a feature check instead of a version based check. This is done to ensure that vendor supported curl versions that have had CURLPROTO_* support backported are handled correctly. Signed-off-by: Tom G. Christensen <tgc@jupiterrise.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 4274c69 commit f18777b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

http.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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
{
@@ -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)