cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Is it normal to the progress callback be called once again after returning non-zero value?

From: Ray Satiro <raysatiro_at_yahoo.com>
Date: Sat, 14 Jun 2014 02:01:10 -0400

On 6/13/2014 5:45 PM, Daniel Stenberg wrote:
> On Wed, 11 Jun 2014, Ray Satiro wrote:
>
>>> - if(Curl_pgrsDone(conn) && !result)
>>> + if((status != CURLE_ABORTED_BY_CALLBACK) && Curl_pgrsDone(conn)
>>> && !result)
>>> result = CURLE_ABORTED_BY_CALLBACK;
>
> Oops. I wanted that to instead be:
>
> - if(Curl_pgrsDone(conn) && !result)
> + if(!result && Curl_pgrsDone(conn))
>
> As when we've already detected and error, whichever it may be, I don't
> think we should call the progress callback again. Basically that could
> lead to the similar problem: return an error from another callback and
> yet you get the progress callback called again.

Ok that works on the samples. Generally speaking though if a status !=
CURLE_OK is passed to a done handler is it possible for that done
handler to return a result of CURLE_OK? I'm trying to figure out if
there will still be a scenario where Curl_pgrsDone() could be called
with a bad status and whether or not it's permissible in that case.

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