git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 02/13] git-curl-compat: remove check for curl 7.25.0

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Oct 10, 2024, 23:56 UTC
Message-ID
<20241010235621.738239-3-sandals@crustytoothpaste.net>
In-Reply-To
<20241010235621.738239-1-sandals@crustytoothpaste.net>

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>
---
 git-curl-compat.h |  8 --------
 http.c            | 24 ------------------------
 2 files changed, 32 deletions(-)
diff --git a/git-curl-compat.h b/git-curl-compat.h
index c24ed686c1..9100af027f 100644
--- a/git-curl-compat.h
+++ b/git-curl-compat.h
@@ -28,14 +28,6 @@
  * 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 d59e59f66b..633bbf74ee 100644
--- 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)
 {
Previous: brian m. carlsonNext: brian m. carlson
Message 3 of 56 in “Update versions of libcurl and Perl”
  1. 00/13 Update versions of libcurl and Perlbrian m. carlson, Oct 10, 2024
  2. 01/13 git-curl-compat: remove check for curl 7.21.5brian m. carlson, Oct 10, 2024
  3. 02/13 git-curl-compat: remove check for curl 7.25.0brian m. carlson, Oct 10, 2024
  4. 03/13 git-curl-compat: remove check for curl 7.34.0brian m. carlson, Oct 10, 2024
  5. 04/13 git-curl-compat: remove check for curl 7.39.0brian m. carlson, Oct 10, 2024
  6. 05/13 git-curl-compat: remove check for curl 7.43.0brian m. carlson, Oct 10, 2024
  7. 06/13 git-curl-compat: remove check for curl 7.44.0brian m. carlson, Oct 10, 2024
  8. 07/13 git-curl-compat: remove check for curl 7.52.0brian m. carlson, Oct 10, 2024
  9. 09/13 git-curl-compat: remove check for curl 7.56.0brian m. carlson, Oct 10, 2024
  10. Patrick SteinhardtOct 11, 2024
  11. Jeff KingOct 11, 2024
  12. Patrick SteinhardtOct 11, 2024
  13. Junio C HamanoOct 11, 2024
  14. 10/13 INSTALL: document requirement for libcurl 7.61.0brian m. carlson, Oct 10, 2024
  15. 12/13 INSTALL: require Perl 5.26.0brian m. carlson, Oct 10, 2024
  16. Oswald BuddenhagenOct 11, 2024
  17. brian m. carlsonOct 15, 2024
  18. 11/13 Require Perl 5.26.0brian m. carlson, Oct 10, 2024
  19. 08/13 git-curl-compat: remove check for curl 7.53.0brian m. carlson, Oct 10, 2024
  20. 13/13 gitweb: make use of s///rbrian m. carlson, Oct 10, 2024
  21. Jeff KingOct 11, 2024
  22. Junio C HamanoOct 11, 2024
  23. Eric SunshineOct 11, 2024
  24. Junio C HamanoOct 11, 2024
  25. Alejandro R. SedeñoOct 11, 2024
  26. Eric SunshineOct 11, 2024
  27. brian m. carlsonOct 11, 2024
  28. Eric SunshineOct 15, 2024
  29. Taylor BlauOct 15, 2024
  30. brian m. carlsonOct 15, 2024
  31. Alejandro R. SedeñoOct 16, 2024
  32. Eli SchwartzOct 22, 2024
  33. brian m. carlsonOct 22, 2024
  34. Alejandro R. SedeñoOct 11, 2024
  35. Junio C HamanoOct 11, 2024
  36. Alejandro R. SedeñoOct 14, 2024
  37. Patrick SteinhardtOct 17, 2024
  38. 00/12 Update versions of libcurl and Perlbrian m. carlson, Oct 23, 2024
  39. 04/12 git-curl-compat: remove check for curl 7.39.0brian m. carlson, Oct 23, 2024
  40. 03/12 git-curl-compat: remove check for curl 7.34.0brian m. carlson, Oct 23, 2024
  41. 01/12 git-curl-compat: remove check for curl 7.21.5brian m. carlson, Oct 23, 2024
  42. 02/12 git-curl-compat: remove check for curl 7.25.0brian m. carlson, Oct 23, 2024
  43. 05/12 git-curl-compat: remove check for curl 7.43.0brian m. carlson, Oct 23, 2024
  44. 06/12 git-curl-compat: remove check for curl 7.44.0brian m. carlson, Oct 23, 2024
  45. 08/12 git-curl-compat: remove check for curl 7.53.0brian m. carlson, Oct 23, 2024
  46. 09/12 git-curl-compat: remove check for curl 7.56.0brian m. carlson, Oct 23, 2024
  47. 12/12 gitweb: make use of s///rbrian m. carlson, Oct 23, 2024
  48. Oswald BuddenhagenOct 23, 2024
  49. brian m. carlsonOct 24, 2024
  50. 10/12 INSTALL: document requirement for libcurl 7.61.0brian m. carlson, Oct 23, 2024
  51. 11/12 Require Perl 5.26.0brian m. carlson, Oct 23, 2024
  52. rsbecker@nexbridge.comOct 23, 2024
  53. 07/12 git-curl-compat: remove check for curl 7.52.0brian m. carlson, Oct 23, 2024
  54. Taylor BlauOct 23, 2024
  55. Patrick SteinhardtOct 24, 2024
  56. brian m. carlsonOct 24, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.