From: Christian Grothoff Date: Fri, 24 Feb 2017 12:25:56 +0000 (+0100) Subject: update counters properly X-Git-Tag: taler-0.2.1~70^2~8 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0f67fd7bc65b07feceff790fb18e7e8a0aaeac69;p=oweals%2Fgnunet.git update counters properly --- diff --git a/src/cadet/gnunet-service-cadet-new_tunnels.c b/src/cadet/gnunet-service-cadet-new_tunnels.c index af77ea067..05a1e071d 100644 --- a/src/cadet/gnunet-service-cadet-new_tunnels.c +++ b/src/cadet/gnunet-service-cadet-new_tunnels.c @@ -603,6 +603,7 @@ GCT_count_any_connections (const struct CadetTunnel *t) static struct CadetTConnection * get_ready_connection (struct CadetTunnel *t) { + GNUNET_assert (GNUNET_YES == t->connection_ready_head->is_ready); return t->connection_ready_head; } @@ -1971,13 +1972,19 @@ GCT_connection_lost (struct CadetTConnection *ct) struct CadetTunnel *t = ct->t; if (GNUNET_YES == ct->is_ready) + { GNUNET_CONTAINER_DLL_remove (t->connection_ready_head, t->connection_ready_tail, ct); + t->num_ready_connections--; + } else + { GNUNET_CONTAINER_DLL_remove (t->connection_busy_head, t->connection_busy_tail, ct); + t->num_busy_connections--; + } GNUNET_free (ct); } diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 3952a728e..bbda715a2 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c @@ -1150,17 +1150,18 @@ set_incoming_quota (struct NeighbourMapEntry *n, sqm.header.size = htons (sizeof (struct GNUNET_ATS_SessionQuotaMessage)); sqm.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_QUOTA); sqm.quota = quota.value__; - (void) send_with_session (n, - &sqm, - sizeof (sqm), - UINT32_MAX - 1, - GNUNET_TIME_UNIT_FOREVER_REL, - GNUNET_NO, - NULL, NULL); + if (NULL != n->primary_address.session) + (void) send_with_session (n, + &sqm, + sizeof (sqm), + UINT32_MAX - 1, + GNUNET_TIME_UNIT_FOREVER_REL, + GNUNET_NO, + NULL, NULL); return; } GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Disconnecting peer `%4s' due to SET_QUOTA\n", + "Disconnecting peer `%s' due to SET_QUOTA\n", GNUNET_i2s (&n->id)); if (GNUNET_YES == test_connected (n)) GNUNET_STATISTICS_update (GST_stats,