cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Async cancel lengthy DNS lookup

From: Daniel Stenberg <daniel_at_haxx.se>
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...

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-12-31