updates.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 12 Aug 2001 09:30:26 +0000 (09:30 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 12 Aug 2001 09:30:26 +0000 (09:30 +0000)
CHANGES
TODO
apps/silcd/command.c
apps/silcd/packet_receive.c
apps/silcd/protocol.c
apps/silcd/server.c

diff --git a/CHANGES b/CHANGES
index 0eb01bdf5d87ec4e7c2013b101cb3980df846d62..6cc3cec1da172c6db52fdf01617cc97c4b0e1980 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,10 @@
+Sun Aug 12 12:28:17 EEST 2001  Pekka Riikonen <priikone@silcnet.org>
+
+       * 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 <priikone@silcnet.org>
 
        * The client's Client ID was created initally from the wrong
diff --git a/TODO b/TODO
index f06dfdca1df5ec935788f2ea7d5ac757415fcebd..ecb663546eb775e45113578497a5bc7db50761f0 100644 (file)
--- 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
index 921eeec8bcc18cbd69405a2a2d3f03a9646ed5d0..77998e3982e595f99bb1f296aa6b37c2cf8b4510 100644 (file)
@@ -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:
index 3bc50a0ca738a0c51c3297ca040d0bbb03b3a84d..8aa845b91d62dfe3cb605ec1f6c4526f6d8945e4 100644 (file)
@@ -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);
index 8bf9e5b96e9dcee1d401cc6283a933e747dc00cc..a68815dedeb600405e1ccc9bf322b0533175a8c8 100644 (file)
@@ -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
index b9f9c2844281c13260a04e5e8b56e4bc2b0c217a..57e3839c95f5c278fcae561becc2a86559163968 100644 (file)
@@ -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