From: Bart Polot Date: Mon, 21 Jul 2014 00:15:24 +0000 (+0000) Subject: - On a new EPHM, do a immediate rekey X-Git-Tag: initial-import-from-subversion-38251~3443 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c71f4ec2f893ace0fb9ce7c6b98d799bb79bd30e;p=oweals%2Fgnunet.git - On a new EPHM, do a immediate rekey --- diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index 5425e258a..d46a0a399 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c @@ -1841,7 +1841,7 @@ GCC_handle_broken (void* cls, * is popped! Do not use 'c' after the call. */ while (NULL != (out_msg = GCP_connection_pop (neighbor, c, &del))) { - pending -= del + 1; + pending -= del + 1; /* Substract the deleted messages + the popped one */ GCT_resend_message (out_msg, t); } /* All pending messages should have been popped, diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c index fffdb9102..2d8aa90b6 100644 --- a/src/cadet/gnunet-service-cadet_tunnel.c +++ b/src/cadet/gnunet-service-cadet_tunnel.c @@ -1838,8 +1838,9 @@ handle_ephemeral (struct CadetTunnel *t, { t->estate = CADET_TUNNEL_KEY_REKEY; } - if (GNUNET_SCHEDULER_NO_TASK == t->rekey_task) - t->rekey_task = GNUNET_SCHEDULER_add_now (rekey_tunnel, t); + if (GNUNET_SCHEDULER_NO_TASK != t->rekey_task) + GNUNET_SCHEDULER_cancel (t->rekey_task); + t->rekey_task = GNUNET_SCHEDULER_add_now (rekey_tunnel, t); } else if (CADET_TUNNEL_KEY_OK == t->estate) {