cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Guillaume Arluison <ga_at_lacde.net>
Date: Wed, 13 Oct 2004 17:35:39 +0100

> > Instead of a boolean (which btw is not a type used for CURLINFO)
> ... which is because there is no boolean type in plain old C.
Yes I meant you used a boolean definition inside the code itself but not to
be retrieved by getinfo.

> Just remember that redirection can happen in multiple steps, so I'm not
sure
> this information is at all interesting or even possible to provide once a
> Location: has been following one or more times.
>
> 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 ?
In this case what's the better, just define it as a long and use 0/1 or does
the booleans are casted to long in your code ? (I didnt check)

Related to this :
> Actually, you should not make any assumptions of what data size the enum
is. I
> believe the C standards give the compiler quite a lot of freedom there.
You
> should pass a pointer to a long to receive long data.
Yeah I supposed so. So if we still want to pass enums, do you just define
the enums and in the struct PureInfo you defines a long instead and cast it
in the code ? or just use simple 0 and 1...

I'll upload again the correct diff with your inputs.
____________________
<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: Wednesday, October 13, 2004 11:09 AM
Subject: Re: Flag to know if the curl object used a
previouslyopenedconnection

> On Tue, 12 Oct 2004, Guillaume Arluison wrote:
>
> > Instead of a boolean (which btw is not a type used for CURLINFO)
>
> ... which is because there is no boolean type in plain old C.
>
> >
It_was_true_but_you_asked_to_follow_the_location_and_this_location_needed_a_
> > new_connection).
>
> Just remember that redirection can happen in multiple steps, so I'm not
sure
> this information is at all interesting or even possible to provide once a
> Location: has been following one or more times.
>
> 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.
>
> > I'm new to libcurl so I dont know where you want to put the
information, ->
> > I used the struct PureInfo (could be in any other struct in data)
>
> Sounds like a good plan.
>
> > Note : I'm not sure but I expect that enum (int in theory) are long and
not
> > short ?
>
> Actually, you should not make any assumptions of what data size the enum
is. I
> believe the C standards give the compiler quite a lot of freedom there.
You
> should pass a pointer to a long to receive long data.
>
> About the diff: please make the diff with -u and use mime attachment when
you
> post it, to prevent word wrapping by the mail client etc.
>
> --
> 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: 17/09/2004
Received on 2004-10-13