cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Cancel request in process

From: Oleksiy <patriot_of_ua_at_ukr.net>
Date: Tue, 13 Sep 2011 11:02:08 +0300
('binary' encoding is not supported, stored as-is) ('binary' encoding is not supported, stored as-is)    int ProgressShow(int (*fun)(double data), double dltotal, double
   dlnow, double ultotal, double ulnow)
   {
   printf("%f / %f (%g %%)\n", ulnow, ultotal, ulnow*100.0/ultotal);
    if(ulnow*100>50)
   return 1;
    return 0;
   }

>

>

   int main()

>

   {

>

   //to use this callback

>

   curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);//must be to use
   progress cakkback
   curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION,
   ProgressShow);//callback function for displaying uploading progress
   curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, fun);//data sent to the
   progress callback as a first parameter

>

   }

>

   When ProgressShow just returns 0 everything works fine. With this
   program crashed, but I receive the right output to the Eclipse console
   after crash. I'm sending a file with post request.

>
   --- Оригінальне повідомлення ---
   Від кого: " Jeff Pohlmeyer" <yetanothergeek_at_gmail.com>
   Кому: " libcurl development" <curl-library_at_cool.haxx.se>
   Дата: 12 вересня 2011, 21:22:40
   Тема: Re: Cancel request in process

>

   2011/9/12 Oleksiy < patriot_of_ua_at_ukr.net >:
>
> > When I return from curl_progress_callback non-zero value, it stop
> > sending request, but also program is crashed. Is it mention to be?
> > How can I cancel the request without crashing?
>
> I think this does not happen in libcurl, but you made a mistake in
> some other part of your program. Please show us a small example.
>
> - Jeff
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>
>

('binary' encoding is not supported, stored as-is) -------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-09-13