[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r17494 - gnunet/src/mesh
From: |
gnunet |
Subject: |
[GNUnet-SVN] r17494 - gnunet/src/mesh |
Date: |
Fri, 14 Oct 2011 13:38:40 +0200 |
Author: bartpolot
Date: 2011-10-14 13:38:40 +0200 (Fri, 14 Oct 2011)
New Revision: 17494
Modified:
gnunet/src/mesh/gnunet-service-mesh.c
Log:
Removed unnecessary hashmap actions
Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c 2011-10-14 11:29:21 UTC (rev
17493)
+++ gnunet/src/mesh/gnunet-service-mesh.c 2011-10-14 11:38:40 UTC (rev
17494)
@@ -255,6 +255,7 @@
/**
* Peers in the tunnel, indexed by PeerIdentity -> (MeshPeerInfo)
+ * containing peers added by id or by type, not intermediate peers.
*/
struct GNUNET_CONTAINER_MultiHashMap *peers;
@@ -1608,7 +1609,8 @@
}
GNUNET_CRYPTO_hash (&t->local_tid, sizeof (MESH_TunnelNumber), &hash);
- if (NULL != c && GNUNET_YES != GNUNET_CONTAINER_multihashmap_remove
(c->tunnels, &hash, t))
+ if (NULL != c &&
+ GNUNET_YES != GNUNET_CONTAINER_multihashmap_remove (c->tunnels, &hash,
t))
{
r = GNUNET_SYSERR;
}
@@ -1619,8 +1621,12 @@
GNUNET_CONTAINER_multihashmap_remove (incoming_tunnels, &hash, t));
}
- GNUNET_CONTAINER_multihashmap_iterate(t->peers, &peer_info_delete_tunnel, t);
- GNUNET_CONTAINER_multihashmap_destroy (t->peers);
+ if (NULL != t->peers)
+ {
+ GNUNET_CONTAINER_multihashmap_iterate(t->peers,
+ &peer_info_delete_tunnel, t);
+ GNUNET_CONTAINER_multihashmap_destroy (t->peers);
+ }
q = t->queue_head;
while (NULL != q)
{
@@ -2022,7 +2028,6 @@
t = GNUNET_malloc (sizeof (struct MeshTunnel));
t->id.oid = GNUNET_PEER_intern (pi);
t->id.tid = tid;
- t->peers = GNUNET_CONTAINER_multihashmap_create (32);
t->local_tid = next_local_tid++;
/* FIXME test if taken */
next_local_tid |= GNUNET_MESH_LOCAL_TUNNEL_ID_SERV;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r17494 - gnunet/src/mesh,
gnunet <=