diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-04-15 14:10:35 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-04-15 14:10:35 +0000 |
commit | e58b22c326781e754672759bd5885f32b64d0626 (patch) | |
tree | 889abf24897e69e1ba07aa98784bfbafc90448d0 /src/testbed/gnunet-service-testbed_links.c | |
parent | ad68ae150f17cf6e0b2c605c9331cf0aedfce1d0 (diff) | |
download | gnunet-e58b22c326781e754672759bd5885f32b64d0626.tar.gz gnunet-e58b22c326781e754672759bd5885f32b64d0626.zip |
- fixes
Diffstat (limited to 'src/testbed/gnunet-service-testbed_links.c')
-rw-r--r-- | src/testbed/gnunet-service-testbed_links.c | 12 |
1 files changed, 7 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 | ||
769 | static void | 770 | static void |
770 | neighbour_connect_notify_task (void *cls, | 771 | neighbour_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) |