Last active
December 28, 2015 16:29
-
-
Save tanacasino/7528954 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 3447945..8374c33 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; | |
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)) | |
+ git_config_string(&curl_http_noproxy, var, value); | |
+ | |
if (!strcmp("http.cookiefile", var)) | |
return git_config_string(&curl_cookie_file, var, value); | |
@@ -325,6 +329,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; | |
@@ -453,6 +458,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