diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-11-15 17:58:02 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-11-15 17:58:02 +0000 |
commit | 77543e3e5b852d80cd5a48bb52b0ccb662d5bd61 (patch) | |
tree | cb330cdcdc76bad801e2b9a3dbbcaed15c0c1f3a /src/topology | |
parent | 0c725262770a39908e6171b9a4d0c19917e1d7cf (diff) | |
download | gnunet-77543e3e5b852d80cd5a48bb52b0ccb662d5bd61.tar.gz gnunet-77543e3e5b852d80cd5a48bb52b0ccb662d5bd61.zip |
better shutdown, error message formatting fixed
Diffstat (limited to 'src/topology')
-rw-r--r-- | src/topology/gnunet-daemon-topology.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index be6f272be..d9f5e0ef2 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c | |||
@@ -624,6 +624,14 @@ process_peer (void *cls, | |||
624 | if (peer == NULL) | 624 | if (peer == NULL) |
625 | { | 625 | { |
626 | /* last call, schedule 'find_more_peers' again... */ | 626 | /* last call, schedule 'find_more_peers' again... */ |
627 | if (0 != (GNUNET_SCHEDULER_get_reason (sched) & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | ||
628 | { | ||
629 | #if DEBUG_TOPOLOGY | ||
630 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
631 | "Received shutdown request, stopping search for peers to connect to.\n"); | ||
632 | #endif | ||
633 | return; | ||
634 | } | ||
627 | schedule_peer_search (); | 635 | schedule_peer_search (); |
628 | return; | 636 | return; |
629 | } | 637 | } |
@@ -759,6 +767,14 @@ static void | |||
759 | find_more_peers (void *cls, | 767 | find_more_peers (void *cls, |
760 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 768 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
761 | { | 769 | { |
770 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | ||
771 | { | ||
772 | #if DEBUG_TOPOLOGY | ||
773 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
774 | "Received shutdown request, stopping search for peers to connect to.\n"); | ||
775 | #endif | ||
776 | return; | ||
777 | } | ||
762 | discard_old_blacklist_entries (); | 778 | discard_old_blacklist_entries (); |
763 | if (connection_count <= target_connection_count) | 779 | if (connection_count <= target_connection_count) |
764 | { | 780 | { |
@@ -816,7 +832,7 @@ core_init (void *cls, | |||
816 | my_identity = *my_id; | 832 | my_identity = *my_id; |
817 | #if DEBUG_TOPOLOGY | 833 | #if DEBUG_TOPOLOGY |
818 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 834 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
819 | "I am peer `%s'", | 835 | "I am peer `%s'\n", |
820 | GNUNET_i2s (my_id)); | 836 | GNUNET_i2s (my_id)); |
821 | #endif | 837 | #endif |
822 | if (autoconnect) | 838 | if (autoconnect) |