From 2ac8943f5d703fcf886b16fbf2eb6be3fedb746f Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Mon, 10 Oct 2011 11:42:21 +0000 Subject: [PATCH] fixed notification order --- src/transport/gnunet-service-transport_neighbours.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index e16a71249..0957a0ce1 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c @@ -737,10 +737,15 @@ try_connect_using_address (void *cls, const struct GNUNET_PeerIdentity *target, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting inbound quota of %u for peer `%s' to \n", ntohl (bandwidth_in), GNUNET_i2s (target)); #endif + GST_neighbours_set_incoming_quota (&n->id, bandwidth_in); + /* First tell clients about connected neighbours...*/ + neighbours_connected++; + GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# peers connected"), 1, + GNUNET_NO); + connect_notify_cb (callback_cls, target, n->ats, n->ats_count); - GST_neighbours_set_incoming_quota (&n->id, bandwidth_in); - /* ATS told us outbound quota for this peer, tell all clients */ + /* ... then send outbound quota for this peer to all clients */ #if DEBUG_TRANSPORT GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending outbound quota of %u Bps for peer `%s' to all clients\n", ntohl (bandwidth_out), GNUNET_i2s (target)); @@ -753,10 +758,6 @@ try_connect_using_address (void *cls, const struct GNUNET_PeerIdentity *target, msg.peer = (*target); GST_clients_broadcast ((struct GNUNET_MessageHeader *) &msg, GNUNET_NO); - neighbours_connected++; - GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# peers connected"), 1, - GNUNET_NO); - connect_notify_cb (callback_cls, target, n->ats, n->ats_count); } -- 2.25.1