summaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_cadet_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-service-fs_cadet_client.c')
-rw-r--r--src/fs/gnunet-service-fs_cadet_client.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/fs/gnunet-service-fs_cadet_client.c b/src/fs/gnunet-service-fs_cadet_client.c
index dde7aba48..aa2c0c426 100644
--- a/src/fs/gnunet-service-fs_cadet_client.c
+++ b/src/fs/gnunet-service-fs_cadet_client.c
@@ -219,8 +219,17 @@ reset_cadet (struct CadetHandle *mh)
"Resetting cadet channel to %s\n",
GNUNET_i2s (&mh->target));
mh->channel = NULL;
+
if (NULL != channel)
+ {
+ /* Avoid loop */
+ if ( NULL != mh->wh)
+ {
+ GNUNET_CADET_cancel_notify(mh->wh);
+ mh->wh = NULL;
+ }
GNUNET_CADET_channel_destroy (channel);
+ }
GNUNET_CONTAINER_multihashmap_iterate (mh->waiting_map,
&move_to_pending,
mh);