From: Junio C Hamano <gitster@pobox.com>
To: Nelson Benitez Leon <nelsonjesus.benitez@seap.minhap.es>
Cc: git@vger.kernel.org, peff@peff.net, sam@vilain.net
Subject: Re: [PATCH v3 2/4] http: try http_proxy env var when http.proxy config option is not set
Date: Mon, 05 Mar 2012 09:30:30 -0800 [thread overview]
Message-ID: <7v4nu32bwp.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4F54D91C.6080905@seap.minhap.es> (Nelson Benitez Leon's message of "Mon, 05 Mar 2012 16:17:48 +0100")
Nelson Benitez Leon <nelsonjesus.benitez@seap.minhap.es> writes:
> cURL already reads it, but if $http_proxy has username but no password
> cURL will not ask you for the password and so failed to authenticate
> returning a 407 error code. So we read it ourselves to detect that and
> ask for the password. Also we read it prior to connection to be able to
> make a proactive authentication in case the flag http_proactive_auth is
> set.
>
> Signed-off-by: Nelson Benitez Leon <nbenitezl@gmail.com>
> ---
The above does not address my earlier worries about compatibility
across curl applications (it does not even say "it does not matter;
we do not care about other's application"), so let's spell it out
again. When the user has
http_proxy=http://me@proxy.example.com
export http_proxy
with your patch, git might do whatever we desire to do, and the end
result may be better, but how would the user experience be for the
user when using other curl based programs on the same system?
Also I thought the conclusion from the other thread was that even if
we were to do this, we should apply the http_proxy environment only
when we are talking to http:// and for https:// we would instead
read HTTPS_PROXY or something?
> 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);
next prev parent reply other threads:[~2012-03-05 17:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-05 15:17 [PATCH v3 2/4] http: try http_proxy env var when http.proxy config option is not set Nelson Benitez Leon
2012-03-05 17:30 ` Junio C Hamano [this message]
2012-03-06 12:22 ` Nelson Benitez Leon
2012-03-06 11:27 ` Jeff King
2012-03-06 14:08 ` Nelson Benitez Leon
2012-03-06 15:58 ` 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=7v4nu32bwp.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=nelsonjesus.benitez@seap.minhap.es \
--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 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).