curl-library
Re: Link between curl_easy handle and connection
Date: Mon, 7 Mar 2016 00:15:46 +0100 (CET)
On Sun, 6 Mar 2016, Pierre Brico wrote:
> each virtual users has its own CURL handle. When the user wants to
> communicate with the server, it uses the CURL handle. But it seems that
> when starting a transfer, libcurl gets a connection from a pool, execute
> the transfer and put it back to the pool (this suppose HTTP 1.1 protocol).
That is correct. The multi handle owns the pool of connections and once an
individual easy handle's transfer is completed, the connection is put back
into the "community pool" free for any (other) easy handle to grab to use for
the next transfer.
> BUT as the user authenticates with one connection, it can't use another
> connection to send request to the server.
That's not how HTTP is designed to work so then it'll break like this. HTTP
authenticates requests, not connections. Unless you're Microsoft, but we have
code in place to work around those particular quirks (NTLM).
> So my question is: is it possible to link one connection to one CURL handle
> (no pool usage)?
In theory it should be fairly easy to have each easy handle use its own
connection pool, as that is already what libcurl does when using the easy
interface - there's just no way to tell libcurl to act like that. We've not
seen users request this before so it hasn't been made possible.
-- / daniel.haxx.se ------------------------------------------------------------------- List admin: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2016-03-07