gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r32274 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r32274 - gnunet/src/util
Date: Mon, 10 Feb 2014 15:33:01 +0100

Author: wachs
Date: 2014-02-10 15:33:01 +0100 (Mon, 10 Feb 2014)
New Revision: 32274

Modified:
   gnunet/src/util/bandwidth.c
Log:
fixing crash: excess task has to be stopped when neighbour is freed


Modified: gnunet/src/util/bandwidth.c
===================================================================
--- gnunet/src/util/bandwidth.c 2014-02-10 13:57:59 UTC (rev 32273)
+++ gnunet/src/util/bandwidth.c 2014-02-10 14:33:01 UTC (rev 32274)
@@ -132,7 +132,9 @@
   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);
 }
 
 
@@ -261,6 +263,25 @@
 
 
 /**
+ * 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.
  *




reply via email to

[Prev in Thread] Current Thread [Next in Thread]