cURL / Mailing Lists / curl-library / Single Mail


RE: RFC: libcURL and persistent connection management

From: Yehezkel Horowitz <>
Date: Tue, 24 Jan 2012 15:57:15 +0200

>> Limiting outstanding requests, implementing request queues in libcURL:

>This is also frequently missed by users and will indeed make it even easier
for libcurl users to write programs without duplicating logic from other
programs to get this very common pattern implemented. I'm all for it!

I think there is a need to design the management of the queue.

I assume the default could be FIFO, but this not always get the best results considering connection re-use and transaction size.

If I set a limit to 4 connections and have the following requests in this order:

3 large requests to site X
3 short requests to site Y
3 short requests to site X
3 large requests to site Y

Maybe the application will have an option to set the priority of the requests (with CURL_OPT argument 1-100), if no priority was given - set a default priority to 50. Curl will seek for highest priority request in queue and in case there are several requests with the same priority - it'll peak request that could be served with an open connection (if there is no such request - it will close an open connection and will open new connection to the new request destination).

Just sharing my thoughts


List admin:
Received on 2012-01-24