updated.
authorPekka Riikonen <priikone@silcnet.org>
Sat, 9 Jun 2001 17:20:45 +0000 (17:20 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sat, 9 Jun 2001 17:20:45 +0000 (17:20 +0000)
CHANGES
apps/silcd/server.c

diff --git a/CHANGES b/CHANGES
index 8b3e0adf6a8a66d9595b0cde476f67a359723dac..43bb3857bbc21c8ac1eadb91c7f40137b1cb0502 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+Sat Jun  9 20:17:30 EEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
+
+       * Check in the silc_server_timeout_remote if protocol is active
+         and make sure that the protocol's final callback is called so
+         that all memory if freed.  Affected file silcd/server.c.
+
 Sat Jun  9 12:51:27 EEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
 
        * silc_server_whois_send_reply crashed the server if the nickname
index 7593e7033b55b7afe9e4533c9b34fa5bb492e6be..83cb7fef3597f4c65267378347ee5a68078983d0 100644 (file)
@@ -2712,14 +2712,23 @@ SILC_TASK_CALLBACK(silc_server_timeout_remote)
   SilcServer server = (SilcServer)context;
   SilcSocketConnection sock = server->sockets[fd];
 
+  SILC_LOG_DEBUG(("Start"));
+
   if (!sock)
     return;
 
+  /* If we have protocol active we must assure that we call the protocol's
+     final callback so that all the memory is freed. */
+  if (sock->protocol) {
+    sock->protocol->state = SILC_PROTOCOL_STATE_ERROR;
+    silc_protocol_execute_final(sock->protocol, server->timeout_queue);
+    return;
+  }
+
   if (sock->user_data)
     silc_server_free_sock_user_data(server, sock);
 
-  silc_server_disconnect_remote(server, sock, 
-                               "Server closed connection: "
+  silc_server_disconnect_remote(server, sock, "Server closed connection: "
                                "Connection timeout");
 }