All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nelson Benitez Leon <nelsonjesus.benitez@seap.minhap.es>
To: Thomas Rast <trast@inf.ethz.ch>
Cc: git@vger.kernel.org, peff@peff.net, sam.vilain@catalyst.net.nz,
	sam@vilain.net
Subject: Re: [PATCH 2/3] http: try standard proxy env vars when http.proxy config option is not set
Date: Tue, 28 Feb 2012 15:57:33 +0100	[thread overview]
Message-ID: <4F4CEB5D.5020808@seap.minhap.es> (raw)
In-Reply-To: <878vjn8823.fsf@thomas.inf.ethz.ch>

On 02/28/2012 01:19 PM, Thomas Rast wrote:
> Nelson Benitez Leon <nelsonjesus.benitez@seap.minhap.es> writes:
> 
>> +	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);
>> +		}
>> +	}
> 
> Admittedly I'm mostly clueless about curl, but while investigating the
> NTLM login thing I noticed this bit in curl(1):
> 
> ENVIRONMENT
>        The environment variables can be specified in lower case or upper
>        case. The lower case version has precedence. http_proxy is an
>        exception as it is only available in lower case.
> 
> Which raises the questions:
> 
> * Why is this needed?  Does git's use of libcurl ignore http_proxy?  [1]
>   seems to indicate that libcurl respects <protocol>_proxy
>   automatically.

It could not be needed, because, as you noted, curl already reads it, but then we will
loose the feature on patch [3/3] because if $http_proxy has username but no password
curl will not ask you for the password.. instead if we read it we could detect that,
and ask for the password. 

As a minor note if we let curl to read it then patch [1/1] has
to be changed to include CURLOPT_PROXYAUTH unconditionally (ie. out of the 
'if (curl_http_proxy)'). I personally like the feature of not writing my password 
on $http_proxy at the cost of reading the env vars ourselves.


> 
> * Why do you (need to?) support HTTP_PROXY when curl doesn't?

I found somewhere documented HTTP_PROXY as well as http_proxy, but I've just checked 
wget[1] and also only supports http_proxy so I think we can discard it as is not widely 
used..

[1] http://www.gnu.org/software/wget/manual/html_node/Proxies.html

> 
> 
> [1] http://curl.haxx.se/libcurl/c/libcurl-tutorial.html, "Environment Variables"
> 

  reply	other threads:[~2012-02-28 13:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=4F4CEB5D.5020808@seap.minhap.es \
    --to=nelsonjesus.benitez@seap.minhap.es \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=sam.vilain@catalyst.net.nz \
    --cc=sam@vilain.net \
    --cc=trast@inf.ethz.ch \
    /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.