cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP Pipelining combined with CURLOPT_LOCALPORT

From: Stefan Krause <stefan.krause_at_gmx.net>
Date: Thu, 16 Dec 2010 07:41:35 +0100

On 12/15/2010 11:28 PM, Daniel Stenberg wrote:
>
>>>> Are muliple pipelines within ONE multi handle possible ?
>>>
>>> No.
>
>> My first thought: Maybe that would be a solution to the behaviour
>> with the local ports above? All handles with the same local ports are
>> pipelined over the same conection / pipe. In case no connection for a
>> local port exists, another pipe is with the local port is created
>> inside the multi handle and used for all handles with a local port
>> fitting to that new connection. ?
>
> My answer was a bit short (to say it nice). There's no way to
> explicitly control the number of pipelines. libcurl simply dictates
> what goes into a pipeline and what doesn't.
>
> When you ask for pipelining within a multi handle, libcurl will
> attempt to pipeline every request you add and it will attempt to do
> that on the connections that it already has. It can then create
> pipelines on every connection that it has, which then can be a large
> amount.
>
> If we just make sure ConnectionExists() takes the local port into
> account, it should be possible to basically handicraft which requests
> go to which pipelines by binding specific easy handles to specific
> local ports.
>
> Or did I oversee anything?
>
When I understand you correctly, then the only thing to do to support
multiple pipelines is to take care, that the local port for easy handles
is taken into account. Libcurl then pipes requests for existing
connections or opens new connections in case a connection with the local
port does not exist yet. Then multiple pipelines may exist within one
multi handle.
I'm not familiar with the libcurl source code in detail, but from
logical point of view that should work.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-12-16