struct GNUNET_MESH_Encrypted *emsg;
struct GNUNET_MESH_ACK *amsg;
struct GNUNET_MESH_Poll *pmsg;
+ struct GNUNET_MESH_ConnectionDestroy *dmsg;
uint32_t ttl;
case GNUNET_MESSAGE_TYPE_MESH_FWD:
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " poll %u\n", ntohl (pmsg->pid));
break;
+ case GNUNET_MESSAGE_TYPE_MESH_TUNNEL_DESTROY:
+ dmsg = (struct GNUNET_MESH_ConnectionDestroy *) data;
+ dmsg->cid = c->id;
+ dmsg->reserved = 0;
+ break;
+
default:
GNUNET_break (0);
}
if (channel_is_terminal (ch, GNUNET_NO))
{
- if (NULL != ch->root)
+ if (NULL != ch->root && GNUNET_NO == ch->root->shutting_down)
{
msg.chid = htonl (ch->lid_root);
send_local_channel_destroy (ch, GNUNET_NO);
if (channel_is_terminal (ch, GNUNET_YES))
{
- if (NULL != ch->dest)
+ if (NULL != ch->dest && GNUNET_NO == ch->dest->shutting_down)
{
msg.chid = htonl (ch->lid_dest);
send_local_channel_destroy (ch, GNUNET_YES);
if (c == ch->dest)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Client %u is destination.\n", c->id);
- ch->dest = NULL;
}
if (c == ch->root)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Client %u is owner.\n", c->id);
- ch->root = NULL;
}
t = ch->t;