diff options
author | David Barksdale <amatus@amatus.name> | 2016-11-17 23:24:43 -0600 |
---|---|---|
committer | David Barksdale <amatus@amatus.name> | 2016-11-17 23:24:43 -0600 |
commit | 12597da2a33fe196a785a656136cba7675a06e21 (patch) | |
tree | c189c7fb7f2835f8219622400d83c453a91dbb69 /src/util/bandwidth.c | |
parent | cdeb1253bfda209def1ef48b436ff09cf7ab8be6 (diff) | |
download | gnunet-12597da2a33fe196a785a656136cba7675a06e21.tar.gz gnunet-12597da2a33fe196a785a656136cba7675a06e21.zip |
Sometimes it's OK if multiplication overflows
Diffstat (limited to 'src/util/bandwidth.c')
-rw-r--r-- | src/util/bandwidth.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/bandwidth.c b/src/util/bandwidth.c index 980af764a..a059fc738 100644 --- a/src/util/bandwidth.c +++ b/src/util/bandwidth.c | |||
@@ -204,8 +204,8 @@ update_excess (struct GNUNET_BANDWIDTH_Tracker *av) | |||
204 | else | 204 | else |
205 | { | 205 | { |
206 | double factor = 1.0 * left_bytes / (double) av->available_bytes_per_s__; | 206 | double factor = 1.0 * left_bytes / (double) av->available_bytes_per_s__; |
207 | delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, | 207 | delay = GNUNET_TIME_relative_saturating_multiply (GNUNET_TIME_UNIT_SECONDS, |
208 | (unsigned long long) factor); | 208 | (unsigned long long) factor); |
209 | } | 209 | } |
210 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 210 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
211 | "At %llu bps it will take us %s for %lld bytes to reach excess threshold\n", | 211 | "At %llu bps it will take us %s for %lld bytes to reach excess threshold\n", |