summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-03-11 15:00:57 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-03-11 15:00:57 +0000
commit6417fa95cfb856ca82c15ab1dea41f7388ea4cc7 (patch)
treea2935cb45125c81bd09b08918b5ff3655b125673 /docs
parent61f6284a353d7cd4c0a28dce770faaa8b8bad759 (diff)
downloadcurl-6417fa95cfb856ca82c15ab1dea41f7388ea4cc7.tar.gz
corrected the use of the progress function
Diffstat (limited to 'docs')
-rw-r--r--docs/examples/curlgtk.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/examples/curlgtk.c b/docs/examples/curlgtk.c
index 7c9ce2a1b..bba1fe1c9 100644
--- a/docs/examples/curlgtk.c
+++ b/docs/examples/curlgtk.c
@@ -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);