From: Bart Polot Date: Tue, 26 Nov 2013 15:51:16 +0000 (+0000) Subject: - allow for destruction of channel inside inbound handler X-Git-Tag: initial-import-from-subversion-38251~5947 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=becdd68b8a27a47545f707c49b21633b51fef569;p=oweals%2Fgnunet.git - allow for destruction of channel inside inbound handler --- 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