From 0f7ddd49007d0e49d3c409fb3175c1663f17da9e Mon Sep 17 00:00:00 2001 From: Patrik Weiskircher Date: Sat, 1 May 2004 11:57:54 +0000 Subject: [PATCH] Couldn't detach and reattach twice, because of the previous commit. --- CHANGES | 5 +++++ apps/silcd/packet_receive.c | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/CHANGES b/CHANGES index 31c0efc1..2fa3adb2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Sat May 1 13:55:54 CEST 2004 Patrik Weiskircher + + * Couldn't detach and reattach twice, because of the previous + commit. Affected file silcd/packet_receive.c + Fri Apr 30 19:40:28 CEST 2004 Patrik Weiskircher * Added check to ignore Port value if Initiator is FALSE. diff --git a/apps/silcd/packet_receive.c b/apps/silcd/packet_receive.c index fb1a4535..26eed0ee 100644 --- a/apps/silcd/packet_receive.c +++ b/apps/silcd/packet_receive.c @@ -3683,6 +3683,19 @@ void silc_server_resume_client(SilcServer server, return; } + if (detached_client->data.status & SILC_IDLIST_STATUS_RESUMED) { + SILC_LOG_ERROR(("Client %s (%s) tried to attach more than once, " + "closing connection", sock->hostname, sock->ip)); + silc_server_disconnect_remote(server, sock, + SILC_STATUS_ERR_INCOMPLETE_INFORMATION, + "Resuming not possible"); + if (sock->user_data) + silc_server_free_sock_user_data(server, sock, NULL); + silc_free(client_id); + + return; + } + if (detached_client->resuming_client && detached_client->resuming_client != client) { SILC_LOG_ERROR(("Client %s (%s) tried to attach more than once, " @@ -3846,6 +3859,9 @@ void silc_server_resume_client(SilcServer server, detached_client->mode &= ~SILC_UMODE_DETACHED; server->stat.my_detached--; + /* we are finished - reset resuming client */ + detached_client->resuming_client = NULL; + /* Check if anyone is watching this client */ if (server->server_type == SILC_ROUTER) silc_server_check_watcher_list(server, detached_client, NULL, -- 2.24.0