From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Nelson Benitez Leon <nelsonjesus.benitez@seap.minhap.es>,
git@vger.kernel.org, sam@vilain.net
Subject: Re: [PATCH v4 5/5] http: rename HTTP_REAUTH to HTTP_RETRY
Date: Tue, 13 Mar 2012 18:04:11 -0400 [thread overview]
Message-ID: <20120313220411.GA28357@sigill.intra.peff.net> (raw)
In-Reply-To: <7vy5r4wfru.fsf@alter.siamese.dyndns.org>
On Tue, Mar 13, 2012 at 10:51:33AM -0700, Junio C Hamano wrote:
> > On 03/12/2012 09:06 PM, Junio C Hamano wrote:
> >> Whatever new token you use, please keep AUTH as a substring of it.
> >>
> >> We may want to retry a request to deal with intermittent failures on
> >> the server side or the network between us and the server; HTTP_RETRY
> >> would be a good name to signal such condition after we see a failure
> >> response from the library.
> >
> > HTTP_REAUTH and HTTP_AUTH_RETRY seems like the same thing, so imo not
> > deserving the rename, maybe Jeff can suggest a better name as he was
> > who suggest the rename.
>
> Either has AUTH as a substring in it, and leaves a door open for us to
> later introduce HTTP_RETRY to tell the machinery that drives cURL library
> to retry the request, so in that sense I am OK with either, but as your
> log message said, we want to make it clear that this is not about doing
> the authentication again (re-auth) but retrying the authentication, so
> HTTP_AUTH_RETRY would be more logical name.
I suggested RETRY because that is all the caller needs to know: the
http_request machinery said "please call me again". Keep in mind that
this is a private interface within http.c, and this return code should
never make it out at all. Nor is it something anybody else would feed
us.
I am half-tempted to suggest refactoring it to return the actual error
code, and let the caller handle 401 and 407. That would be more readable
overall, I think. But it's a little complicated, because getting the
exact answer depends on the curl handle, which is local to http_request,
and I don't want to hold Nelson's actual feature improvement hostage to
such refactoring.
-Peff
next prev parent reply other threads:[~2012-03-13 22:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-12 17:30 [PATCH v4 5/5] http: rename HTTP_REAUTH to HTTP_RETRY Nelson Benitez Leon
2012-03-12 20:06 ` Junio C Hamano
2012-03-13 12:47 ` Nelson Benitez Leon
2012-03-13 17:51 ` Junio C Hamano
2012-03-13 22:04 ` Jeff King [this message]
2012-03-13 23:05 ` Junio C Hamano
2012-03-14 11:11 ` Nelson Benitez Leon
2012-03-14 18:19 ` 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=20120313220411.GA28357@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=nelsonjesus.benitez@seap.minhap.es \
--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).