From d1fdd7ff8b52254c351a92bf5581acff18afbdfb 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 6c30413aba139aeec78f2daaa5c4ca5e75b88491 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. Signed-off-by: Johannes Schindelin --- http.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/http.c b/http.c index 040f362a6a..5895aaf321 100644 --- a/http.c +++ b/http.c @@ -370,6 +370,17 @@ static CURL *get_curl_handle(void) if (curl_http_proxy) { curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy); curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY); +#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 } set_curl_keepalive(result); From c47b590ac3e87292b7433a2be58f806b46f16414 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@@" "$@"