Skip to content
Snippets Groups Projects
Commit 6417fa95 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

corrected the use of the progress function

parent 61f6284a
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,11 @@ size_t my_read_func(void *ptr, size_t size, size_t nmemb, FILE *stream)
return fread(ptr, size, nmemb, stream);
}
int my_progress_func(GtkWidget *Bar, int t, int d)
int my_progress_func(GtkWidget *Bar,
double t, /* dltotal */
double d, /* dlnow */
double ultotal,
double ulnow)
{
/* printf("%d / %d (%g %%)\n", d, t, d*100.0/t);*/
gdk_threads_enter();
......@@ -50,6 +54,7 @@ void *curl_thread(void *ptr)
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_FILE, outfile);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, my_read_func);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, my_progress_func);
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, Bar);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment