From: "Shawn O. Pearce" <spearce@spearce.org>
To: Martin Storsj? <martin@martin.st>
Cc: Tay Ray Chuan <rctay89@gmail.com>,
git@vger.kernel.org, Nicholas Miell <nmiell@gmail.com>,
gsky51@gmail.com, Clemens Buchacher <drizzd@aon.at>,
Mark Lodato <lodatom@gmail.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH/RFC] Allow curl to rewind the RPC read buffer at any time
Date: Tue, 1 Dec 2009 08:14:28 -0800 [thread overview]
Message-ID: <20091201161428.GC21299@spearce.org> (raw)
In-Reply-To: <alpine.DEB.2.00.0912011236360.5582@cone.home.martin.st>
Martin Storsj? <martin@martin.st> wrote:
> When using multi-pass authentication methods, the curl library may
> need to rewind the read buffers used for providing data to HTTP POST,
> if data has been output before a 401 error is received.
>
> This solution buffers all data read by the curl library, in order to allow
> it to rewind the reading buffer at any time later.
NAK.
In the case of git-upload-pack requests, we should fit into 1 MiB
almost all of the time, and thus not need to grow the http.postBuffer
to support a rewind. The state data plus current have list isn't
all that large. A 1 MiB request means we have over 20,900 commits
in common with the remote and still haven't been able to find a
sufficient cut point. Or the remote has 20,000 active, unrelated
branches we are trying to fetch. Either way, this is a really sick
and twisted situation.
In the case of git-receive-pack requests, we might be uploading an
entire project to an empty repository on the remote side. This could
be 8 GiB worth of data if the project was something huge like KDE.
We can't assume that we should malloc 8 GiB of memory to buffer
the payload.
The *correct* way to support an arbitrary rewind is to modify the
outgoing channel from remote-curl to its protocol engine (client.in
within the rpc_service method) to somehow request the protocol engine
(aka git-send-pack or git-fetch-pack) to stop and regenerate the
current request.
Another approach would be to modify http-backend (and the protocol)
to support an "auth ping" request prior to spooling out the entire
payload if its more than an http.postBuffer size. Basically we
do what the "Expect: 100-continue" protocol is supposed to do,
but in the application layer rather than the HTTP/1.1 layer, so
our CGI actually gets invoked.
This unfortunately still relies on the underlying libcurl to not
discard the authentication data after that initial "auth ping".
But to be honest, I think that is a reasonable expectation. The
#@!*@!* library should be able to generate two requests back-to-back
to the same URL without needing to rewind the 2nd request.
--
Shawn.
next prev parent reply other threads:[~2009-12-01 16:14 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-02 17:28 HTTP NTLM Authentication gsky
2009-10-02 19:04 ` [PATCH] Use the best HTTP authentication method supported by the server Nicholas Miell
2009-11-27 15:41 ` [PATCH 0/2] http: allow multi-pass authentication Tay Ray Chuan
2009-04-14 21:56 ` [PATCH v2] Add an option for using any HTTP authentication scheme, not only basic Martin Storsjö
2009-04-14 20:52 ` [PATCH] " Martin Storsjö
2009-04-14 21:08 ` Johannes Schindelin
2009-04-14 21:15 ` Martin Storsjö
2009-04-14 21:42 ` Johannes Schindelin
2009-12-01 10:28 ` [PATCH 0/2] http: allow multi-pass authentication Martin Storsjö
2009-12-01 10:33 ` [PATCH/RFC] Allow curl to rewind the RPC read buffer Martin Storsjö
2009-12-01 16:01 ` Shawn O. Pearce
2009-12-01 16:12 ` Tay Ray Chuan
2009-12-01 16:16 ` Shawn O. Pearce
2009-12-01 16:51 ` Martin Storsjö
2009-12-01 17:49 ` Junio C Hamano
2009-12-02 2:32 ` Tay Ray Chuan
2009-12-02 7:45 ` Martin Storsjö
2009-12-01 10:37 ` [PATCH/RFC] Allow curl to rewind the RPC read buffer at any time Martin Storsjö
2009-12-01 16:14 ` Shawn O. Pearce [this message]
2009-12-01 16:59 ` Martin Storsjö
2009-12-02 3:15 ` Tay Ray Chuan
2009-12-01 18:18 ` Daniel Stenberg
2009-12-02 2:03 ` Tay Ray Chuan
2009-12-02 9:19 ` Daniel Stenberg
2009-12-02 9:32 ` Martin Storsjö
2009-12-02 10:04 ` Daniel Stenberg
2009-11-27 15:42 ` [PATCH 1/2] http: maintain curl sessions Tay Ray Chuan
2009-11-27 15:43 ` [PATCH 2/2] Add an option for using any HTTP authentication scheme, not only basic Tay Ray Chuan
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=20091201161428.GC21299@spearce.org \
--to=spearce@spearce.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=drizzd@aon.at \
--cc=git@vger.kernel.org \
--cc=gsky51@gmail.com \
--cc=lodatom@gmail.com \
--cc=martin@martin.st \
--cc=nmiell@gmail.com \
--cc=rctay89@gmail.com \
/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).