cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Stoping/Aborting curl_easy_perform

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Fri, 10 Dec 2004 10:31:41 +0100 (CET)

On Thu, 9 Dec 2004, Hardeep Nagi wrote:

> Does anyone know how a curl_easy_perform can be aborted.

Yes we do!

> Scenario in my program: I create two threads. And pass the obj of my class(
> that has easy handle and manages open/send HTTP methods ) in both the
> threads. One thread is actually doing curl_easy_perform in a loop and from
> the other thread i want to abort the transfers. But I get error, What i try
> to do is i curl_easy_cleanup() that handle.

That is not the right way.

The thread that runs curl_easy_perform() must return the proper return code in
one of the callbacks to cause the transfer to abort. Or, you can set options
that makes it stop at a certain timeout time or when the transfer speed is
lower than your set limit.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-12-10