+Sun Jun 30 01:30:22 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
+
+ * Fixed pending command deletion in server and client library
+ to check the whole list instead of breaking after first found.
+ The affected files are silcd/command.[ch] and
+ lib/silcclient/command.[ch].
+
Sat Jun 29 17:40:12 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
* Return NO_SUCH_CHANNEL error in USERS for channel that is
silc_dlist_start(server->pending_commands);
while ((r = silc_dlist_get(server->pending_commands)) != SILC_LIST_END) {
- if (r->reply_cmd == reply_cmd && r->ident == ident) {
+ if ((r->reply_cmd == reply_cmd || (r->reply_cmd == SILC_COMMAND_NONE &&
+ r->reply_check))
+ && r->ident == ident) {
silc_dlist_del(server->pending_commands, r);
silc_free(r);
}
callbacks = silc_realloc(callbacks, sizeof(*callbacks) * (i + 1));
callbacks[i].context = r->context;
callbacks[i].callback = r->callback;
+ r->reply_check = TRUE;
ctx->ident = ident;
i++;
}
typedef struct SilcServerCommandPendingStruct {
SilcServer server;
SilcCommand reply_cmd;
+ SilcUInt16 ident;
+ unsigned int reply_check : 8;
SilcCommandCb callback;
void *context;
- SilcUInt16 ident;
struct SilcServerCommandPendingStruct *next;
} SilcServerCommandPending;
silc_dlist_start(conn->pending_commands);
while ((r = silc_dlist_get(conn->pending_commands)) != SILC_LIST_END) {
- if (r->reply_cmd == reply_cmd && r->ident == ident) {
+ if ((r->reply_cmd == reply_cmd || (r->reply_cmd == SILC_COMMAND_NONE &&
+ r->reply_check))
+ && r->ident == ident) {
silc_dlist_del(conn->pending_commands, r);
silc_free(r);
- break;
}
}
}
callbacks = silc_realloc(callbacks, sizeof(*callbacks) * (i + 1));
callbacks[i].context = r->context;
callbacks[i].callback = r->callback;
+ r->reply_check = TRUE;
ctx->ident = ident;
i++;
}
executed after command reply has been executed. */
typedef struct SilcClientCommandPendingStruct {
SilcCommand reply_cmd;
+ SilcUInt16 ident;
+ unsigned int reply_check : 8;
SilcCommandCb callback;
void *context;
- SilcUInt16 ident;
struct SilcClientCommandPendingStruct *next;
} SilcClientCommandPending;