projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Optimized PING command handling a bit.
[silc.git]
/
apps
/
silcd
/
command.c
diff --git
a/apps/silcd/command.c
b/apps/silcd/command.c
index b1e908547b39119edb86b0a5dece006e07b300f8..06fbd9fb1f6dbf13ce104fa57c66d025c7f3ccee 100644
(file)
--- a/
apps/silcd/command.c
+++ b/
apps/silcd/command.c
@@
-1545,11
+1545,10
@@
SILC_SERVER_CMD_FUNC(ping)
{
SilcServerCommandContext cmd = (SilcServerCommandContext)context;
SilcServer server = cmd->server;
{
SilcServerCommandContext cmd = (SilcServerCommandContext)context;
SilcServer server = cmd->server;
- SilcServerID *id;
SilcUInt32 len;
unsigned char *tmp;
SilcUInt32 len;
unsigned char *tmp;
- SILC_SERVER_COMMAND_CHECK(SILC_COMMAND_
INFO
, cmd, 1, 2);
+ SILC_SERVER_COMMAND_CHECK(SILC_COMMAND_
PING
, cmd, 1, 2);
/* Get Server ID */
tmp = silc_argument_get_arg_type(cmd->args, 1, &len);
/* Get Server ID */
tmp = silc_argument_get_arg_type(cmd->args, 1, &len);
@@
-1558,11
+1557,8
@@
SILC_SERVER_CMD_FUNC(ping)
SILC_STATUS_ERR_NO_SERVER_ID, 0);
goto out;
}
SILC_STATUS_ERR_NO_SERVER_ID, 0);
goto out;
}
- id = silc_id_str2id(tmp, len, SILC_ID_SERVER);
- if (!id)
- goto out;
- if (
SILC_ID_SERVER_COMPARE(id, server->id
)) {
+ if (
!memcmp(tmp, server->id_string, server->id_string_len
)) {
/* Send our reply */
silc_server_command_send_status_reply(cmd, SILC_COMMAND_PING,
SILC_STATUS_OK, 0);
/* Send our reply */
silc_server_command_send_status_reply(cmd, SILC_COMMAND_PING,
SILC_STATUS_OK, 0);
@@
-1572,8
+1568,6
@@
SILC_SERVER_CMD_FUNC(ping)
goto out;
}
goto out;
}
- silc_free(id);
-
out:
silc_server_command_free(cmd);
}
out:
silc_server_command_free(cmd);
}