http: always warn if libcurl version is too old

Always warn if libcurl version is too old because: 1. Even without a protocol whitelist, newer versions of curl have all non-standard protocols disabled by default. 2. A future patch will introduce default "known-good" and "known-bad" protocols which are allowed/disallowed by 'is_transport_allowed' which older version of libcurl can't respect. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Williams committed Dec 14, 2016 at 14:39 UTC f962ddf6edb199b2611d575a75f60d20d5c137c3
3 files changed +2 -14
http.c
+2 -3
@@ -583,9 +583,8 @@ static CURL *get_curl_handle(void)
583 curl_easy_setopt(result, CURLOPT_REDIR_PROTOCOLS, allowed_protocols);
584 curl_easy_setopt(result, CURLOPT_PROTOCOLS, allowed_protocols);
585 #else
586 - if (transport_restrict_protocols())
587 - warning("protocol restrictions not applied to curl redirects because\n"
588 - "your curl version is too old (>= 7.19.4)");
586 + warning("protocol restrictions not applied to curl redirects because\n"
587 + "your curl version is too old (>= 7.19.4)");
588 #endif
589
590 if (getenv("GIT_CURL_VERBOSE"))
transport.c
-5
@@ -629,11 +629,6 @@ void transport_check_allowed(const char *type)
629 die("transport '%s' not allowed", type);
630 }
631
632 -int transport_restrict_protocols(void)
633 -{
634 - return !!protocol_whitelist();
635 -}
636 -
632 struct transport *transport_get(struct remote *remote, const char *url)
633 {
634 const char *helper;
transport.h
-6
@@ -153,12 +153,6 @@ int is_transport_allowed(const char *type);
153 */
154 void transport_check_allowed(const char *type);
155
156 -/*
157 - * Returns true if the user has attempted to turn on protocol
158 - * restrictions at all.
159 - */
160 -int transport_restrict_protocols(void);
161 -
156 /* Transport options which apply to git:// and scp-style URLs */
157
158 /* The program to use on the remote side to send a pack */