aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/testbed/gnunet-service-testbed_links.c12
-rw-r--r--src/testbed/gnunet-testbed-profiler.c6
2 files changed, 13 insertions, 5 deletions
diff --git a/src/testbed/gnunet-service-testbed_links.c b/src/testbed/gnunet-service-testbed_links.c
index 80e96762b..0c89392de 100644
--- a/src/testbed/gnunet-service-testbed_links.c
+++ b/src/testbed/gnunet-service-testbed_links.c
@@ -762,24 +762,24 @@ trigger_notifications (struct Neighbour *n)
762 GNUNET_TESTBED_operation_activate_ (n->conn_op); 762 GNUNET_TESTBED_operation_activate_ (n->conn_op);
763 n->inactive = 0; 763 n->inactive = 0;
764 } 764 }
765 n->reference_cnt++;
765 n->notify_task = 766 n->notify_task =
766 GNUNET_SCHEDULER_add_now (&neighbour_connect_notify_task, n->nl_head); 767 GNUNET_SCHEDULER_add_now (&neighbour_connect_notify_task, n);
767} 768}
768 769
769static void 770static void
770neighbour_connect_notify_task (void *cls, 771neighbour_connect_notify_task (void *cls,
771 const struct GNUNET_SCHEDULER_TaskContext *tc) 772 const struct GNUNET_SCHEDULER_TaskContext *tc)
772{ 773{
773 struct NeighbourConnectNotification *h = cls; 774 struct Neighbour *n = cls;
774 struct Neighbour *n; 775 struct NeighbourConnectNotification *h;
775 776
776 n = h->n; 777 GNUNET_assert (NULL != (h = n->nl_head));
777 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != n->notify_task); 778 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != n->notify_task);
778 n->notify_task = GNUNET_SCHEDULER_NO_TASK; 779 n->notify_task = GNUNET_SCHEDULER_NO_TASK;
779 GNUNET_assert (NULL != n->controller); 780 GNUNET_assert (NULL != n->controller);
780 GNUNET_CONTAINER_DLL_remove (n->nl_head, n->nl_tail, h); 781 GNUNET_CONTAINER_DLL_remove (n->nl_head, n->nl_tail, h);
781 trigger_notifications (n); 782 trigger_notifications (n);
782 n->reference_cnt++;
783 h->cb (h->cb_cls, n->controller); 783 h->cb (h->cb_cls, n->controller);
784 GNUNET_free (h); 784 GNUNET_free (h);
785} 785}
@@ -859,6 +859,8 @@ GST_neighbour_get_connection_cancel (struct NeighbourConnectNotification *h)
859 return; 859 return;
860 if (GNUNET_SCHEDULER_NO_TASK == n->notify_task) 860 if (GNUNET_SCHEDULER_NO_TASK == n->notify_task)
861 return; 861 return;
862 GNUNET_assert (0 < n->reference_cnt);
863 n->reference_cnt--;
862 GNUNET_SCHEDULER_cancel (n->notify_task); 864 GNUNET_SCHEDULER_cancel (n->notify_task);
863 n->notify_task = GNUNET_SCHEDULER_NO_TASK; 865 n->notify_task = GNUNET_SCHEDULER_NO_TASK;
864 if (NULL == n->nl_head) 866 if (NULL == n->nl_head)
diff --git a/src/testbed/gnunet-testbed-profiler.c b/src/testbed/gnunet-testbed-profiler.c
index 1bcce20e4..24b3cdac6 100644
--- a/src/testbed/gnunet-testbed-profiler.c
+++ b/src/testbed/gnunet-testbed-profiler.c
@@ -110,9 +110,15 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
110{ 110{
111 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 111 shutdown_task = GNUNET_SCHEDULER_NO_TASK;
112 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 112 if (GNUNET_SCHEDULER_NO_TASK != abort_task)
113 {
113 GNUNET_SCHEDULER_cancel (abort_task); 114 GNUNET_SCHEDULER_cancel (abort_task);
115 abort_task = GNUNET_SCHEDULER_NO_TASK;
116 }
114 if (NULL != cfg) 117 if (NULL != cfg)
118 {
115 GNUNET_CONFIGURATION_destroy (cfg); 119 GNUNET_CONFIGURATION_destroy (cfg);
120 cfg = NULL;
121 }
116 GNUNET_SCHEDULER_shutdown (); /* Stop scheduler to shutdown testbed run */ 122 GNUNET_SCHEDULER_shutdown (); /* Stop scheduler to shutdown testbed run */
117} 123}
118 124