curl-library
RE: canceling curl_easy_perform() operation
Date: Mon, 4 Jun 2007 17:16:05 +0530
> Hi All
>
> I am using curl lib for implementing HTTP client. To cancel the
> requested URL, I am using ProgrssCallBack function which returns non
> zero value if user presses cancel button.
>
> But suppose client is trying to contact wrong IP address and user send
> cancel request, in this scenario my code is not working as
> ProgressCallBack function is not called unless and until TCP
> connection between client and server is established.
>
> Is there any way by which I can stop the http [SYN] packets going to
> wrong IP if user request for cancel?
>
> Any help on this will be really great. Thanks in advance.
You should be able to use the CURLOPT_SOCKOPTFUNCTION callback instead.
-Currently I am using libcurl version 7.15.1 which doesn't support
CURLOPT_SOCKOPTFUNCTION option.
Or, use the multi interface and asynchronous DNS and kill the easy handle
whenever you feel like it.
-To cancel curl_multi_perform() operation I used curl_multi_remove_handle()
and passed pointer to easy_handle. But if I do like this my application is
hanging as I am sharing easy_handle in two different thread. So could not
use multi interface
>>> Dan
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
Received on 2007-06-04