]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-curl-compat: remove check for curl 7.25.0
authorbrian m. carlson <sandals@crustytoothpaste.net>
Wed, 23 Oct 2024 00:45:50 +0000 (00:45 +0000)
committerTaylor Blau <me@ttaylorr.com>
Wed, 23 Oct 2024 20:16:35 +0000 (16:16 -0400)
libcurl 7.25.0 was released in March 2012, which is well over ten years
ago, and no major operating system vendor is still providing security
support for it.  Debian 8, RHEL 7, and Ubuntu 12.10, all of which are
out of mainstream security support, have all supported a newer version.

Remove the check for this version and use this functionality
unconditionally.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
git-curl-compat.h
http.c

index c24ed686c1eaa834e10b4418fb5d6fe0a314029b..9100af027f1d4d9d7248bbb3c96254c704b86244 100644 (file)
  * introduced, oldest first, in the official version of cURL library.
  */
 
-/**
- * CURLOPT_TCP_KEEPALIVE was added in 7.25.0, released in March 2012.
- */
-#if LIBCURL_VERSION_NUM >= 0x071900
-#define GITCURL_HAVE_CURLOPT_TCP_KEEPALIVE 1
-#endif
-
-
 /**
  * CURLOPT_LOGIN_OPTIONS was added in 7.34.0, released in December
  * 2013.
diff --git a/http.c b/http.c
index d59e59f66b12b62e187f4a9bbacfca2d31d658f9..633bbf74ee9166a7d0982af1bd35b9cbeafbfd83 100644 (file)
--- a/http.c
+++ b/http.c
@@ -716,35 +716,11 @@ static int has_proxy_cert_password(void)
 }
 #endif
 
-#ifdef GITCURL_HAVE_CURLOPT_TCP_KEEPALIVE
 static void set_curl_keepalive(CURL *c)
 {
        curl_easy_setopt(c, CURLOPT_TCP_KEEPALIVE, 1);
 }
 
-#else
-static int sockopt_callback(void *client, curl_socket_t fd, curlsocktype type)
-{
-       int ka = 1;
-       int rc;
-       socklen_t len = (socklen_t)sizeof(ka);
-
-       if (type != CURLSOCKTYPE_IPCXN)
-               return 0;
-
-       rc = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&ka, len);
-       if (rc < 0)
-               warning_errno("unable to set SO_KEEPALIVE on socket");
-
-       return CURL_SOCKOPT_OK;
-}
-
-static void set_curl_keepalive(CURL *c)
-{
-       curl_easy_setopt(c, CURLOPT_SOCKOPTFUNCTION, sockopt_callback);
-}
-#endif
-
 /* Return 1 if redactions have been made, 0 otherwise. */
 static int redact_sensitive_header(struct strbuf *header, size_t offset)
 {