projects
/
silc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7803d1d
)
Fixed pending command deletion to delete correctly.
author
Pekka Riikonen
<priikone@silcnet.org>
Sat, 29 Jun 2002 22:36:49 +0000
(22:36 +0000)
committer
Pekka Riikonen
<priikone@silcnet.org>
Sat, 29 Jun 2002 22:36:49 +0000
(22:36 +0000)
CHANGES
patch
|
blob
|
history
apps/silcd/command.c
patch
|
blob
|
history
apps/silcd/command.h
patch
|
blob
|
history
lib/silcclient/command.c
patch
|
blob
|
history
lib/silcclient/command.h
patch
|
blob
|
history
diff --git
a/CHANGES
b/CHANGES
index 14b495b0787f3606f928a2201d3203ac12ba60a3..3e5841656aa103c4e49300b0810bb425d9f9cfb9 100644
(file)
--- a/
CHANGES
+++ b/
CHANGES
@@
-1,3
+1,10
@@
+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
Sat Jun 29 17:40:12 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
* Return NO_SUCH_CHANNEL error in USERS for channel that is
diff --git
a/apps/silcd/command.c
b/apps/silcd/command.c
index 1b5a3f27676cc78db9b2cb15bd97cef9e0356acc..0be43bee6cc0c0b44c83dc2e535c25f0d2780744 100644
(file)
--- a/
apps/silcd/command.c
+++ b/
apps/silcd/command.c
@@
-366,7
+366,9
@@
void silc_server_command_pending_del(SilcServer server,
silc_dlist_start(server->pending_commands);
while ((r = silc_dlist_get(server->pending_commands)) != SILC_LIST_END) {
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);
}
silc_dlist_del(server->pending_commands, r);
silc_free(r);
}
@@
-394,6
+396,7
@@
silc_server_command_pending_check(SilcServer server,
callbacks = silc_realloc(callbacks, sizeof(*callbacks) * (i + 1));
callbacks[i].context = r->context;
callbacks[i].callback = r->callback;
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++;
}
ctx->ident = ident;
i++;
}
diff --git
a/apps/silcd/command.h
b/apps/silcd/command.h
index 464b261b7f8efacc8d881d945a2831b42b8b47f6..2e3273d6142c9bc029539f3ccd0f0e94689241c6 100644
(file)
--- a/
apps/silcd/command.h
+++ b/
apps/silcd/command.h
@@
-63,9
+63,10
@@
typedef struct {
typedef struct SilcServerCommandPendingStruct {
SilcServer server;
SilcCommand reply_cmd;
typedef struct SilcServerCommandPendingStruct {
SilcServer server;
SilcCommand reply_cmd;
+ SilcUInt16 ident;
+ unsigned int reply_check : 8;
SilcCommandCb callback;
void *context;
SilcCommandCb callback;
void *context;
- SilcUInt16 ident;
struct SilcServerCommandPendingStruct *next;
} SilcServerCommandPending;
struct SilcServerCommandPendingStruct *next;
} SilcServerCommandPending;
diff --git
a/lib/silcclient/command.c
b/lib/silcclient/command.c
index 167d787830a6d1acf25fde54cbbf5f2561212e97..c03f71aff18fdcabb67fd7351bbcd1c65405c52c 100644
(file)
--- a/
lib/silcclient/command.c
+++ b/
lib/silcclient/command.c
@@
-124,10
+124,11
@@
void silc_client_command_pending_del(SilcClientConnection conn,
silc_dlist_start(conn->pending_commands);
while ((r = silc_dlist_get(conn->pending_commands)) != SILC_LIST_END) {
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);
silc_dlist_del(conn->pending_commands, r);
silc_free(r);
- break;
}
}
}
}
}
}
@@
-153,6
+154,7
@@
silc_client_command_pending_check(SilcClientConnection conn,
callbacks = silc_realloc(callbacks, sizeof(*callbacks) * (i + 1));
callbacks[i].context = r->context;
callbacks[i].callback = r->callback;
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++;
}
ctx->ident = ident;
i++;
}
diff --git
a/lib/silcclient/command.h
b/lib/silcclient/command.h
index a334352ed9c691c9959aff0f2cadc757d19aef29..b85d2e05a18399c4bb3fdf6ede4ed556c32e0f94 100644
(file)
--- a/
lib/silcclient/command.h
+++ b/
lib/silcclient/command.h
@@
-60,9
+60,10
@@
struct SilcClientCommandContextStruct {
executed after command reply has been executed. */
typedef struct SilcClientCommandPendingStruct {
SilcCommand reply_cmd;
executed after command reply has been executed. */
typedef struct SilcClientCommandPendingStruct {
SilcCommand reply_cmd;
+ SilcUInt16 ident;
+ unsigned int reply_check : 8;
SilcCommandCb callback;
void *context;
SilcCommandCb callback;
void *context;
- SilcUInt16 ident;
struct SilcClientCommandPendingStruct *next;
} SilcClientCommandPending;
struct SilcClientCommandPendingStruct *next;
} SilcClientCommandPending;