struct GNUNET_TIME_Absolute last_update__;
/**
- * Bandwidth limit to enforce in bytes per s.
+ * Bandwidth limit to enforce in bytes per second.
*/
uint32_t available_bytes_per_s__;
/**
- * Compute how long we should wait until consuming 'size'
+ * Compute how long we should wait until consuming @a size
* bytes of bandwidth in order to stay within the given
* quota.
*
*/
struct GNUNET_TIME_Relative
GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel,
- unsigned int factor);
+ unsigned long long factor);
/**
*/
struct GNUNET_TIME_Relative
GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel,
- unsigned int factor);
+ unsigned long long factor);
/**
av->excess_task = NULL;
if (NULL != av->excess_cb)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Notifying application about excess bandwidth\n");
av->excess_cb (av->excess_cb_cls);
+ }
}
*/
struct GNUNET_TIME_Relative
GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel,
- unsigned int factor)
+ unsigned long long factor)
{
struct GNUNET_TIME_Relative ret;
return GNUNET_TIME_UNIT_ZERO;
if (rel.rel_value_us == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us)
return GNUNET_TIME_UNIT_FOREVER_REL;
- ret.rel_value_us = rel.rel_value_us * (unsigned long long) factor;
+ ret.rel_value_us = rel.rel_value_us * factor;
if (ret.rel_value_us / factor != rel.rel_value_us)
{
GNUNET_break (0);
*/
struct GNUNET_TIME_Relative
GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel,
- unsigned int factor)
+ unsigned long long factor)
{
struct GNUNET_TIME_Relative ret;
if ((0 == factor) ||
(rel.rel_value_us == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us))
return GNUNET_TIME_UNIT_FOREVER_REL;
- ret.rel_value_us = rel.rel_value_us / (unsigned long long) factor;
+ ret.rel_value_us = rel.rel_value_us / factor;
return ret;
}