From: Christian Grothoff Date: Thu, 28 Nov 2013 08:59:25 +0000 (+0000) Subject: -fix #3141 X-Git-Tag: initial-import-from-subversion-38251~5902 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5baf448f3639283acb66c7abcbd3118c751fbb8b;p=oweals%2Fgnunet.git -fix #3141 --- diff --git a/src/fs/gnunet-service-fs_mesh_client.c b/src/fs/gnunet-service-fs_mesh_client.c index 57eb34d04..3da3a937f 100644 --- a/src/fs/gnunet-service-fs_mesh_client.c +++ b/src/fs/gnunet-service-fs_mesh_client.c @@ -529,17 +529,20 @@ get_mesh (const struct GNUNET_PeerIdentity *target) mh); mh->waiting_map = GNUNET_CONTAINER_multihashmap_create (16, GNUNET_YES); mh->target = *target; - mh->channel = GNUNET_MESH_channel_create (mesh_handle, - mh, - &mh->target, - GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER, - GNUNET_NO, - GNUNET_YES); GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multipeermap_put (mesh_map, &mh->target, mh, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); + mh->channel = GNUNET_MESH_channel_create (mesh_handle, + mh, + &mh->target, + GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER, + GNUNET_NO, + GNUNET_YES); + GNUNET_assert (mh == + GNUNET_CONTAINER_multipeermap_get (mesh_map, + target)); return mh; } @@ -599,7 +602,7 @@ GSF_mesh_query_cancel (struct GSF_MeshRequest *sr) if (NULL != p) { /* signal failure / cancellation to callback */ - p (sr->proc_cls, GNUNET_BLOCK_TYPE_ANY, + p (sr->proc_cls, GNUNET_BLOCK_TYPE_ANY, GNUNET_TIME_UNIT_ZERO_ABS, 0, NULL); } @@ -649,7 +652,7 @@ free_waiting_entry (void *cls, /** * Function called by mesh when a client disconnects. - * Cleans up our 'struct MeshClient' of that channel. + * Cleans up our `struct MeshClient` of that channel. * * @param cls NULL * @param channel channel of the disconnecting client @@ -722,15 +725,12 @@ release_meshs (void *cls, void *value) { struct MeshHandle *mh = value; - struct GNUNET_MESH_Channel *tun; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Timeout on mesh channel to %s\n", GNUNET_i2s (&mh->target)); - tun = mh->channel; - mh->channel = NULL; - if (NULL != tun) - GNUNET_MESH_channel_destroy (tun); + if (NULL != mh->channel) + GNUNET_MESH_channel_destroy (mh->channel); return GNUNET_YES; }