aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo/test_peerinfo_api_notify_friend_only.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/test_peerinfo_api_notify_friend_only.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/test_peerinfo_api_notify_friend_only.c')
-rw-r--r--src/peerinfo/test_peerinfo_api_notify_friend_only.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/peerinfo/test_peerinfo_api_notify_friend_only.c b/src/peerinfo/test_peerinfo_api_notify_friend_only.c
index c47fe6387..0b252621e 100644
--- a/src/peerinfo/test_peerinfo_api_notify_friend_only.c
+++ b/src/peerinfo/test_peerinfo_api_notify_friend_only.c
@@ -58,12 +58,12 @@ static int res_cb_wo_fo;
58 58
59struct GNUNET_PeerIdentity pid; 59struct GNUNET_PeerIdentity pid;
60 60
61GNUNET_SCHEDULER_TaskIdentifier timeout_task; 61struct GNUNET_SCHEDULER_Task * timeout_task;
62 62
63static void 63static void
64end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 64end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
65{ 65{
66 timeout_task = GNUNET_SCHEDULER_NO_TASK; 66 timeout_task = NULL;
67 GNUNET_break(0); 67 GNUNET_break(0);
68 if (NULL != pnc_wo_fo) 68 if (NULL != pnc_wo_fo)
69 { 69 {
@@ -95,10 +95,10 @@ done (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
95 GNUNET_PEERINFO_disconnect (h); 95 GNUNET_PEERINFO_disconnect (h);
96 h = NULL; 96 h = NULL;
97 97
98 if (GNUNET_SCHEDULER_NO_TASK != timeout_task) 98 if (NULL != timeout_task)
99 { 99 {
100 GNUNET_SCHEDULER_cancel (timeout_task); 100 GNUNET_SCHEDULER_cancel (timeout_task);
101 timeout_task = GNUNET_SCHEDULER_NO_TASK; 101 timeout_task = NULL;
102 } 102 }
103 103
104 if ((GNUNET_YES == res_cb_w_fo) && (GNUNET_NO == res_cb_wo_fo)) 104 if ((GNUNET_YES == res_cb_w_fo) && (GNUNET_NO == res_cb_wo_fo))