git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] http.c: fix compiling with libcurl 7.9.2
@ 2009-06-15  2:39 Mark Lodato
  2009-06-15  2:39 ` [PATCH 2/2] http.c: add http.sslCertType and http.sslKeyType Mark Lodato
  2009-06-15  4:35 ` [PATCH 1/2] http.c: fix compiling with libcurl 7.9.2 Junio C Hamano
  0 siblings, 2 replies; 11+ messages in thread
From: Mark Lodato @ 2009-06-15  2:39 UTC (permalink / raw)
  To: Junio C Hamano, git; +Cc: Mark Lodato

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-06-18 16:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-15  2:39 [PATCH 1/2] http.c: fix compiling with libcurl 7.9.2 Mark Lodato
2009-06-15  2:39 ` [PATCH 2/2] http.c: add http.sslCertType and http.sslKeyType Mark Lodato
2009-06-15 17:43   ` Karsten Weiss
2009-06-16  0:55     ` Mark Lodato
2009-06-16  5:56       ` Junio C Hamano
2009-06-16  6:47         ` Junio C Hamano
2009-06-16 20:07       ` Karsten Weiss
2009-06-16  0:56     ` Mark Lodato
2009-06-15  4:35 ` [PATCH 1/2] http.c: fix compiling with libcurl 7.9.2 Junio C Hamano
2009-06-15 12:55   ` Tay Ray Chuan
2009-06-18 16:26   ` Mike Ralphson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).