@matheusbsbs / matheus-bagliano / commits / ef52aafa0f
Fork 0

http.c: fix compiling with libcurl 7.9.2

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> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Mark Lodato committed Jun 14, 2009 at 22:39 UTC ef52aafa0f8b1d34f2ecd9b58f2198711c87cab3
1 file changed +4 -4
http.c
+4 -4
@@ -14,7 +14,7 @@ char curl_errorstr[CURL_ERROR_SIZE];
14
15 static int curl_ssl_verify = -1;
16 static const char *ssl_cert;
17 -#if LIBCURL_VERSION_NUM >= 0x070902
17 +#if LIBCURL_VERSION_NUM >= 0x070903
18 static const char *ssl_key;
19 #endif
20 #if LIBCURL_VERSION_NUM >= 0x070908
@@ -119,7 +119,7 @@ static int http_options(const char *var, const char *value, void *cb)
119 }
120 if (!strcmp("http.sslcert", var))
121 return git_config_string(&ssl_cert, var, value);
122 -#if LIBCURL_VERSION_NUM >= 0x070902
122 +#if LIBCURL_VERSION_NUM >= 0x070903
123 if (!strcmp("http.sslkey", var))
124 return git_config_string(&ssl_key, var, value);
125 #endif
@@ -189,7 +189,7 @@ static CURL *get_curl_handle(void)
189
190 if (ssl_cert != NULL)
191 curl_easy_setopt(result, CURLOPT_SSLCERT, ssl_cert);
192 -#if LIBCURL_VERSION_NUM >= 0x070902
192 +#if LIBCURL_VERSION_NUM >= 0x070903
193 if (ssl_key != NULL)
194 curl_easy_setopt(result, CURLOPT_SSLKEY, ssl_key);
195 #endif
@@ -303,7 +303,7 @@ void http_init(struct remote *remote)
303 curl_ssl_verify = 0;
304
305 set_from_env(&ssl_cert, "GIT_SSL_CERT");
306 -#if LIBCURL_VERSION_NUM >= 0x070902
306 +#if LIBCURL_VERSION_NUM >= 0x070903
307 set_from_env(&ssl_key, "GIT_SSL_KEY");
308 #endif
309 #if LIBCURL_VERSION_NUM >= 0x070908