cURL / Mailing Lists / curl-library / Single Mail


Re: make only connect, but not issue GET request

From: Pankaj Takawale <>
Date: Tue, 22 Mar 2011 22:44:02 -0400

> Message: 8
> Date: Thu, 17 Mar 2011 23:38:20 +0100 (CET)
> From: Daniel Stenberg <>
> To: libcurl development <>
> Subject: Re: make only connect, but not issue GET request
> Message-ID: <>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
> On Thu, 17 Mar 2011, Pankaj Takawale wrote:
>> I tried with latest libcurl. I turned on CURLOPT_SSL_SESSIONID_CACHE. As per
>> n/w trace, "Client Hello" & "Server Hello" session-id's are same. Still
>> client & server goes ahead with certificate verification & key negotiation.
> ...
>> Am I missing here something?
> I really don't know much about the specifics of SSL session id caching from
> the SSL library's standpoint so I can't tell.
> I assume you re-use the handle and that should suffice, if libcurl and the SSL
> library are doing their jobs right.
>> I believe I can not use CURLOPT_CONNECT_ONLY since it doesn't put connection
>> into cache for further re-use?
> Exactly, hence my suggestion to use HEAD as it will and still won't get any
> response body to download.
> --
>  /

I tried CONNECT_ONLY option after detecting broken connection using
LASTSOCKET and noticed that curl_easy_perform reuses the same
connection for further transfers.
This serves my purpose.
After debugging latest libcurl source code I found that
Curl_do_perform puts new connection (made using CONNECT_ONLY) into
connection-cache for further reuse.[url.c:2105 connect_host].
Curl debug message after making connect only connection: "Connection
#0 to host SERVER left intact"
at next request : "Re-using existing connection! (#0) with host SERVER"

I'm worried of bug #63 mentioned in about CONNECT_ONLY.
Is it safe to use CONNECT_ONLY option in this case (I want to avoid
HEAD option). Or do you see any glitch in it.

Thanks for your involvement!

List admin:
Received on 2011-03-23