From: Christian Grothoff Date: Mon, 23 Jan 2017 13:18:48 +0000 (+0100) Subject: beautify disconnect logic a bit X-Git-Tag: taler-0.2.1~337 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e1ea3b20c4429e06459c3adbfcb1e4cfdb14667a;p=oweals%2Fgnunet.git beautify disconnect logic a bit --- diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c index 355efc5aa..de10d5809 100644 --- a/src/cadet/cadet_api.c +++ b/src/cadet/cadet_api.c @@ -475,7 +475,6 @@ destroy_channel (struct GNUNET_CADET_Channel *ch, if (0 != ch->peer) GNUNET_PEER_change_rc (ch->peer, -1); GNUNET_free (ch); - } @@ -1367,7 +1366,7 @@ reconnect (struct GNUNET_CADET_Handle *h) LOG (GNUNET_ERROR_TYPE_DEBUG, "Requested RECONNECT, destroying all channels\n"); - for (ch = h->channels_head; NULL != ch; ch = h->channels_head) + while (NULL != (ch = h->channels_head)) destroy_channel (ch, GNUNET_YES); if (NULL == h->reconnect_task) h->reconnect_task = GNUNET_SCHEDULER_add_delayed (h->reconnect_time, @@ -1741,9 +1740,8 @@ GNUNET_CADET_notify_transmit_ready_cancel (struct GNUNET_CADET_TransmitHandle *t if (NULL != th->request_data_task) { GNUNET_SCHEDULER_cancel (th->request_data_task); + th->request_data_task = NULL; } - th->request_data_task = NULL; - remove_from_queue (th); GNUNET_free (th); }