if (NULL == t)
return GNUNET_OK;
+ r = GNUNET_OK;
c = t->client;
#if MESH_DEBUG
{
{
r = GNUNET_SYSERR;
}
-
+
GNUNET_CRYPTO_hash (&t->local_tid, sizeof (MESH_TunnelNumber), &hash);
if (NULL != c &&
GNUNET_YES != GNUNET_CONTAINER_multihashmap_remove (c->tunnels, &hash, t))
{
r = GNUNET_SYSERR;
}
+ c = t->client_dest;
+ GNUNET_CRYPTO_hash (&t->local_tid_dest, sizeof (MESH_TunnelNumber), &hash);
+ if (NULL != c &&
+ GNUNET_YES != GNUNET_CONTAINER_multihashmap_remove (c->tunnels, &hash, t))
+ {
+ r = GNUNET_SYSERR;
+ }
if (t->local_tid >= GNUNET_MESH_LOCAL_TUNNEL_ID_SERV)
{
GNUNET_CRYPTO_hash (&t->local_tid, sizeof (MESH_TunnelNumber), &hash);
send_client_tunnel_disconnect(t, c);
if (c == t->client_dest)
{
+#if MESH_DEBUG
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Client %u is destination, keeping the tunnel alive.\n", c->id);
+#endif
t->client_dest = NULL;
t->local_tid_dest = 0;
return GNUNET_OK;
struct MeshClient *c;
struct MeshClient *next;
+#if MESH_DEBUG
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: client disconnected\n");
+#endif
if (client == NULL)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: (SERVER DOWN)\n");
{
if (c->handle != client)
{
+#if MESH_DEBUG
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: ... searching\n");
+#endif
c = c->next;
continue;
}
GNUNET_CONTAINER_multihashmap_destroy (c->types);
next = c->next;
GNUNET_CONTAINER_DLL_remove (clients, clients_tail, c);
+#if MESH_DEBUG
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: CLIENT FREE at %p\n", c);
+#endif
GNUNET_free (c);
c = next;
}
+#if MESH_DEBUG
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: done!\n");
+#endif
return;
}