cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Anyone for HTTP Pipelining?

From: Ravi Pratap <Ravi.Pratap_at_hillcrestlabs.com>
Date: Wed, 28 Jun 2006 11:49:52 -0400

Hello,

> I'm currently working on writing down ideas and thoughts around adding
> HTTP
> Pipelining support to libcurl. Below is my first take at some notes.
I'm

This is great news! :-)

> - Explicitly ask for pipelining handle X and handle Y ? It isn't
always
> that
> easy for an app to do this association. The lib should probably
still
> resolve
> the second one properly to make sure that they actually _can_ be
> considered
> for pipelining. Also, asking for explicit pipelining on handle X
may be
> tricky when handle X get a closed connection.

I think it's easier to make it an option on the multi handle. Basically
the user tells the multi handle to pipeline requests made by the easy
handles, when possible. Curl then makes decisions internally about how
and when to pipeline. Curl can also impose an internal (or
configurable?) limit on the maximum number of connections that can be
pipelined to a server.

> - Have an option like "attempt pipelining" and then it _may_ use that
if
> an
> existing connection is already present against our target HTTP
server?
> May
> cause funny effects if the first transfer is a slow big file and
the
> second
> is a very small one... Also probably requires some kind of
notification
> support so that the app can get to know that the handle is put "in
> line" for
> pipelining.

The thing is that it is pretty hard for Curl to decide what to do based
on response length and it is probably best to leave this to the
application. Since pipelining is per multi handle, the application can
always use a different multi handle when it doesn't want a large request
to interfere.

> - We need options to control max pipeline length, and probably how to
> behave
> if we reach that limit.

Agreed.

> - When a pipeline is in use, we must take precautions so that we
either
> don't
> allow the used handles (i.e those who still wait for a response) to
be
> removed, or we allow removal but still deal with the outstanding
> response
> somehow.

I would allow removal and then have libcurl discard the response for
that particular easy handle if that isn't hard to do.

Ravi.
Received on 2006-06-28