aboutsummaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-24 13:25:54 -0800
committerJunio C Hamano <gitster@pobox.com>2016-02-24 13:25:54 -0800
commite84d5e9fa178a027b1c8b9f6e22c9173dcda03b3 (patch)
treeb3d16c3076cb8bce048c54e331e86f56e0c0533b /http.c
parent8020803f5057601c1c29ffcdbd309905bd26eef7 (diff)
parentc915f11eb4922e154e29cf62d3b549d65c06a170 (diff)
downloadgit-e84d5e9fa178a027b1c8b9f6e22c9173dcda03b3.tar.gz
git-e84d5e9fa178a027b1c8b9f6e22c9173dcda03b3.tar.xz
Merge branch 'ew/force-ipv4'
"git fetch" and friends that make network connections can now be told to only use ipv4 (or ipv6). * ew/force-ipv4: connect & http: support -4 and -6 switches for remote operations
Diffstat (limited to 'http.c')
-rw-r--r--http.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/http.c b/http.c
index dfc53c1e2..f543b1427 100644
--- a/http.c
+++ b/http.c
@@ -11,6 +11,11 @@
#include "gettext.h"
#include "transport.h"
+#if LIBCURL_VERSION_NUM >= 0x070a08
+long int git_curl_ipresolve = CURL_IPRESOLVE_WHATEVER;
+#else
+long int git_curl_ipresolve;
+#endif
int active_requests;
int http_is_verbose;
size_t http_post_buffer = 16 * LARGE_PACKET_MAX;
@@ -824,6 +829,10 @@ struct active_request_slot *get_active_slot(void)
curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1);
curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 1);
curl_easy_setopt(slot->curl, CURLOPT_RANGE, NULL);
+
+#if LIBCURL_VERSION_NUM >= 0x070a08
+ curl_easy_setopt(slot->curl, CURLOPT_IPRESOLVE, git_curl_ipresolve);
+#endif
#ifdef LIBCURL_CAN_HANDLE_AUTH_ANY
curl_easy_setopt(slot->curl, CURLOPT_HTTPAUTH, http_auth_methods);
#endif