git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/3] http: try http_proxy env var when http.proxy config option is not set
@ 2012-03-01 18:21 Nelson Benitez Leon
  2012-03-01 17:45 ` Sam Vilain
  2012-03-01 19:10 ` Junio C Hamano
  0 siblings, 2 replies; 6+ messages in thread
From: Nelson Benitez Leon @ 2012-03-01 18:21 UTC (permalink / raw)
  To: git; +Cc: peff, sam

CuRL already reads it, but if $http_proxy has username but no password
curl will not ask you for the password.. so we read it ourselves to
detect that and ask for the password.

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

diff --git a/http.c b/http.c
index 8ac8eb6..8932da5 100644
--- a/http.c
+++ b/http.c
@@ -295,6 +295,13 @@ 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) {
+			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] 6+ messages in thread

end of thread, other threads:[~2012-03-01 21:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-01 18:21 [PATCH v2 2/3] http: try http_proxy env var when http.proxy config option is not set Nelson Benitez Leon
2012-03-01 17:45 ` Sam Vilain
2012-03-01 18:33   ` Junio C Hamano
2012-03-01 19:10 ` Junio C Hamano
2012-03-01 21:01   ` Jeff King
2012-03-01 21:38     ` Junio C Hamano

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).