summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-14 23:19:03 (EST)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-14 23:19:03 (EST)
commit1f047463e6714515aa100d881cbd49d8114e8c6f (patch)
treeec69765c6856bd4f70a24dfe9f614d54eaa007cd
parent924a46bf92e346c820f42f74a6792653894944e2 (diff)
opkg: don't report the same download percentage multiple times
git-svn-id: http://opkg.googlecode.com/svn/trunk@14 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r--opkg_download.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/opkg_download.c b/opkg_download.c
index 3370b1f..fcc5294 100644
--- a/opkg_download.c
+++ b/opkg_download.c
@@ -46,6 +46,14 @@ curl_progress_func (char* url,
#ifdef OPKG_LIB
if (opkg_cb_download_progress)
{
+ static int prev = -1;
+
+ /* don't report the same percentage multiple times
+ * (this can occur due to rounding) */
+ if (prev == p)
+ return 0;
+ prev = p;
+
opkg_cb_download_progress (p, url);
return 0;
}