aboutsummaryrefslogtreecommitdiff
path: root/src/core/gnunet-service-core_neighbours.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-12-24 01:10:47 +0000
committerChristian Grothoff <christian@grothoff.org>2014-12-24 01:10:47 +0000
commitf1f603c7d0b3f03dca46a4f313472288eb080eb1 (patch)
tree3a29966b02dfb83e0a8a8d5c42b3116380209fb0 /src/core/gnunet-service-core_neighbours.c
parent53cd5b8eda2fa8db86b0907a62a39598981d008a (diff)
downloadgnunet-f1f603c7d0b3f03dca46a4f313472288eb080eb1.tar.gz
gnunet-f1f603c7d0b3f03dca46a4f313472288eb080eb1.zip
making GNUNET_SCHEDULER_cancel() perform in O(1) instead of O(n) to help or even fully address #3247
Diffstat (limited to 'src/core/gnunet-service-core_neighbours.c')
-rw-r--r--src/core/gnunet-service-core_neighbours.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/gnunet-service-core_neighbours.c b/src/core/gnunet-service-core_neighbours.c
index 20055081b..4fbe72074 100644
--- a/src/core/gnunet-service-core_neighbours.c
+++ b/src/core/gnunet-service-core_neighbours.c
@@ -103,7 +103,7 @@ struct Neighbour
103 /** 103 /**
104 * ID of task used for re-trying plaintext scheduling. 104 * ID of task used for re-trying plaintext scheduling.
105 */ 105 */
106 GNUNET_SCHEDULER_TaskIdentifier retry_plaintext_task; 106 struct GNUNET_SCHEDULER_Task * retry_plaintext_task;
107 107
108 /** 108 /**
109 * #GNUNET_YES if this peer currently has excess bandwidth. 109 * #GNUNET_YES if this peer currently has excess bandwidth.
@@ -172,10 +172,10 @@ free_neighbour (struct Neighbour *n)
172 GSC_KX_stop (n->kxinfo); 172 GSC_KX_stop (n->kxinfo);
173 n->kxinfo = NULL; 173 n->kxinfo = NULL;
174 } 174 }
175 if (n->retry_plaintext_task != GNUNET_SCHEDULER_NO_TASK) 175 if (n->retry_plaintext_task != NULL)
176 { 176 {
177 GNUNET_SCHEDULER_cancel (n->retry_plaintext_task); 177 GNUNET_SCHEDULER_cancel (n->retry_plaintext_task);
178 n->retry_plaintext_task = GNUNET_SCHEDULER_NO_TASK; 178 n->retry_plaintext_task = NULL;
179 } 179 }
180 GNUNET_assert (GNUNET_OK == 180 GNUNET_assert (GNUNET_OK ==
181 GNUNET_CONTAINER_multipeermap_remove (neighbours, 181 GNUNET_CONTAINER_multipeermap_remove (neighbours,