diff options
-rw-r--r-- | src/util/bandwidth.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/util/bandwidth.c b/src/util/bandwidth.c index 877164789..2a1a4011b 100644 --- a/src/util/bandwidth.c +++ b/src/util/bandwidth.c | |||
@@ -132,7 +132,9 @@ excess_trigger (void *cls, | |||
132 | struct GNUNET_BANDWIDTH_Tracker *av = cls; | 132 | struct GNUNET_BANDWIDTH_Tracker *av = cls; |
133 | 133 | ||
134 | av->excess_task = GNUNET_SCHEDULER_NO_TASK; | 134 | av->excess_task = GNUNET_SCHEDULER_NO_TASK; |
135 | av->excess_cb (av->excess_cb_cls); | 135 | |
136 | if (NULL != av->excess_cb) | ||
137 | av->excess_cb (av->excess_cb_cls); | ||
136 | } | 138 | } |
137 | 139 | ||
138 | 140 | ||
@@ -261,6 +263,25 @@ GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, | |||
261 | 263 | ||
262 | 264 | ||
263 | /** | 265 | /** |
266 | * Stop notifying about tracker updates and excess notifications | ||
267 | * | ||
268 | * @param av the respective trackers | ||
269 | */ | ||
270 | void | ||
271 | GNUNET_BANDWIDTH_tracker_notification_stop (struct GNUNET_BANDWIDTH_Tracker *av) | ||
272 | { | ||
273 | if (GNUNET_SCHEDULER_NO_TASK != av->excess_task) | ||
274 | GNUNET_SCHEDULER_cancel (av->excess_task); | ||
275 | av->excess_task = GNUNET_SCHEDULER_NO_TASK; | ||
276 | av->excess_cb = NULL; | ||
277 | av->excess_cb_cls = NULL; | ||
278 | av->update_cb = NULL; | ||
279 | av->update_cb_cls = NULL; | ||
280 | } | ||
281 | |||
282 | |||
283 | |||
284 | /** | ||
264 | * Update the tracker, looking at the current time and | 285 | * Update the tracker, looking at the current time and |
265 | * bandwidth consumption data. | 286 | * bandwidth consumption data. |
266 | * | 287 | * |