diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-04-24 11:49:57 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-04-24 11:49:57 +0000 |
commit | 871ad1c71484dd7dccfdbfc758394f5ce2791723 (patch) | |
tree | 5b0ce0fb3e35457e2bd225918a80ba19600212fe /src/topology | |
parent | 5e1e1cd83d20f870a6b7734268fab2d3bb6d509b (diff) | |
download | gnunet-871ad1c71484dd7dccfdbfc758394f5ce2791723.tar.gz gnunet-871ad1c71484dd7dccfdbfc758394f5ce2791723.zip |
-trying to fix assertion from freebsd buildbot
Diffstat (limited to 'src/topology')
-rw-r--r-- | src/topology/gnunet-daemon-topology.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index d09de78ed..e7860ac94 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c | |||
@@ -305,6 +305,7 @@ free_peer (void *cls, const GNUNET_HashCode * pid, void *value) | |||
305 | { | 305 | { |
306 | struct Peer *pos = value; | 306 | struct Peer *pos = value; |
307 | 307 | ||
308 | GNUNET_break (GNUNET_NO == pos->is_connected); | ||
308 | GNUNET_break (GNUNET_OK == | 309 | GNUNET_break (GNUNET_OK == |
309 | GNUNET_CONTAINER_multihashmap_remove (peers, pid, pos)); | 310 | GNUNET_CONTAINER_multihashmap_remove (peers, pid, pos)); |
310 | if (pos->hello_req != NULL) | 311 | if (pos->hello_req != NULL) |
@@ -646,7 +647,7 @@ connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
646 | GNUNET_STATISTICS_set (stats, gettext_noop ("# peers connected"), | 647 | GNUNET_STATISTICS_set (stats, gettext_noop ("# peers connected"), |
647 | connection_count, GNUNET_NO); | 648 | connection_count, GNUNET_NO); |
648 | pos = GNUNET_CONTAINER_multihashmap_get (peers, &peer->hashPubKey); | 649 | pos = GNUNET_CONTAINER_multihashmap_get (peers, &peer->hashPubKey); |
649 | if (pos == NULL) | 650 | if (NULL == pos) |
650 | { | 651 | { |
651 | pos = make_peer (peer, NULL, GNUNET_NO); | 652 | pos = make_peer (peer, NULL, GNUNET_NO); |
652 | GNUNET_break (GNUNET_OK == is_connection_allowed (pos)); | 653 | GNUNET_break (GNUNET_OK == is_connection_allowed (pos)); |
@@ -721,7 +722,7 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
721 | "Core told us that we disconnected from `%s'\n", | 722 | "Core told us that we disconnected from `%s'\n", |
722 | GNUNET_i2s (peer)); | 723 | GNUNET_i2s (peer)); |
723 | pos = GNUNET_CONTAINER_multihashmap_get (peers, &peer->hashPubKey); | 724 | pos = GNUNET_CONTAINER_multihashmap_get (peers, &peer->hashPubKey); |
724 | if (pos == NULL) | 725 | if (NULL == pos) |
725 | { | 726 | { |
726 | GNUNET_break (0); | 727 | GNUNET_break (0); |
727 | return; | 728 | return; |
@@ -808,7 +809,7 @@ consider_for_advertising (const struct GNUNET_HELLO_Message *hello) | |||
808 | if (GNUNET_NO == have_address) | 809 | if (GNUNET_NO == have_address) |
809 | return; /* no point in advertising this one... */ | 810 | return; /* no point in advertising this one... */ |
810 | peer = GNUNET_CONTAINER_multihashmap_get (peers, &pid.hashPubKey); | 811 | peer = GNUNET_CONTAINER_multihashmap_get (peers, &pid.hashPubKey); |
811 | if (peer == NULL) | 812 | if (NULL == peer) |
812 | { | 813 | { |
813 | peer = make_peer (&pid, hello, GNUNET_NO); | 814 | peer = make_peer (&pid, hello, GNUNET_NO); |
814 | } | 815 | } |
@@ -882,7 +883,7 @@ process_peer (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
882 | GNUNET_CONTAINER_bloomfilter_free (pos->filter); | 883 | GNUNET_CONTAINER_bloomfilter_free (pos->filter); |
883 | pos->filter = NULL; | 884 | pos->filter = NULL; |
884 | } | 885 | } |
885 | if ((!pos->is_connected) && (!pos->is_friend) && | 886 | if ((GNUNET_NO == pos->is_connected) && (GNUNET_NO == pos->is_friend) && |
886 | (0 == | 887 | (0 == |
887 | GNUNET_TIME_absolute_get_remaining (pos-> | 888 | GNUNET_TIME_absolute_get_remaining (pos-> |
888 | greylisted_until).rel_value)) | 889 | greylisted_until).rel_value)) |
@@ -1105,7 +1106,7 @@ handle_encrypted_hello (void *cls, const struct GNUNET_PeerIdentity *other, | |||
1105 | GNUNET_STATISTICS_update (stats, gettext_noop ("# HELLO messages received"), | 1106 | GNUNET_STATISTICS_update (stats, gettext_noop ("# HELLO messages received"), |
1106 | 1, GNUNET_NO); | 1107 | 1, GNUNET_NO); |
1107 | peer = GNUNET_CONTAINER_multihashmap_get (peers, &pid.hashPubKey); | 1108 | peer = GNUNET_CONTAINER_multihashmap_get (peers, &pid.hashPubKey); |
1108 | if (peer == NULL) | 1109 | if (NULL == peer) |
1109 | { | 1110 | { |
1110 | if ((GNUNET_YES == friends_only) || (friend_count < minimum_friend_count)) | 1111 | if ((GNUNET_YES == friends_only) || (friend_count < minimum_friend_count)) |
1111 | return GNUNET_OK; | 1112 | return GNUNET_OK; |
@@ -1192,14 +1193,15 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1192 | } | 1193 | } |
1193 | GNUNET_TRANSPORT_disconnect (transport); | 1194 | GNUNET_TRANSPORT_disconnect (transport); |
1194 | transport = NULL; | 1195 | transport = NULL; |
1195 | GNUNET_CONTAINER_multihashmap_iterate (peers, &free_peer, NULL); | ||
1196 | GNUNET_CONTAINER_multihashmap_destroy (peers); | ||
1197 | if (handle != NULL) | 1196 | if (handle != NULL) |
1198 | { | 1197 | { |
1199 | GNUNET_CORE_disconnect (handle); | 1198 | GNUNET_CORE_disconnect (handle); |
1200 | handle = NULL; | 1199 | handle = NULL; |
1201 | } | 1200 | } |
1202 | whitelist_peers (); | 1201 | whitelist_peers (); |
1202 | GNUNET_CONTAINER_multihashmap_iterate (peers, &free_peer, NULL); | ||
1203 | GNUNET_CONTAINER_multihashmap_destroy (peers); | ||
1204 | peers = NULL; | ||
1203 | if (stats != NULL) | 1205 | if (stats != NULL) |
1204 | { | 1206 | { |
1205 | GNUNET_STATISTICS_destroy (stats, GNUNET_NO); | 1207 | GNUNET_STATISTICS_destroy (stats, GNUNET_NO); |