From becdd68b8a27a47545f707c49b21633b51fef569 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Tue, 26 Nov 2013 15:51:16 +0000 Subject: [PATCH] - allow for destruction of channel inside inbound handler --- src/mesh/mesh_api.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index 943b006ad..36d25b4e2 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c @@ -771,6 +771,8 @@ process_channel_created (struct GNUNET_MESH_Handle *h, } if (NULL != h->new_channel) { + void *ctx; + ch = create_channel (h, chid); ch->allow_send = GNUNET_NO; ch->peer = GNUNET_PEER_intern (&msg->peer); @@ -794,7 +796,9 @@ process_channel_created (struct GNUNET_MESH_Handle *h, ch->ooorder = GNUNET_NO; LOG (GNUNET_ERROR_TYPE_DEBUG, " created channel %p\n", ch); - ch->ctx = h->new_channel (h->cls, ch, &msg->peer, ch->port); + ctx = h->new_channel (h->cls, ch, &msg->peer, ch->port); + if (NULL != ctx) + ch->ctx = ctx; LOG (GNUNET_ERROR_TYPE_DEBUG, "User notified\n"); } else -- 2.25.1