struct GNUNET_BANDWIDTH_Tracker *av = cls;
av->excess_task = GNUNET_SCHEDULER_NO_TASK;
- av->excess_cb (av->excess_cb_cls);
+
+ if (NULL != av->excess_cb)
+ av->excess_cb (av->excess_cb_cls);
}
* ignored and replaced by #GNUNET_SERVER_MAX_MESSAGE_SIZE (which is in
* bytes).
*
+ * To stop notifications about updates and excess callbacks use
+ * #GNUNET_BANDWIDTH_tracker_notification_stop
+ *
* @param av tracker to initialize
* @param update_cb callback to notify a client about the tracker being updated
* @param update_cb_cls cls for the callback
}
+/**
+ * Stop notifying about tracker updates and excess notifications
+ *
+ * @param av the respective trackers
+ */
+void
+GNUNET_BANDWIDTH_tracker_notification_stop (struct GNUNET_BANDWIDTH_Tracker *av)
+{
+ if (GNUNET_SCHEDULER_NO_TASK != av->excess_task)
+ GNUNET_SCHEDULER_cancel (av->excess_task);
+ av->excess_task = GNUNET_SCHEDULER_NO_TASK;
+ av->excess_cb = NULL;
+ av->excess_cb_cls = NULL;
+ av->update_cb = NULL;
+ av->update_cb_cls = NULL;
+}
+
+
+
/**
* Update the tracker, looking at the current time and
* bandwidth consumption data.