From cabe5115b7d35934aabd4c63bf107ab390f32fff Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 12 Aug 2001 09:30:26 +0000 Subject: [PATCH] updates. --- CHANGES | 7 +++++++ TODO | 2 ++ apps/silcd/command.c | 5 ++--- apps/silcd/packet_receive.c | 3 +-- apps/silcd/protocol.c | 5 ++++- apps/silcd/server.c | 13 ++++++------- 6 files changed, 22 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index 0eb01bdf..6cc3cec1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +Sun Aug 12 12:28:17 EEST 2001 Pekka Riikonen + + * Added couple of return's in rekey protocol if error orccurred + during the protocol. The execution must be terminated. + Affected file silcd/protocol.c. Also, terminate the protocol + always with timeout. + Sat Aug 11 12:36:02 EEST 2001 Pekka Riikonen * The client's Client ID was created initally from the wrong diff --git a/TODO b/TODO index f06dfdca..ecb66354 100644 --- a/TODO +++ b/TODO @@ -3,6 +3,8 @@ TODO/bugs in Irssi SILC client o -n and -c options does not work. + o Switching servers while on channel is supposed to crash the client? + o Add local command to switch the channel's private key when channel has several private keys. Currently sending channel messages with many keys is not possible because changing the key is not possible by the diff --git a/apps/silcd/command.c b/apps/silcd/command.c index 921eeec8..77998e39 100644 --- a/apps/silcd/command.c +++ b/apps/silcd/command.c @@ -2533,7 +2533,7 @@ SILC_SERVER_CMD_FUNC(kill) /* Remove the client entry, If it is locally connected then we will also disconnect the client here */ - if (remote_client->data.registered && remote_client->connection) { + if (remote_client->connection) { /* Remove locally conneted client */ SilcSocketConnection sock = remote_client->connection; silc_server_free_client_data(server, sock, remote_client, FALSE, NULL); @@ -4614,8 +4614,7 @@ SILC_SERVER_CMD_FUNC(close) /* Close the connection to the server */ sock = (SilcSocketConnection)server_entry->connection; - if (sock->user_data) - silc_server_free_sock_user_data(server, sock); + silc_server_free_sock_user_data(server, sock); silc_server_close_connection(server, sock); out: diff --git a/apps/silcd/packet_receive.c b/apps/silcd/packet_receive.c index 3bc50a0c..8aa845b9 100644 --- a/apps/silcd/packet_receive.c +++ b/apps/silcd/packet_receive.c @@ -869,8 +869,7 @@ void silc_server_notify(SilcServer server, /* If the client is one of ours, then close the connection to the client now. This removes the client from all channels as well. */ - if (packet->dst_id_type == SILC_ID_CLIENT && client->data.registered && - client->connection) { + if (packet->dst_id_type == SILC_ID_CLIENT && client->connection) { sock = client->connection; silc_server_free_client_data(server, NULL, client, FALSE, NULL); silc_server_close_connection(server, sock); diff --git a/apps/silcd/protocol.c b/apps/silcd/protocol.c index 8bf9e5b9..a68815de 100644 --- a/apps/silcd/protocol.c +++ b/apps/silcd/protocol.c @@ -1373,6 +1373,7 @@ SILC_TASK_CALLBACK(silc_server_protocol_rekey) /* Error in protocol */ protocol->state = SILC_PROTOCOL_STATE_ERROR; silc_protocol_execute(protocol, server->schedule, 0, 300000); + return; } ctx->ske = silc_ske_alloc(); @@ -1507,6 +1508,7 @@ SILC_TASK_CALLBACK(silc_server_protocol_rekey) /* Error in protocol */ protocol->state = SILC_PROTOCOL_STATE_ERROR; silc_protocol_execute(protocol, server->schedule, 0, 300000); + return; } status = silc_ske_initiator_finish(ctx->ske, ctx->packet->buffer); @@ -1543,7 +1545,8 @@ SILC_TASK_CALLBACK(silc_server_protocol_rekey) if (ctx->packet->type != SILC_PACKET_REKEY_DONE) { /* Error in protocol */ protocol->state = SILC_PROTOCOL_STATE_ERROR; - silc_protocol_execute(protocol, server->schedule, 0, 0); + silc_protocol_execute(protocol, server->schedule, 0, 300000); + return; } /* We received the REKEY_DONE packet and all packets after this is diff --git a/apps/silcd/server.c b/apps/silcd/server.c index b9f9c284..57e3839c 100644 --- a/apps/silcd/server.c +++ b/apps/silcd/server.c @@ -2111,7 +2111,6 @@ void silc_server_close_connection(SilcServer server, /* Unregister all tasks */ silc_schedule_task_del_by_fd(server->schedule, sock->sock); - silc_schedule_task_del_by_fd(server->schedule, sock->sock); /* Close the actual connection */ silc_net_close_connection(sock->sock); @@ -2133,9 +2132,9 @@ void silc_server_close_connection(SilcServer server, } silc_schedule_task_add(server->schedule, 0, - silc_server_close_connection_final, - (void *)sock, 0, 1, SILC_TASK_TIMEOUT, - SILC_TASK_PRI_NORMAL); + silc_server_close_connection_final, + (void *)sock, 0, 1, SILC_TASK_TIMEOUT, + SILC_TASK_PRI_NORMAL); } /* Sends disconnect message to remote connection and disconnects the @@ -3977,9 +3976,9 @@ SILC_TASK_CALLBACK(silc_server_rekey_callback) /* Re-register re-key timeout */ silc_schedule_task_add(server->schedule, sock->sock, - silc_server_rekey_callback, - context, idata->rekey->timeout, 0, - SILC_TASK_TIMEOUT, SILC_TASK_PRI_NORMAL); + silc_server_rekey_callback, + context, idata->rekey->timeout, 0, + SILC_TASK_TIMEOUT, SILC_TASK_PRI_NORMAL); } /* The final callback for the REKEY protocol. This will actually take the -- 2.43.0