diff options
Diffstat (limited to 'src/fs/gnunet-service-fs_cadet_client.c')
-rw-r--r-- | src/fs/gnunet-service-fs_cadet_client.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/fs/gnunet-service-fs_cadet_client.c b/src/fs/gnunet-service-fs_cadet_client.c index 61f73a50a..9ba250dfa 100644 --- a/src/fs/gnunet-service-fs_cadet_client.c +++ b/src/fs/gnunet-service-fs_cadet_client.c | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -469,8 +469,11 @@ reset_cadet (struct CadetHandle *mh) | |||
469 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 469 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
470 | "Resetting cadet channel to %s\n", | 470 | "Resetting cadet channel to %s\n", |
471 | GNUNET_i2s (&mh->target)); | 471 | GNUNET_i2s (&mh->target)); |
472 | GNUNET_CADET_channel_destroy (mh->channel); | 472 | if (NULL != mh->channel) |
473 | mh->channel = NULL; | 473 | { |
474 | GNUNET_CADET_channel_destroy (mh->channel); | ||
475 | mh->channel = NULL; | ||
476 | } | ||
474 | GNUNET_CONTAINER_multihashmap_iterate (mh->waiting_map, | 477 | GNUNET_CONTAINER_multihashmap_iterate (mh->waiting_map, |
475 | &move_to_pending, | 478 | &move_to_pending, |
476 | mh); | 479 | mh); |
@@ -741,7 +744,17 @@ GSF_cadet_release_clients (void *cls, | |||
741 | "Timeout on cadet channel to %s\n", | 744 | "Timeout on cadet channel to %s\n", |
742 | GNUNET_i2s (&mh->target)); | 745 | GNUNET_i2s (&mh->target)); |
743 | if (NULL != mh->channel) | 746 | if (NULL != mh->channel) |
744 | GNUNET_CADET_channel_destroy (mh->channel); | 747 | { |
748 | struct GNUNET_CADET_Channel *channel = mh->channel; | ||
749 | |||
750 | mh->channel = NULL; | ||
751 | GNUNET_CADET_channel_destroy (channel); | ||
752 | } | ||
753 | if (NULL != mh->reset_task) | ||
754 | { | ||
755 | GNUNET_SCHEDULER_cancel (mh->reset_task); | ||
756 | mh->reset_task = NULL; | ||
757 | } | ||
745 | return GNUNET_YES; | 758 | return GNUNET_YES; |
746 | } | 759 | } |
747 | 760 | ||