cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Flag to know if the curl object used apreviouslyopenedconnection

From: Guillaume Arluison <ga_at_lacde.net>
Date: Tue, 19 Oct 2004 14:03:07 +0100

Argg sad that I didnt know about the release yesterday I would have send
this before.

Didnt have other opinions since last time so I added CURL_INFO_NUM_CONNECTS
Actually it's even simpler than before and the code is clearer. (only
several lines)
Note that CURL_INFO_NUM_CONNECTS represent the number of SUCCESSFUL
connections that had to be done to retrieve the object.
(I suppose it is logical but plz give opinions if you dont agree.)

Find attached the few lines modified.
As I'm new here plz check that the line :
data->info.numconnects++;
is placed at the right place. (in Curl_connecthost in connect.c just before
returning CURL_OK)

I tested the code with :
1st direct download on host A : return 1 OK
2 direct download in a row on same host : return 1 then 0 OK
curl host A that does a 302 to host B : return 2 OK
curl host A that does a 302 to host B that does a 302 to host A : return 2
OK
same but after a previous hit on host A : return 1 OK
____________________
<Gu>[W]ill[i]a<u>m<e>
http://www.lacde.net
----- Original Message -----
From: "Guillaume Arluison" <ga_at_lacde.net>
To: "libcurl development" <curl-library_at_cool.haxx.se>
Sent: Friday, October 15, 2004 5:39 PM
Subject: Re: Flag to know if the curl object used
apreviouslyopenedconnection

> > I came to think of an even better: CURLINFO_NUM_CONNECTS
> >
> > Return the number of new connections made in the last request. So, if
> there
> > was a single connection that was re-used, the counter would be 0 and for
> every
> > new connection made it would be increased. That would typically be 1,
but
> can
> > be a larger number if there's a number of redirects.
> Oups, actually I started on that and then forgot it when I went further
for
> the complex table corresponding to true/false for each connection in the
> right order.
>
> I suppose we dont really care about this "order", the information about
how
> many connects had to be created is sufficient enough for everyone ?
>
> So Ill do that :
> forget CURLINFO_REUSED_CONNECTION
> add CURLINFO_NUM_CONNECTS
>
> Ill wait until monday if anybody else have any preference (joerg ?).
> ____________________
> <Gu>[W]ill[i]a<u>m<e>
> http://www.lacde.net
> ----- Original Message -----
> From: "Daniel Stenberg" <daniel-curl_at_haxx.se>
> To: "libcurl development" <curl-library_at_cool.haxx.se>
> Sent: Thursday, October 14, 2004 7:39 PM
> Subject: Re: Flag to know if the curl object used
> apreviouslyopenedconnection
>
>
> > On Wed, 13 Oct 2004, Guillaume Arluison wrote:
> >
> > > If we still want to debate on a third (or more) state I can also
propose
> > > something more clever mixed with CURLINFO_REDIRECT_COUNT.
> > > option B) use the bits of the long :
> > > each bit for each redirect saying
> > > 0 -> had to create a connection
> > > 1 -> reused a previously opened connection
> >
> > I came to think of an even better: CURLINFO_NUM_CONNECTS
> >
> > Return the number of new connections made in the last request. So, if
> there
> > was a single connection that was re-used, the counter would be 0 and for
> every
> > new connection made it would be increased. That would typically be 1,
but
> can
> > be a larger number if there's a number of redirects.
> >
> > > Let me know for which option A, C or even B you re up.
> >
> > I personally have no use for any of these options, I'm hoping for you or
> > anyone else to say "I prefer THIS".
> >
> > > And if needed your wish about enums/simple defines for the long/char
> >
> > I'm fine with either way. curl_easy_getinfo() will "return" a long
anyway.
> >
> > --
> > Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
> > Dedicated custom curl help for hire: http://haxx.se/curl.html
> >
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.764 / Virus Database: 511 - Release Date: 16/09/2004
>
>

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.764 / Virus Database: 511 - Release Date: 16/09/2004

Received on 2004-10-19