From: Nelson Benitez Leon <nelsonjesus.benitez@seap.minhap.es>
To: git@vger.kernel.org
Cc: peff@peff.net, sam@vilain.net
Subject: [PATCH v2 2/3] http: try http_proxy env var when http.proxy config option is not set
Date: Thu, 01 Mar 2012 19:21:03 +0100 [thread overview]
Message-ID: <4F4FBE0F.6020004@seap.minhap.es> (raw)
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
next reply other threads:[~2012-03-01 17:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-01 18:21 Nelson Benitez Leon [this message]
2012-03-01 17:45 ` [PATCH v2 2/3] http: try http_proxy env var when http.proxy config option is not set 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F4FBE0F.6020004@seap.minhap.es \
--to=nelsonjesus.benitez@seap.minhap.es \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=sam@vilain.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.