diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-30 08:17:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-30 08:17:37 +0000 |
commit | 95f9076a2139f5fb042b944a0658b6cda2fa35db (patch) | |
tree | b0826a2a1dcf812e6b4450fe6b05d47cd53ae49d /src/gns/gnunet-bcd.c | |
parent | 7746f68db77b9ca3c4aaca24ab2ce5253461240b (diff) | |
download | gnunet-95f9076a2139f5fb042b944a0658b6cda2fa35db.tar.gz gnunet-95f9076a2139f5fb042b944a0658b6cda2fa35db.zip |
implementing new scheduler shutdown semantics
Diffstat (limited to 'src/gns/gnunet-bcd.c')
-rw-r--r-- | src/gns/gnunet-bcd.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/gns/gnunet-bcd.c b/src/gns/gnunet-bcd.c index e7be8fd84..284804175 100644 --- a/src/gns/gnunet-bcd.c +++ b/src/gns/gnunet-bcd.c | |||
@@ -90,10 +90,14 @@ struct Entry | |||
90 | * Main request handler. | 90 | * Main request handler. |
91 | */ | 91 | */ |
92 | static int | 92 | static int |
93 | access_handler_callback (void *cls, struct MHD_Connection *connection, | 93 | access_handler_callback (void *cls, |
94 | const char *url, const char *method, | 94 | struct MHD_Connection *connection, |
95 | const char *version, const char *upload_data, | 95 | const char *url, |
96 | size_t * upload_data_size, void **con_cls) | 96 | const char *method, |
97 | const char *version, | ||
98 | const char *upload_data, | ||
99 | size_t * upload_data_size, | ||
100 | void **con_cls) | ||
97 | { | 101 | { |
98 | static int dummy; | 102 | static int dummy; |
99 | static const struct Entry map[] = { | 103 | static const struct Entry map[] = { |
@@ -290,12 +294,8 @@ static void | |||
290 | run_daemon (void *cls) | 294 | run_daemon (void *cls) |
291 | { | 295 | { |
292 | struct MHD_Daemon *daemon_handle = cls; | 296 | struct MHD_Daemon *daemon_handle = cls; |
293 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
294 | 297 | ||
295 | http_task = NULL; | 298 | http_task = NULL; |
296 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
297 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | ||
298 | return; | ||
299 | GNUNET_assert (MHD_YES == MHD_run (daemon_handle)); | 299 | GNUNET_assert (MHD_YES == MHD_run (daemon_handle)); |
300 | http_task = prepare_daemon (daemon_handle); | 300 | http_task = prepare_daemon (daemon_handle); |
301 | } | 301 | } |
@@ -499,9 +499,8 @@ run (void *cls, | |||
499 | if (GNUNET_OK != | 499 | if (GNUNET_OK != |
500 | server_start ()) | 500 | server_start ()) |
501 | return; | 501 | return; |
502 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 502 | GNUNET_SCHEDULER_add_shutdown (&server_stop, |
503 | &server_stop, | 503 | NULL); |
504 | NULL); | ||
505 | } | 504 | } |
506 | 505 | ||
507 | 506 | ||