diff options
-rw-r--r-- | src/cadet/cadet_api.c | 7 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_cadet_client.c | 9 | ||||
-rw-r--r-- | src/include/gnunet_cadet_service.h | 12 |
3 files changed, 28 insertions, 0 deletions
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c index c65475b10..5cb42286e 100644 --- a/src/cadet/cadet_api.c +++ b/src/cadet/cadet_api.c | |||
@@ -1758,6 +1758,13 @@ GNUNET_CADET_notify_transmit_ready (struct GNUNET_CADET_Channel *channel, int co | |||
1758 | 1758 | ||
1759 | 1759 | ||
1760 | void | 1760 | void |
1761 | GNUNET_CADET_cancel_notify (struct GNUNET_CADET_TransmitHandle *th) | ||
1762 | { | ||
1763 | th->notify = NULL; | ||
1764 | } | ||
1765 | |||
1766 | |||
1767 | void | ||
1761 | GNUNET_CADET_notify_transmit_ready_cancel (struct GNUNET_CADET_TransmitHandle *th) | 1768 | GNUNET_CADET_notify_transmit_ready_cancel (struct GNUNET_CADET_TransmitHandle *th) |
1762 | { | 1769 | { |
1763 | struct GNUNET_CADET_Handle *cadet; | 1770 | struct GNUNET_CADET_Handle *cadet; |
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) | |||
219 | "Resetting cadet channel to %s\n", | 219 | "Resetting cadet channel to %s\n", |
220 | GNUNET_i2s (&mh->target)); | 220 | GNUNET_i2s (&mh->target)); |
221 | mh->channel = NULL; | 221 | mh->channel = NULL; |
222 | |||
222 | if (NULL != channel) | 223 | if (NULL != channel) |
224 | { | ||
225 | /* Avoid loop */ | ||
226 | if ( NULL != mh->wh) | ||
227 | { | ||
228 | GNUNET_CADET_cancel_notify(mh->wh); | ||
229 | mh->wh = NULL; | ||
230 | } | ||
223 | GNUNET_CADET_channel_destroy (channel); | 231 | GNUNET_CADET_channel_destroy (channel); |
232 | } | ||
224 | GNUNET_CONTAINER_multihashmap_iterate (mh->waiting_map, | 233 | GNUNET_CONTAINER_multihashmap_iterate (mh->waiting_map, |
225 | &move_to_pending, | 234 | &move_to_pending, |
226 | mh); | 235 | mh); |
diff --git a/src/include/gnunet_cadet_service.h b/src/include/gnunet_cadet_service.h index 14826c40b..a4ac42eb8 100644 --- a/src/include/gnunet_cadet_service.h +++ b/src/include/gnunet_cadet_service.h | |||
@@ -348,6 +348,18 @@ void | |||
348 | GNUNET_CADET_notify_transmit_ready_cancel (struct GNUNET_CADET_TransmitHandle | 348 | GNUNET_CADET_notify_transmit_ready_cancel (struct GNUNET_CADET_TransmitHandle |
349 | *th); | 349 | *th); |
350 | 350 | ||
351 | |||
352 | /** | ||
353 | * Cancel only the notify without cleaning the structs to a futher call to channel destroy | ||
354 | * | ||
355 | * @param th handle that was returned by "notify_transmit_ready". | ||
356 | */ | ||
357 | void | ||
358 | GNUNET_CADET_cancel_notify (struct GNUNET_CADET_TransmitHandle | ||
359 | *th); | ||
360 | |||
361 | |||
362 | |||
351 | 363 | ||
352 | /** | 364 | /** |
353 | * Indicate readiness to receive the next message on a channel. | 365 | * Indicate readiness to receive the next message on a channel. |