cURL / Mailing Lists / curl-library / Single Mail


Re: Async cancel lengthy DNS lookup

From: Daniel Stenberg <>
Date: Thu, 31 Dec 2009 21:51:01 +0100 (CET)

On Wed, 30 Dec 2009, Adrian Michel wrote:

> Is there any simple way to implement the async cancel in this case - by
> using another callback for example?

No and yes. libcurl offers a wide variety of callbacks and most or all of them
can cancel the operation. None of them are "instant" however so if you want a
GUI or similar to get a feeling of instant reward I generally advice that you
let the current thread take its time to stop (be it one second or three, it
doesn't matter) and you start a new one for the next operation and thus the
user won't know nor "feel" the non-instantness of libcurl's cancel.

> I saw that c-ares can be used for async dns lookup, but I'd rather not add
> yet another dependency to all the projects I already maintain. Besides, I
> couldn't find any info in the libcurl documentation on how to actually add
> c-ares support.

Define USE_ARES when you build libcurl.

> BTW, I sent a link to be inserted in your directory of libcurl powered apps
> a while ago, but it was never listed. Are there any special requirements for
> that?

Hm, I must've missed that! Please mail me again with the details...

List admin:
Received on 2009-12-31