cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: persistant behaviour

From: Bjorn Reese <breese_at_mail1.stofanet.dk>
Date: Tue, 13 Feb 2001 17:43:57 +0000

Daniel Stenberg wrote:

> curl_easy_perform() would
> - not disconnect from the server when one file has been transfered, it
> leaves the connection "open" for further use
> - re-use an earlier opened connection if one exist to the server we are
> about to transfer a document to/from, the re-usage would deal with the
> fact that the connection might have timed out or similar
> - open more connections and keeep the old one(s) open if the new document
> needs a new connection
> - have a maximum amount of simultaneously opened connections and close the
> oldest when that amount is reached

This sounds like a good solution, because it lets the application determine
when to fetch files, and the order in which they must be fetched. This also
makes error handling easier for both the library and the application (you
don't have to invent a way to specify that file download #3 and #45 failed).

I suggest using two options to control this.

  1. An option to determine how many connections can be opened simultaneously.
     If zero, connections will be closed after each transfer (as today).
  2. An option to determine the strategy used to close persistant connections.
     Strategies can be to close
       o the oldest (from its creation date)
       o the least recently used
       o the one with least traffic
       o round-robin, random, etc.

All persistant connections are closed when the session ends (curl_cleanup).
I am not convinced that a new function to close all or individiual connections
is necessary, nor do I think timeout is a good idea.

_______________________________________________
Curl-library mailing list
Curl-library_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-library
Received on 2001-02-13