* 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,
{
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)
{