From: Pekka Riikonen Date: Tue, 4 Jun 2002 15:30:09 +0000 (+0000) Subject: updates. X-Git-Tag: silc.toolkit.0.9.2~18 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=e3ec273e75b2290bb1fbfd51cc47ba8e740604f9 updates. --- diff --git a/CHANGES b/CHANGES index 5f41b0b2..25d5d7e0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +Tue Jun 4 18:36:05 EEST 2002 Pekka Riikonen + + * Fixed detach timeout handling to use Client ID and not + the actual client entry which may be freed in the callback. + Affected file silcd/command.c. + Thu May 30 15:53:45 CEST 2002 Pekka Riikonen * Merged c0ffee's multiple interface support patch. diff --git a/apps/silcd/command.c b/apps/silcd/command.c index be933055..25468230 100644 --- a/apps/silcd/command.c +++ b/apps/silcd/command.c @@ -4877,13 +4877,19 @@ SILC_TASK_CALLBACK(silc_server_command_detach_cb) SILC_TASK_CALLBACK(silc_server_command_detach_timeout) { QuitInternal q = (QuitInternal)context; - SilcClientEntry client = (SilcClientEntry)q->sock; + SilcClientID *client_id = (SilcClientID *)q->sock; + SilcClientEntry client; SILC_LOG_DEBUG(("Start")); - if (client->mode & SILC_UMODE_DETACHED) + client = silc_idlist_find_client_by_id(q->server->local_list, client_id, + FALSE, NULL); + + if (client && client->mode & SILC_UMODE_DETACHED) silc_server_free_client_data(q->server, NULL, client, TRUE, "Detach timeout"); + + silc_free(client_id); silc_free(q); } @@ -4899,8 +4905,7 @@ SILC_SERVER_CMD_FUNC(detach) if (server->config->detach_disabled) { silc_server_command_send_status_reply(cmd, SILC_COMMAND_DETACH, - SILC_STATUS_ERR_UNKNOWN_COMMAND, - 0); + SILC_STATUS_ERR_UNKNOWN_COMMAND, 0); goto out; } @@ -4933,7 +4938,7 @@ SILC_SERVER_CMD_FUNC(detach) if (server->config->detach_timeout) { q = silc_calloc(1, sizeof(*q)); q->server = server; - q->sock = (void *)client; + q->sock = silc_id_dup(client->id, SILC_ID_CLIENT); silc_schedule_task_add(server->schedule, 0, silc_server_command_detach_timeout, q, server->config->detach_timeout * 60,