cURL / Mailing Lists / curl-library / Single Mail

curl-library

cancel transfer cleanly

From: sundararaj reel <sundararaj.reel_at_googlemail.com>
Date: Thu, 16 Apr 2009 17:45:32 +0200

Hi all,

I would like to know the preferred way of cancelling a transfer ie.
execution curl_easy_perform().

I use write_to_buffer() to handle data :
curl_easy_setopt(CURLOPT_WRITEFUNCTION,
write_to_buffer).
I need to be able to abort transfer at any time with as little delay as
possible. So, I cannot rely on returning 0(!=size*nmemb) from
write_to_buffer() to abort transfer. Since libcurl takes its own time to
call write_to_buffer().

How do I trigger an immediate and clean stop of transfer ?

-- 
Thanks,
Sundararaj
Received on 2009-04-16