cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP pipelining question

From: Dmitry Kurochkin <dmitry.kurochkin_at_gmail.com>
Date: Tue, 25 Dec 2007 15:59:31 +0300

Hi Richard.

2007/12/25, Richard Atterer <richard_at_2007.atterer.net>:
> Hi,
>
> I think pipelining can be a bit tricky down at the "ugly details" level...
> :) For example, attempting to do POSTs over a pipelined connection is bad,
> not only because you don't know when the POST executes at the far side, but
> also because the "synchronous" 100 Continue just doesn't fit in with
> pipelining.
Quote from http://en.wikipedia.org/wiki/HTTP_pipelining:

Only idempotent requests should be pipelined, such as GET and HEAD requests.

So no POSTs, PUTs and DELETEs here.

>
> On Tue, Dec 25, 2007 at 12:09:09PM +0300, Dmitry Kurochkin wrote:
> > Also, at the moment all requests are sent immediately after connection is
> > established. Instead we should wait for the first response, check that
> > server accepts persistent connection and start pipelining only after
> > that.
>
> As I understand it, RFC 2616 allows you to send a pipelined request even if
> you don't know whether the server supports it. IMHO it would be good to do
> this, it will make e.g. spider-like programs (which contact lots of
> servers) much faster.
Hmmm. I confess I did not read spec on this topic. I need to read more
about this.
But if I am not mistaking libwww does not start pipelining untill
first response comes from server.

> However, doing this requires you to resend all
> pipelined requests in case it turns out the server doesn't support
> pipelining.
>
> This may seem a bit of extra work, but I think you will have to implement
> the retry code anyway as the server may close the connection at any time
> after a response.
The pipelining code base is already there. From what I have seen retry
code is already implemented.

It seems to me that most of the work on pipelining is already done. It
just needs a little polish :)

>
> Does anyone have a pointer to a document which describes all the tricky
> details of pipelining?
The best I can think of is RFC :)

Regards,
  Dmitry

>
> Cheers,
>
> Richard
>
> --
> __ _
> |_) /| Richard Atterer | GnuPG key: 888354F7
> | \/¯| http://atterer.net | 08A9 7B7D 3D13 3EF2 3D25 D157 79E6 F6DC 8883 54F7
> ¯ '` ¯
>
Received on 2007-12-25