From: Bart Polot Date: Tue, 8 Oct 2013 13:57:02 +0000 (+0000) Subject: - add peer's tunnel setter X-Git-Tag: initial-import-from-subversion-38251~6704 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b8cfe698546bd64e4e8a062cf923cf5351f2a49a;p=oweals%2Fgnunet.git - add peer's tunnel setter --- diff --git a/src/mesh/gnunet-service-mesh_peer.c b/src/mesh/gnunet-service-mesh_peer.c index dd60cab77..008ba5a51 100644 --- a/src/mesh/gnunet-service-mesh_peer.c +++ b/src/mesh/gnunet-service-mesh_peer.c @@ -1469,6 +1469,19 @@ GMP_connect (struct MeshPeer *peer) } +/** + * Set tunnel. + * + * @param peer Peer. + * @param t Tunnel. + */ +void +GMP_set_tunnel (struct MeshPeer *peer, struct MeshTunnel2 *t) +{ + peer->tunnel = t; +} + + /** * Chech whether there is a direct (core level) connection to peer. * diff --git a/src/mesh/gnunet-service-mesh_peer.h b/src/mesh/gnunet-service-mesh_peer.h index ec52c4776..821daadff 100644 --- a/src/mesh/gnunet-service-mesh_peer.h +++ b/src/mesh/gnunet-service-mesh_peer.h @@ -91,6 +91,15 @@ GMP_queue_add (void *cls, uint16_t type, size_t size, void GMP_queue_destroy (struct MeshPeerQueue *queue, int clear_cls); +/** + * Set tunnel. + * + * @param peer Peer. + * @param t Tunnel. + */ +void +GMP_set_tunnel (struct MeshPeer *peer, struct MeshTunnel2 *t); + /** * Chech whether there is a direct (core level) connection to peer. * diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c index 83f0d1f68..0c4e163e5 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.c +++ b/src/mesh/gnunet-service-mesh_tunnel.c @@ -591,7 +591,7 @@ GMT_destroy (struct MeshTunnel2 *t) } GNUNET_STATISTICS_update (stats, "# tunnels", -1, GNUNET_NO); - t->peer->tunnel = NULL; + GMP_set_tunnel (t->peer, NULL); GNUNET_free (t); }