git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] http: try standard proxy env vars when http.proxy config option is not set
@ 2012-02-28 12:54 Nelson Benitez Leon
  2012-02-28 12:19 ` Thomas Rast
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Nelson Benitez Leon @ 2012-02-28 12:54 UTC (permalink / raw)
  To: git; +Cc: peff, sam.vilain, sam

Signed-off-by: Nelson Benitez Leon <nbenitezl@gmail.com>
---
 http.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/http.c b/http.c
index 8ac8eb6..79cbe50 100644
--- a/http.c
+++ b/http.c
@@ -295,6 +295,16 @@ static CURL *get_curl_handle(void)
 	if (curl_ftp_no_epsv)
 		curl_easy_setopt(result, CURLOPT_FTP_USE_EPSV, 0);
 
+	if (!curl_http_proxy) {
+		const char *env_proxy;
+		env_proxy = getenv("HTTP_PROXY");
+		if (!env_proxy) {
+			env_proxy = getenv("http_proxy");
+		}
+		if (env_proxy) {
+			curl_http_proxy = xstrdup(env_proxy);
+		}
+	}
 	if (curl_http_proxy) {
 		curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
 		curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2012-03-15  8:42 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-28 12:54 [PATCH 2/3] http: try standard proxy env vars when http.proxy config option is not set Nelson Benitez Leon
2012-02-28 12:19 ` Thomas Rast
2012-02-28 14:57   ` Nelson Benitez Leon
2012-02-28 14:34     ` Thomas Rast
2012-02-28 19:24   ` Junio C Hamano
2012-02-29 10:38     ` Nelson Benitez Leon
2012-02-29 18:15       ` Junio C Hamano
2012-03-01 10:18         ` Nelson Benitez Leon
2012-03-04 19:19     ` Daniel Stenberg
2012-02-28 19:15 ` Jeff King
2012-02-28 19:27   ` Sam Vilain
2012-02-28 19:34     ` Jeff King
2012-02-29  9:55       ` Matthieu Moy
2012-02-29 10:46       ` Nelson Benitez Leon
2012-02-29 21:08         ` Jeff King
2012-03-01  9:57           ` Nelson Benitez Leon
2012-03-01  9:10             ` Jeff King
2012-03-11 16:56 ` James Cloos
2012-03-11 19:12   ` Junio C Hamano
2012-03-13 10:22     ` Nelson Benitez Leon
2012-03-14  4:36       ` Junio C Hamano
2012-03-14  9:54         ` Nelson Benitez Leon
2012-03-14 20:41           ` Junio C Hamano
2012-03-15  9:38             ` Nelson Benitez Leon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).