aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-11-28 08:59:25 +0000
committerChristian Grothoff <christian@grothoff.org>2013-11-28 08:59:25 +0000
commit5baf448f3639283acb66c7abcbd3118c751fbb8b (patch)
treefc0a76706a960997ebb4b68ad79e8164a99931fb /src
parent55942930db8ad9c07d1ee5878bdb414495743c7f (diff)
downloadgnunet-5baf448f3639283acb66c7abcbd3118c751fbb8b.tar.gz
gnunet-5baf448f3639283acb66c7abcbd3118c751fbb8b.zip
-fix #3141
Diffstat (limited to 'src')
-rw-r--r--src/fs/gnunet-service-fs_mesh_client.c26
1 files changed, 13 insertions, 13 deletions
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)
529 mh); 529 mh);
530 mh->waiting_map = GNUNET_CONTAINER_multihashmap_create (16, GNUNET_YES); 530 mh->waiting_map = GNUNET_CONTAINER_multihashmap_create (16, GNUNET_YES);
531 mh->target = *target; 531 mh->target = *target;
532 mh->channel = GNUNET_MESH_channel_create (mesh_handle,
533 mh,
534 &mh->target,
535 GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER,
536 GNUNET_NO,
537 GNUNET_YES);
538 GNUNET_assert (GNUNET_OK == 532 GNUNET_assert (GNUNET_OK ==
539 GNUNET_CONTAINER_multipeermap_put (mesh_map, 533 GNUNET_CONTAINER_multipeermap_put (mesh_map,
540 &mh->target, 534 &mh->target,
541 mh, 535 mh,
542 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); 536 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
537 mh->channel = GNUNET_MESH_channel_create (mesh_handle,
538 mh,
539 &mh->target,
540 GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER,
541 GNUNET_NO,
542 GNUNET_YES);
543 GNUNET_assert (mh ==
544 GNUNET_CONTAINER_multipeermap_get (mesh_map,
545 target));
543 return mh; 546 return mh;
544} 547}
545 548
@@ -599,7 +602,7 @@ GSF_mesh_query_cancel (struct GSF_MeshRequest *sr)
599 if (NULL != p) 602 if (NULL != p)
600 { 603 {
601 /* signal failure / cancellation to callback */ 604 /* signal failure / cancellation to callback */
602 p (sr->proc_cls, GNUNET_BLOCK_TYPE_ANY, 605 p (sr->proc_cls, GNUNET_BLOCK_TYPE_ANY,
603 GNUNET_TIME_UNIT_ZERO_ABS, 606 GNUNET_TIME_UNIT_ZERO_ABS,
604 0, NULL); 607 0, NULL);
605 } 608 }
@@ -649,7 +652,7 @@ free_waiting_entry (void *cls,
649 652
650/** 653/**
651 * Function called by mesh when a client disconnects. 654 * Function called by mesh when a client disconnects.
652 * Cleans up our 'struct MeshClient' of that channel. 655 * Cleans up our `struct MeshClient` of that channel.
653 * 656 *
654 * @param cls NULL 657 * @param cls NULL
655 * @param channel channel of the disconnecting client 658 * @param channel channel of the disconnecting client
@@ -722,15 +725,12 @@ release_meshs (void *cls,
722 void *value) 725 void *value)
723{ 726{
724 struct MeshHandle *mh = value; 727 struct MeshHandle *mh = value;
725 struct GNUNET_MESH_Channel *tun;
726 728
727 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 729 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
728 "Timeout on mesh channel to %s\n", 730 "Timeout on mesh channel to %s\n",
729 GNUNET_i2s (&mh->target)); 731 GNUNET_i2s (&mh->target));
730 tun = mh->channel; 732 if (NULL != mh->channel)
731 mh->channel = NULL; 733 GNUNET_MESH_channel_destroy (mh->channel);
732 if (NULL != tun)
733 GNUNET_MESH_channel_destroy (tun);
734 return GNUNET_YES; 734 return GNUNET_YES;
735} 735}
736 736