cURL / Mailing Lists / curl-library / Single Mail

curl-library

Pipelining and connection management

From: m brandenberg <mcbinc_at_panix.com>
Date: Tue, 17 Jun 2014 18:13:02 -0400 (EDT)

I'm looking at http pipelining and trying to resolve multi_setopt()
documentation with what I'm seeing in the code. In create_conn()
in url.c (7.37.0 release) I see:

   ...
   if(reuse && !force_reuse && IsPipeliningPossible(data, conn_temp)) {
     size_t pipelen = conn_temp->send_pipe->size +
conn_temp->recv_pipe->size;
     if(pipelen > 0) {
       infof(data, "Found connection %ld, with requests in the pipe (%zu)\n",
             conn_temp->connection_id, pipelen);

       if(conn_temp->bundle->num_connections < max_host_connections &&
          data->state.conn_cache->num_connections < max_total_connections) {
         /* We want a new connection anyway */
         reuse = FALSE;
   ...

Which I interpret as:

If *both* CURLOPTM_MAX_TOTAL_CONNECTIONS and CURLOPTM_MAX_HOST_CONNECTIONS
are set to positive values and neither limit has been reached, then
libcurl will only open a new connection (i.e. breadth-first). Otherwise,
it prefers pipelining over a new connection (i.e. depth-first) and
in creating new connections, a limit value of 0 is always unlimited,
never interpreted as '1'.

Is that the intended behavior?

m

--
Monty Brandenberg, Software Engineer                               MCB, Inc.
mcbinc_at_panix.com                                             P.O. Box 425292
mcbinc_at_pobox.com                                   Cambridge, MA  02142-0006
617.864.6907
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-06-18