diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-04-24 12:47:02 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-04-24 12:47:02 +0000 |
commit | f88e96c46ff25d427c570e07b0bba8813813eabd (patch) | |
tree | 1e0076908effaeb06420ea04e1e166bcd5e7dc49 /src/hostlist | |
parent | e900e2e90ee6925981279880eb522f0c4e5e0fb3 (diff) | |
download | gnunet-f88e96c46ff25d427c570e07b0bba8813813eabd.tar.gz gnunet-f88e96c46ff25d427c570e07b0bba8813813eabd.zip |
-fixing shutdown sequence
Diffstat (limited to 'src/hostlist')
-rw-r--r-- | src/hostlist/hostlist-client.c | 62 | ||||
-rw-r--r-- | src/hostlist/hostlist-server.c | 33 |
2 files changed, 34 insertions, 61 deletions
diff --git a/src/hostlist/hostlist-client.c b/src/hostlist/hostlist-client.c index 5d3f037b3..5398e9aa5 100644 --- a/src/hostlist/hostlist-client.c +++ b/src/hostlist/hostlist-client.c | |||
@@ -36,8 +36,6 @@ | |||
36 | #include "gnunet_common.h" | 36 | #include "gnunet_common.h" |
37 | #include "gnunet_bio_lib.h" | 37 | #include "gnunet_bio_lib.h" |
38 | 38 | ||
39 | #define DEBUG_HOSTLIST_CLIENT GNUNET_EXTRA_LOGGING | ||
40 | |||
41 | 39 | ||
42 | /** | 40 | /** |
43 | * Number of connections that we must have to NOT download | 41 | * Number of connections that we must have to NOT download |
@@ -209,6 +207,11 @@ static unsigned int linked_list_size; | |||
209 | static struct Hostlist *hostlist_to_test; | 207 | static struct Hostlist *hostlist_to_test; |
210 | 208 | ||
211 | /** | 209 | /** |
210 | * Handle for our statistics GET operation. | ||
211 | */ | ||
212 | static struct GNUNET_STATISTICS_GetHandle *sget; | ||
213 | |||
214 | /** | ||
212 | * Set to GNUNET_YES if the current URL had some problems. | 215 | * Set to GNUNET_YES if the current URL had some problems. |
213 | */ | 216 | */ |
214 | static int stat_bogus_url; | 217 | static int stat_bogus_url; |
@@ -320,11 +323,9 @@ callback_download (void *ptr, size_t size, size_t nmemb, void *ctx) | |||
320 | } | 323 | } |
321 | if (GNUNET_HELLO_size ((const struct GNUNET_HELLO_Message *) msg) == msize) | 324 | if (GNUNET_HELLO_size ((const struct GNUNET_HELLO_Message *) msg) == msize) |
322 | { | 325 | { |
323 | #if DEBUG_HOSTLIST_CLIENT | ||
324 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 326 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
325 | "Received valid `%s' message from hostlist server.\n", | 327 | "Received valid `%s' message from hostlist server.\n", |
326 | "HELLO"); | 328 | "HELLO"); |
327 | #endif | ||
328 | GNUNET_STATISTICS_update (stats, | 329 | GNUNET_STATISTICS_update (stats, |
329 | gettext_noop | 330 | gettext_noop |
330 | ("# valid HELLOs downloaded from hostlist servers"), | 331 | ("# valid HELLOs downloaded from hostlist servers"), |
@@ -760,10 +761,8 @@ download_prepare () | |||
760 | gws = GNUNET_NETWORK_fdset_create (); | 761 | gws = GNUNET_NETWORK_fdset_create (); |
761 | GNUNET_NETWORK_fdset_copy_native (grs, &rs, max + 1); | 762 | GNUNET_NETWORK_fdset_copy_native (grs, &rs, max + 1); |
762 | GNUNET_NETWORK_fdset_copy_native (gws, &ws, max + 1); | 763 | GNUNET_NETWORK_fdset_copy_native (gws, &ws, max + 1); |
763 | #if DEBUG_HOSTLIST_CLIENT | ||
764 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 764 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
765 | "Scheduling task for hostlist download using cURL\n"); | 765 | "Scheduling task for hostlist download using cURL\n"); |
766 | #endif | ||
767 | ti_download = | 766 | ti_download = |
768 | GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT, | 767 | GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT, |
769 | rtime, grs, gws, | 768 | rtime, grs, gws, |
@@ -790,11 +789,9 @@ task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
790 | ti_download = GNUNET_SCHEDULER_NO_TASK; | 789 | ti_download = GNUNET_SCHEDULER_NO_TASK; |
791 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 790 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
792 | { | 791 | { |
793 | #if DEBUG_HOSTLIST_CLIENT | ||
794 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 792 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
795 | "Shutdown requested while trying to download hostlist from `%s'\n", | 793 | "Shutdown requested while trying to download hostlist from `%s'\n", |
796 | current_url); | 794 | current_url); |
797 | #endif | ||
798 | update_hostlist (); | 795 | update_hostlist (); |
799 | clean_up (); | 796 | clean_up (); |
800 | return; | 797 | return; |
@@ -808,11 +805,8 @@ task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
808 | clean_up (); | 805 | clean_up (); |
809 | return; | 806 | return; |
810 | } | 807 | } |
811 | #if DEBUG_HOSTLIST_CLIENT | ||
812 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 808 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
813 | "Ready for processing hostlist client request\n"); | 809 | "Ready for processing hostlist client request\n"); |
814 | #endif | ||
815 | |||
816 | do | 810 | do |
817 | { | 811 | { |
818 | running = 0; | 812 | running = 0; |
@@ -1018,18 +1012,16 @@ task_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1018 | ti_check_download = GNUNET_SCHEDULER_NO_TASK; | 1012 | ti_check_download = GNUNET_SCHEDULER_NO_TASK; |
1019 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 1013 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
1020 | return; | 1014 | return; |
1021 | |||
1022 | if (stat_connection_count < MIN_CONNECTIONS) | ||
1023 | { | ||
1024 | ti_download_dispatcher_task = | ||
1025 | GNUNET_SCHEDULER_add_now (&task_download_dispatcher, NULL); | ||
1026 | } | ||
1027 | |||
1028 | if (stats == NULL) | 1015 | if (stats == NULL) |
1029 | { | 1016 | { |
1030 | curl_global_cleanup (); | 1017 | curl_global_cleanup (); |
1031 | return; /* in shutdown */ | 1018 | return; /* in shutdown */ |
1032 | } | 1019 | } |
1020 | if ( (stat_connection_count < MIN_CONNECTIONS) && | ||
1021 | (GNUNET_SCHEDULER_NO_TASK == ti_download_dispatcher_task) ) | ||
1022 | ti_download_dispatcher_task = | ||
1023 | GNUNET_SCHEDULER_add_now (&task_download_dispatcher, NULL); | ||
1024 | |||
1033 | delay = hostlist_delay; | 1025 | delay = hostlist_delay; |
1034 | if (hostlist_delay.rel_value == 0) | 1026 | if (hostlist_delay.rel_value == 0) |
1035 | hostlist_delay = GNUNET_TIME_UNIT_SECONDS; | 1027 | hostlist_delay = GNUNET_TIME_UNIT_SECONDS; |
@@ -1235,12 +1227,10 @@ handler_advertisement (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1235 | static void | 1227 | static void |
1236 | primary_task (void *cls, int success) | 1228 | primary_task (void *cls, int success) |
1237 | { | 1229 | { |
1238 | if (stats == NULL) | 1230 | sget = NULL; |
1239 | return; /* in shutdown */ | 1231 | GNUNET_assert (stats != NULL); |
1240 | #if DEBUG_HOSTLIST_CLIENT | ||
1241 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1232 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1242 | "Statistics request done, scheduling hostlist download\n"); | 1233 | "Statistics request done, scheduling hostlist download\n"); |
1243 | #endif | ||
1244 | ti_check_download = GNUNET_SCHEDULER_add_now (&task_check, NULL); | 1234 | ti_check_download = GNUNET_SCHEDULER_add_now (&task_check, NULL); |
1245 | } | 1235 | } |
1246 | 1236 | ||
@@ -1510,11 +1500,11 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c, | |||
1510 | } | 1500 | } |
1511 | GNUNET_free (filename); | 1501 | GNUNET_free (filename); |
1512 | } | 1502 | } |
1513 | GNUNET_STATISTICS_get (stats, "hostlist", | 1503 | sget = GNUNET_STATISTICS_get (stats, "hostlist", |
1514 | gettext_noop | 1504 | gettext_noop |
1515 | ("# milliseconds between hostlist downloads"), | 1505 | ("# milliseconds between hostlist downloads"), |
1516 | GNUNET_TIME_UNIT_MINUTES, &primary_task, &process_stat, | 1506 | GNUNET_TIME_UNIT_MINUTES, &primary_task, &process_stat, |
1517 | NULL); | 1507 | NULL); |
1518 | return GNUNET_OK; | 1508 | return GNUNET_OK; |
1519 | } | 1509 | } |
1520 | 1510 | ||
@@ -1526,32 +1516,39 @@ void | |||
1526 | GNUNET_HOSTLIST_client_stop () | 1516 | GNUNET_HOSTLIST_client_stop () |
1527 | { | 1517 | { |
1528 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hostlist client shutdown\n"); | 1518 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hostlist client shutdown\n"); |
1529 | #if DEBUG_HOSTLIST_CLIENT | 1519 | if (NULL != sget) |
1530 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hostlist client shutdown\n"); | 1520 | { |
1531 | #endif | 1521 | GNUNET_STATISTICS_get_cancel (sget); |
1522 | sget = NULL; | ||
1523 | } | ||
1524 | stats = NULL; | ||
1532 | if (GNUNET_YES == stat_learning) | 1525 | if (GNUNET_YES == stat_learning) |
1533 | save_hostlist_file (GNUNET_YES); | 1526 | save_hostlist_file (GNUNET_YES); |
1534 | |||
1535 | if (ti_saving_task != GNUNET_SCHEDULER_NO_TASK) | 1527 | if (ti_saving_task != GNUNET_SCHEDULER_NO_TASK) |
1536 | { | 1528 | { |
1537 | GNUNET_SCHEDULER_cancel (ti_saving_task); | 1529 | GNUNET_SCHEDULER_cancel (ti_saving_task); |
1530 | ti_saving_task = GNUNET_SCHEDULER_NO_TASK; | ||
1538 | } | 1531 | } |
1539 | 1532 | ||
1540 | if (ti_download_dispatcher_task != GNUNET_SCHEDULER_NO_TASK) | 1533 | if (ti_download_dispatcher_task != GNUNET_SCHEDULER_NO_TASK) |
1541 | { | 1534 | { |
1542 | GNUNET_SCHEDULER_cancel (ti_download_dispatcher_task); | 1535 | GNUNET_SCHEDULER_cancel (ti_download_dispatcher_task); |
1536 | ti_download_dispatcher_task = GNUNET_SCHEDULER_NO_TASK; | ||
1543 | } | 1537 | } |
1544 | if (ti_testing_intervall_task != GNUNET_SCHEDULER_NO_TASK) | 1538 | if (ti_testing_intervall_task != GNUNET_SCHEDULER_NO_TASK) |
1545 | { | 1539 | { |
1546 | GNUNET_SCHEDULER_cancel (ti_testing_intervall_task); | 1540 | GNUNET_SCHEDULER_cancel (ti_testing_intervall_task); |
1541 | ti_testing_intervall_task = GNUNET_SCHEDULER_NO_TASK; | ||
1547 | } | 1542 | } |
1548 | if (ti_download != GNUNET_SCHEDULER_NO_TASK) | 1543 | if (ti_download != GNUNET_SCHEDULER_NO_TASK) |
1549 | { | 1544 | { |
1550 | GNUNET_SCHEDULER_cancel (ti_download); | 1545 | GNUNET_SCHEDULER_cancel (ti_download); |
1546 | ti_download = GNUNET_SCHEDULER_NO_TASK; | ||
1551 | } | 1547 | } |
1552 | if (ti_check_download != GNUNET_SCHEDULER_NO_TASK) | 1548 | if (ti_check_download != GNUNET_SCHEDULER_NO_TASK) |
1553 | { | 1549 | { |
1554 | GNUNET_SCHEDULER_cancel (ti_check_download); | 1550 | GNUNET_SCHEDULER_cancel (ti_check_download); |
1551 | ti_check_download = GNUNET_SCHEDULER_NO_TASK; | ||
1555 | curl_global_cleanup (); | 1552 | curl_global_cleanup (); |
1556 | } | 1553 | } |
1557 | if (transport != NULL) | 1554 | if (transport != NULL) |
@@ -1559,7 +1556,6 @@ GNUNET_HOSTLIST_client_stop () | |||
1559 | GNUNET_TRANSPORT_disconnect (transport); | 1556 | GNUNET_TRANSPORT_disconnect (transport); |
1560 | transport = NULL; | 1557 | transport = NULL; |
1561 | } | 1558 | } |
1562 | GNUNET_assert (NULL == transport); | ||
1563 | GNUNET_free_non_null (proxy); | 1559 | GNUNET_free_non_null (proxy); |
1564 | proxy = NULL; | 1560 | proxy = NULL; |
1565 | cfg = NULL; | 1561 | cfg = NULL; |
diff --git a/src/hostlist/hostlist-server.c b/src/hostlist/hostlist-server.c index c38830ca0..7bd74dca5 100644 --- a/src/hostlist/hostlist-server.c +++ b/src/hostlist/hostlist-server.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include "gnunet-daemon-hostlist.h" | 32 | #include "gnunet-daemon-hostlist.h" |
33 | #include "gnunet_resolver_service.h" | 33 | #include "gnunet_resolver_service.h" |
34 | 34 | ||
35 | #define DEBUG_HOSTLIST_SERVER GNUNET_EXTRA_LOGGING | ||
36 | 35 | ||
37 | /** | 36 | /** |
38 | * Handle to the HTTP server as provided by libmicrohttpd for IPv6. | 37 | * Handle to the HTTP server as provided by libmicrohttpd for IPv6. |
@@ -118,11 +117,9 @@ finish_response (struct HostSet *results) | |||
118 | { | 117 | { |
119 | if (response != NULL) | 118 | if (response != NULL) |
120 | MHD_destroy_response (response); | 119 | MHD_destroy_response (response); |
121 | #if DEBUG_HOSTLIST_SERVER | ||
122 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 120 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
123 | "Creating hostlist response with %u bytes\n", | 121 | "Creating hostlist response with %u bytes\n", |
124 | (unsigned int) results->size); | 122 | (unsigned int) results->size); |
125 | #endif | ||
126 | response = | 123 | response = |
127 | MHD_create_response_from_data (results->size, results->data, MHD_YES, | 124 | MHD_create_response_from_data (results->size, results->data, MHD_YES, |
128 | MHD_NO); | 125 | MHD_NO); |
@@ -208,11 +205,9 @@ host_processor (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
208 | } | 205 | } |
209 | old = results->size; | 206 | old = results->size; |
210 | s = GNUNET_HELLO_size (hello); | 207 | s = GNUNET_HELLO_size (hello); |
211 | #if DEBUG_HOSTLIST_SERVER | ||
212 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 208 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
213 | "Received %u bytes of `%s' from peer `%s' for hostlist.\n", | 209 | "Received %u bytes of `%s' from peer `%s' for hostlist.\n", |
214 | (unsigned int) s, "HELLO", GNUNET_i2s (peer)); | 210 | (unsigned int) s, "HELLO", GNUNET_i2s (peer)); |
215 | #endif | ||
216 | if ((old + s >= GNUNET_MAX_MALLOC_CHECKED) || | 211 | if ((old + s >= GNUNET_MAX_MALLOC_CHECKED) || |
217 | (old + s >= MAX_BYTES_PER_HOSTLISTS)) | 212 | (old + s >= MAX_BYTES_PER_HOSTLISTS)) |
218 | { | 213 | { |
@@ -222,11 +217,9 @@ host_processor (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
222 | s, GNUNET_NO); | 217 | s, GNUNET_NO); |
223 | return; /* too large, skip! */ | 218 | return; /* too large, skip! */ |
224 | } | 219 | } |
225 | #if DEBUG_HOSTLIST_SERVER | ||
226 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 220 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
227 | "Adding peer `%s' to hostlist (%u bytes)\n", GNUNET_i2s (peer), | 221 | "Adding peer `%s' to hostlist (%u bytes)\n", GNUNET_i2s (peer), |
228 | (unsigned int) s); | 222 | (unsigned int) s); |
229 | #endif | ||
230 | GNUNET_array_grow (results->data, results->size, old + s); | 223 | GNUNET_array_grow (results->data, results->size, old + s); |
231 | memcpy (&results->data[old], hello, s); | 224 | memcpy (&results->data[old], hello, s); |
232 | } | 225 | } |
@@ -242,10 +235,8 @@ accept_policy_callback (void *cls, const struct sockaddr *addr, | |||
242 | { | 235 | { |
243 | if (NULL == response) | 236 | if (NULL == response) |
244 | { | 237 | { |
245 | #if DEBUG_HOSTLIST_SERVER | ||
246 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 238 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
247 | "Received request for hostlist, but I am not yet ready; rejecting!\n"); | 239 | "Received request for hostlist, but I am not yet ready; rejecting!\n"); |
248 | #endif | ||
249 | return MHD_NO; | 240 | return MHD_NO; |
250 | } | 241 | } |
251 | return MHD_YES; /* accept all */ | 242 | return MHD_YES; /* accept all */ |
@@ -276,9 +267,7 @@ access_handler_callback (void *cls, struct MHD_Connection *connection, | |||
276 | if (NULL == *con_cls) | 267 | if (NULL == *con_cls) |
277 | { | 268 | { |
278 | (*con_cls) = &dummy; | 269 | (*con_cls) = &dummy; |
279 | #if DEBUG_HOSTLIST_SERVER | ||
280 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Sending 100 CONTINUE reply\n")); | 270 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Sending 100 CONTINUE reply\n")); |
281 | #endif | ||
282 | return MHD_YES; /* send 100 continue */ | 271 | return MHD_YES; /* send 100 continue */ |
283 | } | 272 | } |
284 | if (*upload_data_size != 0) | 273 | if (*upload_data_size != 0) |
@@ -426,10 +415,8 @@ process_notify (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
426 | { | 415 | { |
427 | struct HostSet *results; | 416 | struct HostSet *results; |
428 | 417 | ||
429 | #if DEBUG_HOSTLIST_SERVER | ||
430 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 418 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
431 | "Peerinfo is notifying us to rebuild our hostlist\n"); | 419 | "Peerinfo is notifying us to rebuild our hostlist\n"); |
432 | #endif | ||
433 | if (err_msg != NULL) | 420 | if (err_msg != NULL) |
434 | { | 421 | { |
435 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 422 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -521,7 +508,6 @@ prepare_daemon (struct MHD_Daemon *daemon_handle) | |||
521 | } | 508 | } |
522 | 509 | ||
523 | 510 | ||
524 | |||
525 | /** | 511 | /** |
526 | * Start server offering our hostlist. | 512 | * Start server offering our hostlist. |
527 | * | 513 | * |
@@ -639,11 +625,8 @@ GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c, | |||
639 | else | 625 | else |
640 | sa = NULL; | 626 | sa = NULL; |
641 | 627 | ||
642 | daemon_handle_v6 = MHD_start_daemon (MHD_USE_IPv6 | 628 | daemon_handle_v6 = MHD_start_daemon (MHD_USE_IPv6 | MHD_USE_DEBUG, |
643 | #if DEBUG_HOSTLIST_SERVER | 629 | (uint16_t) port, |
644 | | MHD_USE_DEBUG | ||
645 | #endif | ||
646 | , (unsigned short) port, | ||
647 | &accept_policy_callback, NULL, | 630 | &accept_policy_callback, NULL, |
648 | &access_handler_callback, NULL, | 631 | &access_handler_callback, NULL, |
649 | MHD_OPTION_CONNECTION_LIMIT, | 632 | MHD_OPTION_CONNECTION_LIMIT, |
@@ -657,11 +640,8 @@ GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c, | |||
657 | MHD_OPTION_SOCK_ADDR, | 640 | MHD_OPTION_SOCK_ADDR, |
658 | sa, | 641 | sa, |
659 | MHD_OPTION_END); | 642 | MHD_OPTION_END); |
660 | daemon_handle_v4 = MHD_start_daemon (MHD_NO_FLAG | 643 | daemon_handle_v4 = MHD_start_daemon (MHD_NO_FLAG | MHD_USE_DEBUG, |
661 | #if DEBUG_HOSTLIST_SERVER | 644 | (uint16_t) port, |
662 | | MHD_USE_DEBUG | ||
663 | #endif | ||
664 | , (unsigned short) port, | ||
665 | &accept_policy_callback, NULL, | 645 | &accept_policy_callback, NULL, |
666 | &access_handler_callback, NULL, | 646 | &access_handler_callback, NULL, |
667 | MHD_OPTION_CONNECTION_LIMIT, | 647 | MHD_OPTION_CONNECTION_LIMIT, |
@@ -685,10 +665,8 @@ GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c, | |||
685 | } | 665 | } |
686 | 666 | ||
687 | core = co; | 667 | core = co; |
688 | |||
689 | *server_ch = &connect_handler; | 668 | *server_ch = &connect_handler; |
690 | *server_dh = &disconnect_handler; | 669 | *server_dh = &disconnect_handler; |
691 | |||
692 | if (daemon_handle_v4 != NULL) | 670 | if (daemon_handle_v4 != NULL) |
693 | hostlist_task_v4 = prepare_daemon (daemon_handle_v4); | 671 | hostlist_task_v4 = prepare_daemon (daemon_handle_v4); |
694 | if (daemon_handle_v6 != NULL) | 672 | if (daemon_handle_v6 != NULL) |
@@ -699,15 +677,14 @@ GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c, | |||
699 | return GNUNET_OK; | 677 | return GNUNET_OK; |
700 | } | 678 | } |
701 | 679 | ||
680 | |||
702 | /** | 681 | /** |
703 | * Stop server offering our hostlist. | 682 | * Stop server offering our hostlist. |
704 | */ | 683 | */ |
705 | void | 684 | void |
706 | GNUNET_HOSTLIST_server_stop () | 685 | GNUNET_HOSTLIST_server_stop () |
707 | { | 686 | { |
708 | #if DEBUG_HOSTLIST_SERVER | ||
709 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hostlist server shutdown\n"); | 687 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hostlist server shutdown\n"); |
710 | #endif | ||
711 | if (NULL != notify) | 688 | if (NULL != notify) |
712 | { | 689 | { |
713 | GNUNET_PEERINFO_notify_cancel (notify); | 690 | GNUNET_PEERINFO_notify_cancel (notify); |