X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Fsilcd%2Fcommand.h;fp=apps%2Fsilcd%2Fcommand.h;h=da7a3ea737b96775ae255265838a5e3acce104a7;hb=ab530adb8aab5b1aa48f66f3cd0dd6be509dd6de;hp=7d884e169c84c1853dc7c1df79e94a55c6d8584a;hpb=4754a9c2f05241f65ff380bb35b4e6e9842d54f0;p=silc.git diff --git a/apps/silcd/command.h b/apps/silcd/command.h index 7d884e16..da7a3ea7 100644 --- a/apps/silcd/command.h +++ b/apps/silcd/command.h @@ -96,18 +96,22 @@ void silc_server_command_##func(void *context, void *context2) /* Executed pending command. The first argument to the callback function is the user specified context. The second argument is always the SilcServerCommandReply context. */ -#define SILC_SERVER_PENDING_EXEC(ctx, cmd) \ -do { \ - if (ctx->callback) \ - (*ctx->callback)(ctx->context, ctx); \ +#define SILC_SERVER_PENDING_EXEC(ctx, cmd) \ +do { \ + int _i; \ + for (_i = 0; _i < ctx->callbacks_count; _i++) \ + if (ctx->callbacks[_i].callback) \ + (*ctx->callbacks[_i].callback)(ctx->callbacks[_i].context, ctx); \ } while(0) /* Execute destructor for pending command */ -#define SILC_SERVER_PENDING_DESTRUCTOR(ctx, cmd) \ -do { \ - silc_server_command_pending_del(ctx->server, cmd, ctx->ident); \ - if (ctx->destructor) \ - (*ctx->destructor)(ctx->context); \ +#define SILC_SERVER_PENDING_DESTRUCTOR(ctx, cmd) \ +do { \ + int _i; \ + silc_server_command_pending_del(ctx->server, cmd, ctx->ident); \ + for (_i = 0; _i < ctx->callbacks_count; _i++) \ + if (ctx->callbacks[_i].destructor) \ + (*ctx->callbacks[_i].destructor)(ctx->callbacks[_i].context); \ } while(0) /* Prototypes */ @@ -127,10 +131,12 @@ void silc_server_command_pending(SilcServer server, void silc_server_command_pending_del(SilcServer server, SilcCommand reply_cmd, uint16 ident); -int silc_server_command_pending_check(SilcServer server, - SilcServerCommandReplyContext ctx, - SilcCommand command, - uint16 ident); +SilcServerCommandPendingCallbacks +silc_server_command_pending_check(SilcServer server, + SilcServerCommandReplyContext ctx, + SilcCommand command, + uint16 ident, + uint32 *callbacks_count); SILC_SERVER_CMD_FUNC(whois); SILC_SERVER_CMD_FUNC(whowas); SILC_SERVER_CMD_FUNC(identify);