- add peer's tunnel setter
authorBart Polot <bart@net.in.tum.de>
Tue, 8 Oct 2013 13:57:02 +0000 (13:57 +0000)
committerBart Polot <bart@net.in.tum.de>
Tue, 8 Oct 2013 13:57:02 +0000 (13:57 +0000)
src/mesh/gnunet-service-mesh_peer.c
src/mesh/gnunet-service-mesh_peer.h
src/mesh/gnunet-service-mesh_tunnel.c

index dd60cab77d9b72ac37dc9396c7eb8ffd2f225627..008ba5a5192661e9eb690bba5f7db47478f7480a 100644 (file)
@@ -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.
  *
index ec52c47767426433bf33bb38f0c54a4eee987f33..821daadff3b15ae295346a722463687ee826cd72 100644 (file)
@@ -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.
  *
index 83f0d1f680e4d8278cac126b6e29e07803b9b106..0c4e163e5add936e9d57541fd4410c334a74de5d 100644 (file)
@@ -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);
 }