cURL / Mailing Lists / curl-library / Single Mail


Re: persistent connections in multi interface

From: Daniel Stenberg <>
Date: Thu, 11 Aug 2011 16:21:28 +0200 (CEST)

On Thu, 11 Aug 2011, Yamin Zhou wrote:

> I create a multi handle, and set its MAXCONNECTIONS as 20. When a POST
> request comes, I create a easy handle for that request and add it in the
> multi handle. I explicitly add "Connection: keep-alive" HTTP header

There's no need to do that. HTTP/1.1 has them persistent by default.

> When the transfer is finished, I call curl_easy_cleanup to free the easy
> handle. But I see the connection is closed immediately by libcurl. Shouldn't
> it be cached?

Yes, if there's room for the connection in the cache and nothing in the
connection/transfer made it not possible.

List admin:
Received on 2011-08-11