diff mbox series

[v2,4/5] http: drop support for curl < 7.19.3 and < 7.16.4 (again)

Message ID patch-4.5-9a30e92520c-20210721T220402Z-avarab@gmail.com (mailing list archive)
State Superseded
Headers show
Series drop support for ancient curl | expand

Commit Message

Ævar Arnfjörð Bjarmason July 21, 2021, 10:22 p.m. UTC
Remove the conditional use of CURLAUTH_DIGEST_IE and
CURLOPT_USE_SSL. These two have been split from earlier simpler checks
against LIBCURL_VERSION_NUM for ease of review.

The CURLAUTH_DIGEST_IE flag was added in n 7.19.3[1], and
CURLOPT_USE_SSL in 7.16.4[2], as noted in [2] it was then renamed from
the older CURLOPT_FTP_SSL.

1. https://curl.se/libcurl/c/CURLOPT_HTTPAUTH.html
2. https://curl.se/libcurl/c/CURLOPT_USE_SSL.html

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 http.c | 4 ----
 http.h | 9 ---------
 2 files changed, 13 deletions(-)

Comments

Junio C Hamano July 21, 2021, 11:17 p.m. UTC | #1
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> Remove the conditional use of CURLAUTH_DIGEST_IE and
> CURLOPT_USE_SSL. These two have been split from earlier simpler checks
> against LIBCURL_VERSION_NUM for ease of review.
>
> The CURLAUTH_DIGEST_IE flag was added in n 7.19.3[1], and
> CURLOPT_USE_SSL in 7.16.4[2], as noted in [2] it was then renamed from
> the older CURLOPT_FTP_SSL.
>
> 1. https://curl.se/libcurl/c/CURLOPT_HTTPAUTH.html
> 2. https://curl.se/libcurl/c/CURLOPT_USE_SSL.html

My go-to place for cURL version information is:

https://github.com/curl/curl/blob/master/docs/libcurl/symbols-in-versions

and it says CURLOPT_USE_SSL has been available since 7.17.0.  If
7.16.4 was the last version in the 7.16.x series, then these two
sources are consistent.

[2] says that the feature was available under a different name in
the past and up to version 7.16.4, meaning with 7.16.4, USE_SSL was
not usable. You'd need to do "<= 7.16.4" on the title, but it is
simpler to follow the symbols-in-versions table and say "< 7.17.0",
I would think.

The patch text looks OK.
diff mbox series

Patch

diff --git a/http.c b/http.c
index 1f0d7664d35..e9446850a62 100644
--- a/http.c
+++ b/http.c
@@ -120,9 +120,7 @@  static int http_auth_methods_restricted;
 /* Modes for which empty_auth cannot actually help us. */
 static unsigned long empty_auth_useless =
 	CURLAUTH_BASIC
-#ifdef CURLAUTH_DIGEST_IE
 	| CURLAUTH_DIGEST_IE
-#endif
 	| CURLAUTH_DIGEST;
 
 static struct curl_slist *pragma_header;
@@ -893,10 +891,8 @@  static CURL *get_curl_handle(void)
 	if (curl_ftp_no_epsv)
 		curl_easy_setopt(result, CURLOPT_FTP_USE_EPSV, 0);
 
-#ifdef CURLOPT_USE_SSL
 	if (curl_ssl_try)
 		curl_easy_setopt(result, CURLOPT_USE_SSL, CURLUSESSL_TRY);
-#endif
 
 	/*
 	 * CURL also examines these variables as a fallback; but we need to query
diff --git a/http.h b/http.h
index 19f19dbe74c..3db5a0cf320 100644
--- a/http.h
+++ b/http.h
@@ -12,15 +12,6 @@ 
 
 #define DEFAULT_MAX_REQUESTS 5
 
-/*
- * CURLOPT_USE_SSL was known as CURLOPT_FTP_SSL up to 7.16.4,
- * and the constants were known as CURLFTPSSL_*
-*/
-#if !defined(CURLOPT_USE_SSL) && defined(CURLOPT_FTP_SSL)
-#define CURLOPT_USE_SSL CURLOPT_FTP_SSL
-#define CURLUSESSL_TRY CURLFTPSSL_TRY
-#endif
-
 struct slot_results {
 	CURLcode curl_result;
 	long http_code;