if (ctx->timeout_task)
silc_schedule_task_del(server->schedule, ctx->timeout_task);
+ /* Assure that after calling final callback there cannot be pending
+ executions for this protocol anymore. This just unregisters any
+ timeout callbacks for this protocol. */
+ silc_protocol_cancel(protocol, server->schedule);
+
/* Call the final callback */
if (protocol->final_callback)
silc_protocol_execute_final(protocol, server->schedule);
if (ctx->timeout_task)
silc_schedule_task_del(server->schedule, ctx->timeout_task);
+ /* Assure that after calling final callback there cannot be pending
+ executions for this protocol anymore. This just unregisters any
+ timeout callbacks for this protocol. */
+ silc_protocol_cancel(protocol, server->schedule);
+
/* On error the final callback is always called. */
if (protocol->final_callback)
silc_protocol_execute_final(protocol, server->schedule);
if (ctx->timeout_task)
silc_schedule_task_del(server->schedule, ctx->timeout_task);
+ /* Assure that after calling final callback there cannot be pending
+ executions for this protocol anymore. This just unregisters any
+ timeout callbacks for this protocol. */
+ silc_protocol_cancel(protocol, server->schedule);
+
/* On error the final callback is always called. */
if (protocol->final_callback)
silc_protocol_execute_final(protocol, server->schedule);
if (ctx->timeout_task)
silc_schedule_task_del(server->schedule, ctx->timeout_task);
+ /* Assure that after calling final callback there cannot be pending
+ executions for this protocol anymore. This just unregisters any
+ timeout callbacks for this protocol. */
+ silc_protocol_cancel(protocol, server->schedule);
+
/* Protocol has ended, call the final callback */
if (protocol->final_callback)
silc_protocol_execute_final(protocol, server->schedule);
if (ctx->timeout_task)
silc_schedule_task_del(server->schedule, ctx->timeout_task);
+ /* Assure that after calling final callback there cannot be pending
+ executions for this protocol anymore. This just unregisters any
+ timeout callbacks for this protocol. */
+ silc_protocol_cancel(protocol, server->schedule);
+
/* On error the final callback is always called. */
if (protocol->final_callback)
silc_protocol_execute_final(protocol, server->schedule);
if (ctx->timeout_task)
silc_schedule_task_del(server->schedule, ctx->timeout_task);
+ /* Assure that after calling final callback there cannot be pending
+ executions for this protocol anymore. This just unregisters any
+ timeout callbacks for this protocol. */
+ silc_protocol_cancel(protocol, server->schedule);
+
/* On error the final callback is always called. */
if (protocol->final_callback)
silc_protocol_execute_final(protocol, server->schedule);
encrypted with the new key so set the decryption key to the new key */
silc_server_protocol_rekey_generate(server, ctx, FALSE);
+ /* Assure that after calling final callback there cannot be pending
+ executions for this protocol anymore. This just unregisters any
+ timeout callbacks for this protocol. */
+ silc_protocol_cancel(protocol, server->schedule);
+
/* Protocol has ended, call the final callback */
if (protocol->final_callback)
silc_protocol_execute_final(protocol, server->schedule);
silc_ske_abort(ctx->ske, ctx->ske->status);
}
+ /* Assure that after calling final callback there cannot be pending
+ executions for this protocol anymore. This just unregisters any
+ timeout callbacks for this protocol. */
+ silc_protocol_cancel(protocol, server->schedule);
+
/* On error the final callback is always called. */
if (protocol->final_callback)
silc_protocol_execute_final(protocol, server->schedule);
* We have received failure from remote
*/
+ /* Assure that after calling final callback there cannot be pending
+ executions for this protocol anymore. This just unregisters any
+ timeout callbacks for this protocol. */
+ silc_protocol_cancel(protocol, server->schedule);
+
/* On error the final callback is always called. */
if (protocol->final_callback)
silc_protocol_execute_final(protocol, server->schedule);