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

[PATCH 1/2] http.c: fix compiling with libcurl 7.9.2

From
Mark Lodato <lodatom@gmail.com>
Date
Jun 15, 2009, 02:39 UTC
Message-ID
<1245033541-15558-1-git-send-email-lodatom@gmail.com>

Change the minimimum required libcurl version for the http.sslKey option to 7.9.3. Previously, preprocessor macros checked for >= 7.9.2, which is incorrect because CURLOPT_SSLKEY was introduced in 7.9.3. This now allows git to compile with libcurl 7.9.2.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
---

This patch series is independent of my other password prompting patch series, and is based off 'next', which includes Tay Ray Chuan's recent http changes.

Note that git still does not compile on libcurl before 7.9.1 or below, since CURLOPT_FTP_USE_EPSV (http.c:236) is defined in libcurl 7.9.2.

One question: In http.c, there are unnecessary #if LIBCURL_VERSION_NUM's surrounding the global variable declarations, in http_options(), and in http_init(). Is there a reason why these exist? If not, I think removing them would make the code easier to read.

Any feedback or suggestions are appreciated! Mark

 http.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/http.c b/http.c
index 95b2137..b049948 100644
--- a/http.c
+++ b/http.c
@@ -20,7 +20,7 @@ char curl_errorstr[CURL_ERROR_SIZE];
 
 static int curl_ssl_verify = -1;
 static const char *ssl_cert;
-#if LIBCURL_VERSION_NUM >= 0x070902
+#if LIBCURL_VERSION_NUM >= 0x070903
 static const char *ssl_key;
 #endif
 #if LIBCURL_VERSION_NUM >= 0x070908
@@ -126,7 +126,7 @@ static int http_options(const char *var, const char *value, void *cb)
 	}
 	if (!strcmp("http.sslcert", var))
 		return git_config_string(&ssl_cert, var, value);
-#if LIBCURL_VERSION_NUM >= 0x070902
+#if LIBCURL_VERSION_NUM >= 0x070903
 	if (!strcmp("http.sslkey", var))
 		return git_config_string(&ssl_key, var, value);
 #endif
@@ -196,7 +196,7 @@ static CURL *get_curl_handle(void)
 
 	if (ssl_cert != NULL)
 		curl_easy_setopt(result, CURLOPT_SSLCERT, ssl_cert);
-#if LIBCURL_VERSION_NUM >= 0x070902
+#if LIBCURL_VERSION_NUM >= 0x070903
 	if (ssl_key != NULL)
 		curl_easy_setopt(result, CURLOPT_SSLKEY, ssl_key);
 #endif
@@ -313,7 +313,7 @@ void http_init(struct remote *remote)
 		curl_ssl_verify = 0;
 
 	set_from_env(&ssl_cert, "GIT_SSL_CERT");
-#if LIBCURL_VERSION_NUM >= 0x070902
+#if LIBCURL_VERSION_NUM >= 0x070903
 	set_from_env(&ssl_key, "GIT_SSL_KEY");
 #endif
 #if LIBCURL_VERSION_NUM >= 0x070908
-- 
1.6.3.2
Next: Mark Lodato
Message 1 of 11 in “http.c: fix compiling with libcurl 7.9.2”
  1. 1/2 http.c: fix compiling with libcurl 7.9.2Mark Lodato, Jun 15, 2009
  2. 2/2 http.c: add http.sslCertType and http.sslKeyTypeMark Lodato, Jun 15, 2009
  3. Karsten WeissJun 15, 2009
  4. Mark LodatoJun 16, 2009
  5. Junio C HamanoJun 16, 2009
  6. Junio C HamanoJun 16, 2009
  7. Karsten WeissJun 16, 2009
  8. Mark LodatoJun 16, 2009
  9. Junio C HamanoJun 15, 2009
  10. Tay Ray ChuanJun 15, 2009
  11. Mike RalphsonJun 18, 2009

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.