From b9ca6c674fd60183f21467b1e83337837456d55d Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 24 Feb 2015 13:07:10 -0600 Subject: [PATCH 1/3] Only use CURLOPT_LOGIN_OPTIONS if it is actually available This fixes the compilation on an older Linux that was used to debug test failures when upgrading Git for Windows to Git v2.3.0. Signed-off-by: Johannes Schindelin --- imap-send.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/imap-send.c b/imap-send.c index d69887da5a..ddb01e114e 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1414,11 +1414,15 @@ static CURL *setup_curl(struct imap_server_conf *srvc) curl_easy_setopt(curl, CURLOPT_PORT, server.port); if (server.auth_method) { +#if LIBCURL_VERSION_NUM < 0x072200 + warning("No LOGIN_OPTIONS support in this cURL version"); +#else struct strbuf auth = STRBUF_INIT; strbuf_addstr(&auth, "AUTH="); strbuf_addstr(&auth, server.auth_method); curl_easy_setopt(curl, CURLOPT_LOGIN_OPTIONS, auth.buf); strbuf_release(&auth); +#endif } if (!server.use_ssl) From e1e50b04a1977bb1a043c4045672ce081ea4ae4e Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Sat, 28 Feb 2015 23:59:04 +0100 Subject: [PATCH 2/3] remote-http(s): Support SOCKS proxies With this patch we properly support SOCKS proxies, configured e.g. like this: git config http.proxy socks5://192.168.67.1:32767 Without this patch, Git mistakenly tries to use SOCKS proxies as if they were HTTP proxies, resulting in a error message like: fatal: unable to access 'http://.../': Proxy CONNECT aborted This patch was required to work behind a faulty AP and scraped from http://stackoverflow.com/questions/15227130/#15228479 and guarded with an appropriate cURL version check by Johannes Schindelin. Signed-off-by: Johannes Schindelin --- http.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/http.c b/http.c index 0153fb0b62..79df596391 100644 --- a/http.c +++ b/http.c @@ -407,6 +407,17 @@ static CURL *get_curl_handle(void) curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy); #if LIBCURL_VERSION_NUM >= 0x070a07 curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY); +#endif +#if LIBCURL_VERSION_NUM >= 0x071800 + if (starts_with(curl_http_proxy, "socks5")) + curl_easy_setopt(result, + CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); + else if (starts_with(curl_http_proxy, "socks4a")) + curl_easy_setopt(result, + CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A); + else if (starts_with(curl_http_proxy, "socks")) + curl_easy_setopt(result, + CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4); #endif } From 659668e1cf199fa7cb382a25677e7f1e13c31f28 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 24 Feb 2015 19:20:13 +0000 Subject: [PATCH 3/3] Facilitate debugging Git executables in tests with gdb When prefixing a Git call in the test suite with 'TEST_GDB_GIT=1 ', it will now be run with GDB, allowing the developer to debug test failures more conveniently. Signed-off-by: Johannes Schindelin --- wrap-for-bin.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wrap-for-bin.sh b/wrap-for-bin.sh index 701d2339b9..a151c95d4c 100644 --- a/wrap-for-bin.sh +++ b/wrap-for-bin.sh @@ -19,4 +19,11 @@ GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale' PATH='@@BUILD_DIR@@/bin-wrappers:'"$PATH" export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR +if test -n "$TEST_GDB_GIT" +then + exec gdb -args "${GIT_EXEC_PATH}/@@PROG@@" "$@" + echo "Could not run gdb -args ${GIT_EXEC_PATH}/@@PROG@@ $*" >&2 + exit 1 +fi + exec "${GIT_EXEC_PATH}/@@PROG@@" "$@"