aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo/peerinfo_api_notify.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/peerinfo/peerinfo_api_notify.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/peerinfo/peerinfo_api_notify.c')
-rw-r--r--src/peerinfo/peerinfo_api_notify.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/peerinfo/peerinfo_api_notify.c b/src/peerinfo/peerinfo_api_notify.c
index af41b08f9..aaa62588e 100644
--- a/src/peerinfo/peerinfo_api_notify.c
+++ b/src/peerinfo/peerinfo_api_notify.c
@@ -66,7 +66,7 @@ struct GNUNET_PEERINFO_NotifyContext
66 /** 66 /**
67 * Tasked used for delayed re-connection attempt. 67 * Tasked used for delayed re-connection attempt.
68 */ 68 */
69 GNUNET_SCHEDULER_TaskIdentifier task; 69 struct GNUNET_SCHEDULER_Task * task;
70 70
71 /** 71 /**
72 * Include friend only HELLOs in callbacks 72 * Include friend only HELLOs in callbacks
@@ -107,7 +107,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
107{ 107{
108 struct GNUNET_PEERINFO_NotifyContext *nc = cls; 108 struct GNUNET_PEERINFO_NotifyContext *nc = cls;
109 109
110 nc->task = GNUNET_SCHEDULER_NO_TASK; 110 nc->task = NULL;
111 nc->client = GNUNET_CLIENT_connect ("peerinfo", nc->cfg); 111 nc->client = GNUNET_CLIENT_connect ("peerinfo", nc->cfg);
112 if (NULL == nc->client) 112 if (NULL == nc->client)
113 { 113 {
@@ -295,7 +295,7 @@ GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc)
295 } 295 }
296 if (NULL != nc->client) 296 if (NULL != nc->client)
297 GNUNET_CLIENT_disconnect (nc->client); 297 GNUNET_CLIENT_disconnect (nc->client);
298 if (GNUNET_SCHEDULER_NO_TASK != nc->task) 298 if (NULL != nc->task)
299 GNUNET_SCHEDULER_cancel (nc->task); 299 GNUNET_SCHEDULER_cancel (nc->task);
300 GNUNET_free (nc); 300 GNUNET_free (nc);
301} 301}