From: Jeff King <peff@peff.net>
To: Daniel Stenberg <daniel@haxx.se>
Cc: Nelson Benitez Leon <nelsonjesus.benitez@seap.minhap.es>,
git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 1/6] http: try http_proxy env var when http.proxy config option is not set
Date: Fri, 4 May 2012 03:39:13 -0400 [thread overview]
Message-ID: <20120504073913.GA22388@sigill.intra.peff.net> (raw)
In-Reply-To: <alpine.DEB.2.00.1205040921090.12158@tvnag.unkk.fr>
On Fri, May 04, 2012 at 09:27:16AM +0200, Daniel Stenberg wrote:
> On Fri, 4 May 2012, Jeff King wrote:
>
> >I don't see any way around it besides implementing curl's full
> >tokenizing and matching algorithm, which is about a page of code.
> >I'd really prefer not to re-implement bits of curl (especially
> >because they may change later), but AFAIK there is no way to ask
> >curl "is there a proxy configured, and if so, what is it?".
>
> Sorry for being thick, but I lost track on this thread. Why does it
> need this info again?
We need to know information about the proxy in order to look up the
username and password in our credential database. Before the request is
made in some cases, and in others, after we see a 407. If we fed the
proxy to curl via CURLOPT_PROXY, it's easy. But if the proxy came from
the environment, we have to replicate curl's lookup rules.
> Or perhaps put another way: if there was an ideal way to get this
> done or provide this to libcurl other than the current way, how would
> you suggest it would be done from a git internal point of view?
The absolute simplest way for us would be to stop using
CURLOPT_PROXYUSERNAME/PASSWORD to set it ahead of time, and instead
provide a callback that curl would call on a 407. That callback would
just need the URL of the proxy, and would return the username/password
(or even just set them on the curl object via
CURLOPT_PROXYUSERNAME/PASSWORD).
For that matter, it would simplify our code to do the same for regular
http auth, too. And though we usually know our URL in that case, we
might not if we got a 302 with FOLLOWLOCATION set.
-Peff
next prev parent reply other threads:[~2012-05-04 7:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-03 16:39 [PATCH 1/6] http: try http_proxy env var when http.proxy config option is not set Nelson Benitez Leon
2012-05-03 18:05 ` Junio C Hamano
2012-05-04 7:08 ` Jeff King
2012-05-04 7:27 ` Daniel Stenberg
2012-05-04 7:39 ` Jeff King [this message]
2012-05-04 15:12 ` Daniel Stenberg
2012-05-04 15:36 ` Junio C Hamano
2012-05-04 16:05 ` Jeff King
2012-05-04 17:18 ` 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=20120504073913.GA22388@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=daniel@haxx.se \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=nelsonjesus.benitez@seap.minhap.es \
/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).