curl-library
Re: Progress
Date: Sun, 18 Feb 2001 23:01:10 -0500
On the java side, I set up a task thread to run curl and use a timer
to poll the variables. Works great so far. The GTK example on the curl
website probably works similarly.
Bob
pit_at_paradise.net.nz wrote:
>
> hi Bob.
>
> Thanks for the help.
> This is how i did. (Please let me know if i did it wrong...)
>
> Now the question is how to use the variables...
> Do i use timer??
>
> //------------------------------------
> int mycallback(void *notused, size_t d_tot, size_t d_now,
> size_t u_tot, size_t u_now);
>
> size_t dltotal;
> size_t dlnow;
> size_t ultotal;
> size_t ulnow;
> int progret = 0;
>
> //------------------------------------
> void Upload(...) {
> ...
> curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, mycallback);
> ...
> }
>
> //------------------------------------
> int mycallback(void *notused, size_t d_tot, size_t d_now,
> size_t u_tot, size_t u_now)
> {
> dltotal = d_tot;
> dlnow = d_now;
> ultotal = u_tot;
> ulnow = u_now;
> return progret;
> }
>
> _______________________________________________
> Curl-library mailing list
> Curl-library_at_lists.sourceforge.net
> http://lists.sourceforge.net/lists/listinfo/curl-library
_______________________________________________
Curl-library mailing list
Curl-library_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-library
Received on 2001-02-19