summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-02-24 13:25:54 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-02-24 13:25:54 -0800
commite84d5e9fa178a027b1c8b9f6e22c9173dcda03b3 (patch)
treeb3d16c3076cb8bce048c54e331e86f56e0c0533b /remote-curl.c
parentMerge branch 'nd/git-common-dir-fix' (diff)
parentconnect & http: support -4 and -6 switches for remote operations (diff)
downloadtgif-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 'remote-curl.c')
-rw-r--r--remote-curl.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/remote-curl.c b/remote-curl.c
index c7048575fb..b33a1e4235 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -119,6 +119,19 @@ static int set_option(const char *name, const char *value)
else
return -1;
return 0;
+
+#if LIBCURL_VERSION_NUM >= 0x070a08
+ } else if (!strcmp(name, "family")) {
+ if (!strcmp(value, "ipv4"))
+ git_curl_ipresolve = CURL_IPRESOLVE_V4;
+ else if (!strcmp(value, "ipv6"))
+ git_curl_ipresolve = CURL_IPRESOLVE_V6;
+ else if (!strcmp(value, "all"))
+ git_curl_ipresolve = CURL_IPRESOLVE_WHATEVER;
+ else
+ return -1;
+ return 0;
+#endif /* LIBCURL_VERSION_NUM >= 0x070a08 */
} else {
return 1 /* unsupported */;
}