From: Matthias Wachs Date: Tue, 26 Oct 2010 13:10:36 +0000 (+0000) Subject: FIX: value (now.value - av->last_update__.value) is always 0 X-Git-Tag: initial-import-from-subversion-38251~19951 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b9b331a978f134af77c64011d17593ed4c6e8382;p=oweals%2Fgnunet.git FIX: value (now.value - av->last_update__.value) is always 0 --- diff --git a/src/util/bandwidth.c b/src/util/bandwidth.c index f20f9afbf..a08bb1f43 100644 --- a/src/util/bandwidth.c +++ b/src/util/bandwidth.c @@ -178,7 +178,6 @@ update_tracker (struct GNUNET_BANDWIDTH_Tracker *av) delta_time = now.value - av->last_update__.value; delta_avail = (delta_time * ((unsigned long long) av->available_bytes_per_s__) + 500LL) / 1000LL; av->consumption_since_last_update__ -= delta_avail; - av->last_update__ = now; if (av->consumption_since_last_update__ < 0) { left_bytes = - av->consumption_since_last_update__; @@ -193,6 +192,7 @@ update_tracker (struct GNUNET_BANDWIDTH_Tracker *av) (unsigned int) av->available_bytes_per_s__, (unsigned long long) (now.value - av->last_update__.value)); #endif + av->last_update__ = now; }