aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/namestore_api.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/namestore/namestore_api.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/namestore/namestore_api.c')
-rw-r--r--src/namestore/namestore_api.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c
index c089929a6..eca65f116 100644
--- a/src/namestore/namestore_api.c
+++ b/src/namestore/namestore_api.c
@@ -214,7 +214,7 @@ struct GNUNET_NAMESTORE_Handle
214 /** 214 /**
215 * Reconnect task 215 * Reconnect task
216 */ 216 */
217 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 217 struct GNUNET_SCHEDULER_Task * reconnect_task;
218 218
219 /** 219 /**
220 * Delay introduced before we reconnect. 220 * Delay introduced before we reconnect.
@@ -874,7 +874,7 @@ reconnect_task (void *cls,
874{ 874{
875 struct GNUNET_NAMESTORE_Handle *h = cls; 875 struct GNUNET_NAMESTORE_Handle *h = cls;
876 876
877 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 877 h->reconnect_task = NULL;
878 reconnect (h); 878 reconnect (h);
879} 879}
880 880
@@ -979,10 +979,10 @@ GNUNET_NAMESTORE_disconnect (struct GNUNET_NAMESTORE_Handle *h)
979 GNUNET_CLIENT_disconnect (h->client); 979 GNUNET_CLIENT_disconnect (h->client);
980 h->client = NULL; 980 h->client = NULL;
981 } 981 }
982 if (GNUNET_SCHEDULER_NO_TASK != h->reconnect_task) 982 if (NULL != h->reconnect_task)
983 { 983 {
984 GNUNET_SCHEDULER_cancel (h->reconnect_task); 984 GNUNET_SCHEDULER_cancel (h->reconnect_task);
985 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 985 h->reconnect_task = NULL;
986 } 986 }
987 GNUNET_free (h); 987 GNUNET_free (h);
988} 988}