X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilcprotocol.c;h=a0a34d238618315dd6337838232c720aedaa338c;hb=d1e71f42379e8b5cd0748a7aeae8561b02cfe53d;hp=3703c30e0073233bc0953a0136067cc46c23db95;hpb=e5d8d3db6caa344b3d419b884556c21b15e7d123;p=silc.git diff --git a/lib/silcutil/silcprotocol.c b/lib/silcutil/silcprotocol.c index 3703c30e..a0a34d23 100644 --- a/lib/silcutil/silcprotocol.c +++ b/lib/silcutil/silcprotocol.c @@ -2,14 +2,13 @@ silcprotocol.c - Author: Pekka Riikonen + Author: Pekka Riikonen - Copyright (C) 1997 - 2000 Pekka Riikonen + Copyright (C) 1997 - 2005 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -23,7 +22,6 @@ /* $Id$ */ #include "silcincludes.h" -#include "silcprotocol.h" /* Dynamically registered protocols */ SilcProtocolObject *silc_protocol_list = NULL; @@ -34,17 +32,17 @@ SilcProtocolObject *silc_protocol_list = NULL; void silc_protocol_register(SilcProtocolType type, SilcProtocolCallback callback) { - SilcProtocolObject *new; + SilcProtocolObject *proto_new; - new = silc_calloc(1, sizeof(*new)); - new->type = type; - new->callback = callback; + proto_new = silc_calloc(1, sizeof(*proto_new)); + proto_new->type = type; + proto_new->callback = callback; if (!silc_protocol_list) - silc_protocol_list = new; + silc_protocol_list = proto_new; else { - new->next = silc_protocol_list; - silc_protocol_list = new; + proto_new->next = silc_protocol_list; + silc_protocol_list = proto_new; } } @@ -124,14 +122,16 @@ void silc_protocol_execute(SilcProtocol protocol, SilcSchedule schedule, SILC_TASK_TIMEOUT, SILC_TASK_PRI_NORMAL); else - protocol->protocol->callback(schedule, 0, 0, (void *)protocol); + protocol->protocol->callback(schedule, silc_schedule_get_context(schedule), + 0, 0, (void *)protocol); } /* Executes the final callback of the protocol. */ void silc_protocol_execute_final(SilcProtocol protocol, SilcSchedule schedule) { - protocol->final_callback(schedule, 0, 0, (void *)protocol); + protocol->final_callback(schedule, silc_schedule_get_context(schedule), + 0, 0, (void *)protocol); } /* Cancels the execution of the next state of the protocol. */