diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-02-10 14:33:01 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-02-10 14:33:01 +0000 |
commit | 3248c18dfb21f2400d7ccfef45cf962d35f6638f (patch) | |
tree | 32fed75e58c11e913c1a28b0a986d717350fd63c /src/util/bandwidth.c | |
parent | 9e14f0d720e8deb50097601b3a0385fad4115ab2 (diff) | |
download | gnunet-3248c18dfb21f2400d7ccfef45cf962d35f6638f.tar.gz gnunet-3248c18dfb21f2400d7ccfef45cf962d35f6638f.zip |
fixing crash: excess task has to be stopped when neighbour is freed
Diffstat (limited to 'src/util/bandwidth.c')
-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 | * |