From 1f047463e6714515aa100d881cbd49d8114e8c6f Mon Sep 17 00:00:00 2001 From: ticktock35 Date: Mon, 15 Dec 2008 04:19:03 +0000 Subject: [PATCH] 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 --- opkg_download.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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; } -- 2.25.1