cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Flag to know if the curl object used a previouslyopenedconnection

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 13 Oct 2004 18:58:23 +0200 (CEST)

On Wed, 13 Oct 2004, Guillaume Arluison wrote:

>> Perhaps the info should be "did libcurl need to create a new connection to
>> do the request?". It would be a lot easier to answer yes or no to, even if
>> one or more redirections occurred.

> Well in fact I did only the TRUE or FALSE at beginning which means exactly
> that, I just thought that because we re using a long anyway we may use more
> 'bits of information' like the 'libcurl used an existing connection but
> because a follow finally had to recreate one.' Anyway this isnt really an
> important information (in this case the REUSED_CONNECTION will be FALSE
> instead of the 3rd case) and it was just a try to give more information to
> the user.

> Do you want to go back to TRUE/FALSE ?

Consider this case:

You have a previous connection to host A. You do a second request to fetch a
URL from host A and tells libcurl to follow redirects. This time you get a
redirect to host B and it gets redirected to host C etc all the way to host F.

What would the option say about connection re-use? If it would say "first
re-use then new", one might get the idea that the original connection to host
A is still alive, when it in fact isn't since we only keep 5 connections alive
and we got 5 others in there now.

I'm just asking you (and anyone else) if the three different replies really
are meaningful or if they are more likely to just add confusion to users by
providing useless info.

I'm just asking, since I'm sure I don't see all the quirks and pitfalls. If
you can think of a use for this extra and explain it, I'll approve.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-10-13