cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problems with curl_easy_perform with call back function

From: Venkatesh Prabu Narayanan <venkateshprabu06_at_gmail.com>
Date: Sat, 25 May 2013 11:34:39 +0530

Daniel,

So you want me to send the error code 'CURL_READFUNC_ABORT' from the read
call back function (after my upload gets completed) to abort the process
immediately. I will try this and let you know. Thanks for your response.

Regards,

On Sat, May 25, 2013 at 2:43 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Fri, 24 May 2013, alpforce wrote:
>
> From what I understand (and I very well might be mistaken ;-) ) the write
>> and read function callbacks should function in the manner similar to
>> stdio's fwrite and fread functions... that means returning 0 is not enough
>> , you also need to set the error to end-of-file (even though you are not
>> actually working with files). I need to check my old code, I made something
>> like that once or twice... AGAIN , I MIGHT BE MISTAKEN :) if so , I am
>> sorry ;)
>>
>
> CURLOPT_READFUNCTION
>
> If you stop the current transfer by returning 0 "pre-maturely" (i.e
> before
> the server expected it, like when you've said you will upload N bytes and
> you upload less than N bytes), you may experience that the server "hangs"
> waiting for the rest of the data that won't come.
>
> 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 (Added in 7.12.1)
>
> quoted from:
>
> http://curl.haxx.se/libcurl/c/**curl_easy_setopt.html#**
> CURLOPTREADFUNCTION<http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTREADFUNCTION>
>
> --
>
> / daniel.haxx.se
>
> ------------------------------**------------------------------**-------
> List admin: http://cool.haxx.se/list/**listinfo/curl-library<http://cool.haxx.se/list/listinfo/curl-library>
> Etiquette: http://curl.haxx.se/mail/**etiquette.html<http://curl.haxx.se/mail/etiquette.html>
>

-- 
Thanks and Regards
N.Venkatesh Prabu

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-05-25