cURL / Mailing Lists / curl-library / Single Mail

curl-library

答复: cancel upload in curl

From: <jy_lizl_at_cn.fujitsu.com>
Date: Wed, 19 Mar 2014 05:32:20 +0000

To Fabian

Thanks for your reply.
You mean return 0,it means the transfer is completed?
If I want to cancel the upload immediately, I should return CURL_READFUNC_ABORT.
Thanks for above.

And I have a trouble that xmlhttprequest upload by cUrl ,it doestn’t call read callback although I register callback to curl handle.
Do you have any idea?

Thanks again.

发件人: curl-library [mailto:curl-library-bounces_at_cool.haxx.se] 代表 Fabian Frank
发送时间: 2014年3月19日 12:01
收件人: libcurl development
主题: Re: cancel upload in curl



On Tue, Mar 18, 2014 at 7:28 PM, jy_lizl_at_cn.fujitsu.com<mailto:jy_lizl_at_cn.fujitsu.com> <jy_lizl_at_cn.fujitsu.com<mailto:jy_lizl_at_cn.fujitsu.com>> wrote:
I register read callback, but it hasn't be called.
I think when read callback return 0,the transfer will be caceled.is<http://caceled.is> it right?

Please refer to http://curl.haxx.se/libcurl/c/curl_easy_setopt.html, which states that "The read callback may return CURL_READFUNC_ABORT to stop the current operation immediately, resulting in a CURLE_ABORTED_BY_CALLBACK error code from the transfer". You should not return 0 to abort a transfer.


Regards,
Fabian

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-03-19