From: Bart Polot Date: Thu, 14 Feb 2013 00:38:11 +0000 (+0000) Subject: - not needed size of t->peers should suffice X-Git-Tag: initial-import-from-subversion-38251~9948 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bb86330651d56cfcc117be79f662a2c70009e9b1;p=oweals%2Fgnunet.git - not needed size of t->peers should suffice --- diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 15e002b46..2525793af 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -440,10 +440,10 @@ struct MeshTunnel */ uint32_t last_fwd_ack; - /** - * BCK ACK value received from the hop towards the owner of the tunnel, - * (previous node / owner): up to what message PID can we sent back to him. - */ + /** + * BCK ACK value received from the hop towards the owner of the tunnel, + * (previous node / owner): up to what message PID can we sent back to him. + */ uint32_t bck_ack; /** @@ -487,11 +487,6 @@ struct MeshTunnel */ unsigned int peers_ready; - /** - * Number of peers that have been added to the tunnel - */ - unsigned int peers_total; - /** * Client owner of the tunnel, if any */ @@ -3035,7 +3030,6 @@ tunnel_add_peer (struct MeshTunnel *t, struct MeshPeerInfo *peer) if (GNUNET_NO == GNUNET_CONTAINER_multihashmap_contains (t->peers, &id.hashPubKey)) { - t->peers_total++; GNUNET_array_append (peer->tunnels, peer->ntunnels, t); GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put (t->peers, &id.hashPubKey, @@ -7915,8 +7909,7 @@ handle_local_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client, *resp = *msg; resp->npeers = 0; ctx.msg = resp; - ctx.lookup = GNUNET_CONTAINER_multihashmap_create (4 * t->peers_total, - GNUNET_YES); + ctx.lookup = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_YES); ctx.c = c; /* Collect and send information */