curl-users
Re: Questions about reusing connections
Date: Fri, 16 Nov 2001 12:12:42 +0100 (MET)
On Fri, 16 Nov 2001, Georg Horn wrote:
> i just stumbled about some things in libcurl when reusing connections
> (don't close a connection with curl_easy_cleanup() after a successful
> transfer but just set the options for the next request with
> curl_easy_setopt() and call curl_easy_perform() again):
>
> - If the first request requires for example user authentication or a
> cookie, i use curl_easy_setopt(curl, CURLOPT_COOKIE, cookies);
> But if the next request doesn't require cookies, how can i delete the
> cookie? Can i pass in the empty string as in:
> curl_easy_setopt(curl, CURLOPT_COOKIE, "");
> What does libcurl do after this? Does it send an empty "Cookie:"
> header, or no cookie header at all?
Setting COOKIE to NULL would disable it. It should then not send a cookie
line at all. Setting it to "" will probably make it send an empty "Cookie:"
header.
> - Why does libcurl sum up the times for TIMER_NAMELOOKUP, TIMER_CONNECT
> and TIMER_PRETRANSFER?
Because no one ever made it work differently.
> This makes no sense at all for me. If i want to have the sum of all
> namelookup times, i can sum up them in my application, but i think in
> most cases it is more interesting to have the times of each single
> transfer.
I agree with you. Care to make a patch fo this?
> - What time is TIMER_PRETRANSFER exactly? Is it the time from the start
> up to the point when the request has been sent, or up to the point when
> the first byte is about to be read?
It is the point when the (final) request has been sent, when it goes into
"waiting for data to arrive" mode.
-- Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/Received on 2001-11-16