Created
August 23, 2013 05:21
-
-
Save tanacasino/6315788 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/http.c b/http.c | |
index 92aba59..8f49e63 100644 | |
--- a/http.c | |
+++ b/http.c | |
@@ -44,6 +44,7 @@ static long curl_low_speed_limit = -1; | |
static long curl_low_speed_time = -1; | |
static int curl_ftp_no_epsv; | |
static const char *curl_http_proxy; | |
+static const char *curl_http_noproxy; | |
static const char *curl_cookie_file; | |
static struct credential http_auth = CREDENTIAL_INIT; | |
static int http_proactive_auth; | |
@@ -198,6 +199,9 @@ static int http_options(const char *var, const char *value, void *cb) | |
if (!strcmp("http.proxy", var)) | |
return git_config_string(&curl_http_proxy, var, value); | |
+ if (!strcmp("http.noproxy", var)) | |
+ return git_config_string(&curl_http_noproxy, var, value); | |
+ | |
if (!strcmp("http.cookiefile", var)) | |
return git_config_string(&curl_cookie_file, var, value); | |
@@ -319,6 +323,7 @@ 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); | |
+ curl_easy_setopt(result, CURLOPT_NOPROXY, curl_http_noproxy); | |
} | |
return result; | |
@@ -447,6 +452,11 @@ void http_cleanup(void) | |
curl_http_proxy = NULL; | |
} | |
+ if (curl_http_noproxy) { | |
+ free((void *)curl_http_noproxy); | |
+ curl_http_noproxy = NULL; | |
+ } | |
+ | |
if (cert_auth.password != NULL) { | |
memset(cert_auth.password, 0, strlen(cert_auth.password)); | |
free(cert_auth.password); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ubuntu 12.04