Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=a87589227fffd3d9fc1602816a8cd978ed54222a

commit a87589227fffd3d9fc1602816a8cd978ed54222a
Author: Michel Hermier <[email protected]>
Date:   Thu Nov 28 17:46:56 2013 +0100

libpacman: Allways compute avg download speed.

diff --git a/lib/libpacman/server.c b/lib/libpacman/server.c
index 6a613f6..a2e504e 100644
--- a/lib/libpacman/server.c
+++ b/lib/libpacman/server.c
@@ -153,10 +153,10 @@ int _pacman_curl_progresscb(void *clientp, double 
dltotal, double dlnow, double
gettimeofday(&now, NULL);
download->dst_tell = download->dst_resume + dlnow;
download->dst_size = download->dst_resume + dltotal;
+               download->dst_avg = dltotal / f_difftimeval(now, 
download->dst_begin);
if((time_delta = f_difftimeval(now, curldownloader->previous_update)) > 1) {
-                       curldownloader->download.dst_avg = dltotal / 
f_difftimeval(now, curldownloader->download.dst_begin);
-                       curldownloader->download.dst_rate = (dltotal - 
curldownloader->previous_update_dltotal) / time_delta;
-                       curldownloader->download.dst_eta = (download->dst_size 
- download->dst_tell) / curldownloader->download.dst_rate;
+                       download->dst_rate = (dltotal - 
curldownloader->previous_update_dltotal) / time_delta;
+                       download->dst_eta = (download->dst_size - 
download->dst_tell) / download->dst_rate;
curldownloader->previous_update = now;
curldownloader->previous_update_dltotal = dltotal;
}
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to