diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-12-24 01:10:47 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-12-24 01:10:47 +0000 |
commit | f1f603c7d0b3f03dca46a4f313472288eb080eb1 (patch) | |
tree | 3a29966b02dfb83e0a8a8d5c42b3116380209fb0 /src/gns/gns_api.c | |
parent | 53cd5b8eda2fa8db86b0907a62a39598981d008a (diff) | |
download | gnunet-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/gns/gns_api.c')
-rw-r--r-- | src/gns/gns_api.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c index 9f7f28b71..327f89976 100644 --- a/src/gns/gns_api.c +++ b/src/gns/gns_api.c | |||
@@ -154,7 +154,7 @@ struct GNUNET_GNS_Handle | |||
154 | /** | 154 | /** |
155 | * Reconnect task | 155 | * Reconnect task |
156 | */ | 156 | */ |
157 | GNUNET_SCHEDULER_TaskIdentifier reconnect_task; | 157 | struct GNUNET_SCHEDULER_Task * reconnect_task; |
158 | 158 | ||
159 | /** | 159 | /** |
160 | * How long do we wait until we try to reconnect? | 160 | * How long do we wait until we try to reconnect? |
@@ -210,7 +210,7 @@ reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
210 | { | 210 | { |
211 | struct GNUNET_GNS_Handle *handle = cls; | 211 | struct GNUNET_GNS_Handle *handle = cls; |
212 | 212 | ||
213 | handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK; | 213 | handle->reconnect_task = NULL; |
214 | reconnect (handle); | 214 | reconnect (handle); |
215 | } | 215 | } |
216 | 216 | ||
@@ -484,10 +484,10 @@ GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle) | |||
484 | GNUNET_CLIENT_disconnect (handle->client); | 484 | GNUNET_CLIENT_disconnect (handle->client); |
485 | handle->client = NULL; | 485 | handle->client = NULL; |
486 | } | 486 | } |
487 | if (GNUNET_SCHEDULER_NO_TASK != handle->reconnect_task) | 487 | if (NULL != handle->reconnect_task) |
488 | { | 488 | { |
489 | GNUNET_SCHEDULER_cancel (handle->reconnect_task); | 489 | GNUNET_SCHEDULER_cancel (handle->reconnect_task); |
490 | handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK; | 490 | handle->reconnect_task = NULL; |
491 | } | 491 | } |
492 | GNUNET_assert (NULL == handle->lookup_head); | 492 | GNUNET_assert (NULL == handle->lookup_head); |
493 | GNUNET_free (handle); | 493 | GNUNET_free (handle); |