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

commit 6de7845d6ec8009e7ff7e5501f2e28d6fc49e2df
Author: Michel Hermier <[email protected]>
Date:   Thu Nov 28 13:57:50 2013 +0100

libpacman: Fix computation of eta and rate.

diff --git a/lib/libpacman/server.c b/lib/libpacman/server.c
index 9db0fe7..f7bd97f 100644
--- a/lib/libpacman/server.c
+++ b/lib/libpacman/server.c
@@ -155,8 +155,8 @@ int _pacman_curl_progresscb(void *clientp, double dltotal, 
double dlnow, double
download->dst_size = download->dst_resume + dltotal;
if((time_delta = f_difftimeval(curldownloader->previous_update, now)) > 1) {
curldownloader->download.dst_avg = dltotal / 
f_difftimeval(curldownloader->download.dst_begin, now);
-                       curldownloader->download.dst_rate = 
(curldownloader->previous_update_dltotal - dltotal) / time_delta;
-                       curldownloader->download.dst_eta = (download->dst_tell 
- download->dst_size) / curldownloader->download.dst_rate;
+                       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;
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