Fixed reconnect crashbug, Bugs #116 & #127.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 9 Mar 2003 14:52:04 +0000 (14:52 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 9 Mar 2003 14:52:04 +0000 (14:52 +0000)
CHANGES
apps/irssi/src/silc/core/client_ops.c
lib/silcclient/client.c

diff --git a/CHANGES b/CHANGES
index b70e74b248a1a58664e0b867b05754c63ea143ed..28ac4aa3125fa88e65049f7b1bcfdb39995a2b67 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,12 @@ Sun Mar  9 16:29:20 EET 2003  Pekka Riikonen <priikone@silcnet.org>
          purging outgoing queue.  Prevents the "Error in select()"
          floods.  Affected file silcd/packet_send.c.
 
+       * Fixed incorrect connection deletion from client library
+         after calling "connect" client operation.  Could cause
+         crashes for example during reconnect timeouts.  Affected
+         files are lib/silcclient/client.c and 
+         irssi/src/silc/core/client_ops.c.
+
 Tue Feb  4 22:53:26 EET 2003  Pekka Riikonen <priikone@silcnet.org>
 
        * NULL terminate allocated string in silc_buffer_strformat.
index 2f9c7541ca5382d9976b8b6a2896b2e86f861640..d979a640abfb4c574cd7829b709184061e15fcb6 100644 (file)
@@ -1110,7 +1110,8 @@ void silc_disconnect(SilcClient client, SilcClientConnection conn,
             silc_get_status_message(status), status,
             message ? message : "");
 
-  server->conn->context = NULL;
+  if (server->conn)
+    server->conn->context = NULL;
   server->conn = NULL;
   server->connection_lost = TRUE;
   server_disconnect(SERVER(server));
index 745cb698b52daf343e7233769ab7df0f770f7c00..6344e32bf95b800a8dfd91fa45948c9345ecf39a 100644 (file)
@@ -437,8 +437,8 @@ silc_client_connect_to_server_internal(SilcClientInternalConnectContext *ctx)
    done the `connect' client operation is called. */
 
 bool silc_client_connect_to_server(SilcClient client,
-                                  SilcClientConnectionParams *params,
-                                  int port, char *host, void *context)
+                                  SilcClientConnectionParams *params,
+                                  int port, char *host, void *context)
 {
   SilcClientInternalConnectContext *ctx;
   SilcClientConnection conn;
@@ -636,7 +636,6 @@ SILC_TASK_CALLBACK(silc_client_connect_to_server_start)
 
       /* Notify application of failure */
       client->internal->ops->connected(client, conn, SILC_CLIENT_CONN_ERROR);
-      silc_client_del_connection(client, conn);
     }
     return;
   }