aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/gnunet_bandwidth_lib.h4
-rw-r--r--src/include/gnunet_time_lib.h4
-rw-r--r--src/util/bandwidth.c4
-rw-r--r--src/util/time.c8
4 files changed, 12 insertions, 8 deletions
diff --git a/src/include/gnunet_bandwidth_lib.h b/src/include/gnunet_bandwidth_lib.h
index 7b63de390..178ddaaac 100644
--- a/src/include/gnunet_bandwidth_lib.h
+++ b/src/include/gnunet_bandwidth_lib.h
@@ -126,7 +126,7 @@ struct GNUNET_BANDWIDTH_Tracker
126 struct GNUNET_TIME_Absolute last_update__; 126 struct GNUNET_TIME_Absolute last_update__;
127 127
128 /** 128 /**
129 * Bandwidth limit to enforce in bytes per s. 129 * Bandwidth limit to enforce in bytes per second.
130 */ 130 */
131 uint32_t available_bytes_per_s__; 131 uint32_t available_bytes_per_s__;
132 132
@@ -289,7 +289,7 @@ GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av,
289 289
290 290
291/** 291/**
292 * Compute how long we should wait until consuming 'size' 292 * Compute how long we should wait until consuming @a size
293 * bytes of bandwidth in order to stay within the given 293 * bytes of bandwidth in order to stay within the given
294 * quota. 294 * quota.
295 * 295 *
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h
index 3dad179b5..64c5769c6 100644
--- a/src/include/gnunet_time_lib.h
+++ b/src/include/gnunet_time_lib.h
@@ -417,7 +417,7 @@ GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start,
417 */ 417 */
418struct GNUNET_TIME_Relative 418struct GNUNET_TIME_Relative
419GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel, 419GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel,
420 unsigned int factor); 420 unsigned long long factor);
421 421
422 422
423/** 423/**
@@ -429,7 +429,7 @@ GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel,
429 */ 429 */
430struct GNUNET_TIME_Relative 430struct GNUNET_TIME_Relative
431GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel, 431GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel,
432 unsigned int factor); 432 unsigned long long factor);
433 433
434 434
435/** 435/**
diff --git a/src/util/bandwidth.c b/src/util/bandwidth.c
index 61677fdcf..008963c3c 100644
--- a/src/util/bandwidth.c
+++ b/src/util/bandwidth.c
@@ -147,7 +147,11 @@ excess_trigger (void *cls)
147 147
148 av->excess_task = NULL; 148 av->excess_task = NULL;
149 if (NULL != av->excess_cb) 149 if (NULL != av->excess_cb)
150 {
151 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
152 "Notifying application about excess bandwidth\n");
150 av->excess_cb (av->excess_cb_cls); 153 av->excess_cb (av->excess_cb_cls);
154 }
151} 155}
152 156
153 157
diff --git a/src/util/time.c b/src/util/time.c
index 91bbbf72a..eb168d531 100644
--- a/src/util/time.c
+++ b/src/util/time.c
@@ -427,7 +427,7 @@ GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start,
427 */ 427 */
428struct GNUNET_TIME_Relative 428struct GNUNET_TIME_Relative
429GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel, 429GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel,
430 unsigned int factor) 430 unsigned long long factor)
431{ 431{
432 struct GNUNET_TIME_Relative ret; 432 struct GNUNET_TIME_Relative ret;
433 433
@@ -435,7 +435,7 @@ GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel,
435 return GNUNET_TIME_UNIT_ZERO; 435 return GNUNET_TIME_UNIT_ZERO;
436 if (rel.rel_value_us == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) 436 if (rel.rel_value_us == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us)
437 return GNUNET_TIME_UNIT_FOREVER_REL; 437 return GNUNET_TIME_UNIT_FOREVER_REL;
438 ret.rel_value_us = rel.rel_value_us * (unsigned long long) factor; 438 ret.rel_value_us = rel.rel_value_us * factor;
439 if (ret.rel_value_us / factor != rel.rel_value_us) 439 if (ret.rel_value_us / factor != rel.rel_value_us)
440 { 440 {
441 GNUNET_break (0); 441 GNUNET_break (0);
@@ -454,14 +454,14 @@ GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel,
454 */ 454 */
455struct GNUNET_TIME_Relative 455struct GNUNET_TIME_Relative
456GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel, 456GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel,
457 unsigned int factor) 457 unsigned long long factor)
458{ 458{
459 struct GNUNET_TIME_Relative ret; 459 struct GNUNET_TIME_Relative ret;
460 460
461 if ((0 == factor) || 461 if ((0 == factor) ||
462 (rel.rel_value_us == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us)) 462 (rel.rel_value_us == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us))
463 return GNUNET_TIME_UNIT_FOREVER_REL; 463 return GNUNET_TIME_UNIT_FOREVER_REL;
464 ret.rel_value_us = rel.rel_value_us / (unsigned long long) factor; 464 ret.rel_value_us = rel.rel_value_us / factor;
465 return ret; 465 return ret;
466} 466}
467 467