aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gnunet-bcd.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/gns/gnunet-bcd.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/gns/gnunet-bcd.c')
-rw-r--r--src/gns/gnunet-bcd.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gns/gnunet-bcd.c b/src/gns/gnunet-bcd.c
index 4e018c12d..200591f41 100644
--- a/src/gns/gnunet-bcd.c
+++ b/src/gns/gnunet-bcd.c
@@ -51,7 +51,7 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
51/** 51/**
52 * Our primary task for the HTTPD. 52 * Our primary task for the HTTPD.
53 */ 53 */
54static GNUNET_SCHEDULER_TaskIdentifier http_task; 54static struct GNUNET_SCHEDULER_Task * http_task;
55 55
56/** 56/**
57 * Our main website. 57 * Our main website.
@@ -278,7 +278,7 @@ access_handler_callback (void *cls, struct MHD_Connection *connection,
278 * Function that queries MHD's select sets and 278 * Function that queries MHD's select sets and
279 * starts the task waiting for them. 279 * starts the task waiting for them.
280 */ 280 */
281static GNUNET_SCHEDULER_TaskIdentifier 281static struct GNUNET_SCHEDULER_Task *
282prepare_daemon (struct MHD_Daemon *daemon_handle); 282prepare_daemon (struct MHD_Daemon *daemon_handle);
283 283
284 284
@@ -291,7 +291,7 @@ run_daemon (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
291{ 291{
292 struct MHD_Daemon *daemon_handle = cls; 292 struct MHD_Daemon *daemon_handle = cls;
293 293
294 http_task = GNUNET_SCHEDULER_NO_TASK; 294 http_task = NULL;
295 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 295 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
296 return; 296 return;
297 GNUNET_assert (MHD_YES == MHD_run (daemon_handle)); 297 GNUNET_assert (MHD_YES == MHD_run (daemon_handle));
@@ -303,10 +303,10 @@ run_daemon (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
303 * Function that queries MHD's select sets and 303 * Function that queries MHD's select sets and
304 * starts the task waiting for them. 304 * starts the task waiting for them.
305 */ 305 */
306static GNUNET_SCHEDULER_TaskIdentifier 306static struct GNUNET_SCHEDULER_Task *
307prepare_daemon (struct MHD_Daemon *daemon_handle) 307prepare_daemon (struct MHD_Daemon *daemon_handle)
308{ 308{
309 GNUNET_SCHEDULER_TaskIdentifier ret; 309 struct GNUNET_SCHEDULER_Task * ret;
310 fd_set rs; 310 fd_set rs;
311 fd_set ws; 311 fd_set ws;
312 fd_set es; 312 fd_set es;
@@ -389,10 +389,10 @@ server_stop (void *cls,
389{ 389{
390 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 390 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
391 "HTTP server shutdown\n"); 391 "HTTP server shutdown\n");
392 if (GNUNET_SCHEDULER_NO_TASK != http_task) 392 if (NULL != http_task)
393 { 393 {
394 GNUNET_SCHEDULER_cancel (http_task); 394 GNUNET_SCHEDULER_cancel (http_task);
395 http_task = GNUNET_SCHEDULER_NO_TASK; 395 http_task = NULL;
396 } 396 }
397 if (NULL != daemon_handle) 397 if (NULL != daemon_handle)
398 { 398 {