From 1f047463e6714515aa100d881cbd49d8114e8c6f Mon Sep 17 00:00:00 2001 From: ticktock35 Date: Sun, 14 Dec 2008 23:19:03 -0500 Subject: 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 --- 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; } -- cgit v0.9.1