cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How do I abort curl_easy_perform()?

From: Ralph Mitchell <rmitchell_at_eds.com>
Date: Tue, 11 Jun 2002 08:29:27 -0500

Daniel Stenberg wrote:

> On Mon, 10 Jun 2002, Tom Mattison wrote:
>
> [I'm cc'ing this to the libcurl mailing list as this definitely is a library
> issue. Please take follow-ups there.]
>
> > I'm using the curl library(V 7.9.6) on OS X in a cocoa application. I
> > need a way to abort the processing of curl_easy_perform(). It appears that
> > once I call curl_easy_perform() I have no way to stop the action before
> > curl_easy_perform() completes its activities and returns. Does anybody
> > have any ideas that might help me out?
>
> You need to make one of the callbacks return an appropriate return code to
> make curl stop. There is no other way.
>

Or possibly have the program fork() and run the curl_easy_perform() in the child fork while
the parent process watches for whatever condition you feel warrants bailing out early...
Catching the bailout condition and sending a kill signal to the child process may not be the
neatest solution, but it seems to fulfill your requirements.

I'm assuming that cocoa & OS X allow fork and signals - I have no clue either way... :)

Ralph Mitchell

_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
Received on 2002-06-11