cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_CONNECT_ONLY and CURLOPT_FORBID_REUSE

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 29 May 2009 10:43:23 +0200 (CEST)

On Thu, 28 May 2009, junk_at_igrspace.com wrote:

> when i set CURLOPT_CONNECT_ONLY and CURLOPT_FORBID_REUSE the connection is
> closed right after getting connected.

Exactly. CURLOPT_FORBID_REUSE also implies that libcurl will close that
connection asap after its done.

> Is there a way to use CURLOPT_CONNECT_ONLY and then manually close the
> connection after i'm done with curl_easy_send() and curl_easy_recv() ?

Yes, by not using CURLOPT_FORBID_REUSE. But you must not close it yourself,
you should let curl_easy_cleanup() close it.

-- 
  / daniel.haxx.se
Received on 2009-05-29