cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Flag to know if the curl object used a previously openedconnection

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 13 Oct 2004 12:09:14 +0200 (CEST)

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
Received on 2004-10-13