From 17c67202c45d98da06baa3739c82e20dcd045d05 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Fri, 18 Oct 2013 07:32:47 +0000 Subject: [PATCH] - fix assertion in scheduling - formatting --- src/transport/gnunet-service-transport.c | 29 ++++++++++--------- .../gnunet-service-transport_neighbours.c | 2 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 8f830bd9c..749f94503 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -461,22 +461,25 @@ GST_ats_update_metrics (const struct GNUNET_PeerIdentity *peer, struct GNUNET_ATS_Information *ats_new; if (GNUNET_NO == GNUNET_ATS_session_known (GST_ats, address, session)) - return; + return; - /* Call to manipulation to manipulate ATS information */ - ats_new = GST_manipulation_manipulate_metrics (peer, address, session, ats, ats_count); - if (NULL == ats_new) - { - GNUNET_break (0); - return; - } - if (GNUNET_NO == GNUNET_ATS_address_update (GST_ats, address, session, ats_new, ats_count)) + /* Call to manipulation to manipulate ATS information */ + ats_new = GST_manipulation_manipulate_metrics (peer, address, session, ats, + ats_count); + if (NULL == ats_new) + { + GNUNET_break(0); + return; + } + if (GNUNET_NO == GNUNET_ATS_address_update (GST_ats, + address, session, ats_new, ats_count)) { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - _("Address or session unknown: failed to update properties for peer `%s' plugin `%s' address `%s' session %p\n"), - GNUNET_i2s (peer), address->transport_name, GST_plugins_a2s (address), session); + GNUNET_log(GNUNET_ERROR_TYPE_ERROR, + _("Address or session unknown: failed to update properties for peer `%s' plugin `%s' address `%s' session %p\n"), + GNUNET_i2s (peer), address->transport_name, GST_plugins_a2s (address), + session); } - GNUNET_free (ats_new); + GNUNET_free(ats_new); } diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index c10d6ccfd..dd598859f 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c @@ -2567,7 +2567,7 @@ util_it (void *cls, atsi[0].value = htonl (bps_out); atsi[1].type = htonl (GNUNET_ATS_UTILIZATION_DOWN); atsi[1].value = htonl (bps_in); - GNUNET_ATS_address_update (GST_ats, n->primary_address.address, + GST_ats_update_metrics (key, n->primary_address.address, n->primary_address.session, atsi, 2); n->util_bytes_recv = 0; n->util_bytes_sent = 0; -- 2.25.1