From db5ac80bb8bdb4a569d1ee19ca527ec4b095557b Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 22 Jul 2013 13:02:59 +0000 Subject: [PATCH] - allow same owner && client --- src/mesh/gnunet-service-mesh.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index fe266c308..d1b6e7016 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -5038,7 +5038,7 @@ handle_local_tunnel_destroy (void *cls, struct GNUNET_SERVER_Client *client, /* Retrieve tunnel */ tid = ntohl (tunnel_msg->tunnel_id); - t = tunnel_get_by_local_id(c, tid); + t = tunnel_get_by_local_id (c, tid); if (NULL == t) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, " tunnel %X not found\n", tid); @@ -5049,15 +5049,22 @@ handle_local_tunnel_destroy (void *cls, struct GNUNET_SERVER_Client *client, /* Cleanup after the tunnel */ client_delete_tunnel (c, t); - if (c == t->client) + if (c == t->client && GNUNET_MESH_LOCAL_TUNNEL_ID_SERV >= tid) { t->client = NULL; } - if (c == t->owner) + else if (c == t->owner && GNUNET_MESH_LOCAL_TUNNEL_ID_SERV < tid) { peer_info_remove_tunnel (peer_get_short (t->dest), t); t->owner = NULL; } + else + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + " tunnel %X client %p (%p, %p)\n", + tid, c, t->owner, t->client); + GNUNET_break (0); + } /* The tunnel will be destroyed when the last message is transmitted. */ tunnel_destroy_empty (t); -- 2.25.1