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/namestore/test_namestore_api_lookup_shadow.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/namestore/test_namestore_api_lookup_shadow.c')
-rw-r--r-- | src/namestore/test_namestore_api_lookup_shadow.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/namestore/test_namestore_api_lookup_shadow.c b/src/namestore/test_namestore_api_lookup_shadow.c index e423dbb3e..373aa116d 100644 --- a/src/namestore/test_namestore_api_lookup_shadow.c +++ b/src/namestore/test_namestore_api_lookup_shadow.c | |||
@@ -41,7 +41,7 @@ static struct GNUNET_NAMESTORE_Handle *nsh; | |||
41 | 41 | ||
42 | static struct GNUNET_NAMECACHE_Handle *nch; | 42 | static struct GNUNET_NAMECACHE_Handle *nch; |
43 | 43 | ||
44 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | 44 | static struct GNUNET_SCHEDULER_Task * endbadly_task; |
45 | 45 | ||
46 | static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; | 46 | static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; |
47 | 47 | ||
@@ -171,17 +171,17 @@ name_lookup_proc (void *cls, | |||
171 | ncqe = NULL; | 171 | ncqe = NULL; |
172 | GNUNET_assert (NULL != cls); | 172 | GNUNET_assert (NULL != cls); |
173 | 173 | ||
174 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) | 174 | if (endbadly_task != NULL) |
175 | { | 175 | { |
176 | GNUNET_SCHEDULER_cancel (endbadly_task); | 176 | GNUNET_SCHEDULER_cancel (endbadly_task); |
177 | endbadly_task = GNUNET_SCHEDULER_NO_TASK; | 177 | endbadly_task = NULL; |
178 | } | 178 | } |
179 | 179 | ||
180 | if (NULL == block) | 180 | if (NULL == block) |
181 | { | 181 | { |
182 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 182 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
183 | _("Namestore returned no block\n")); | 183 | _("Namestore returned no block\n")); |
184 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) | 184 | if (endbadly_task != NULL) |
185 | GNUNET_SCHEDULER_cancel (endbadly_task); | 185 | GNUNET_SCHEDULER_cancel (endbadly_task); |
186 | endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); | 186 | endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); |
187 | return; | 187 | return; |