updates.
authorPekka Riikonen <priikone@silcnet.org>
Thu, 7 Jun 2001 16:36:15 +0000 (16:36 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 7 Jun 2001 16:36:15 +0000 (16:36 +0000)
CHANGES
apps/irssi/src/silc/core/silc-channels.c
apps/irssi/src/silc/core/silc-core.c
apps/silcd/packet_receive.c

diff --git a/CHANGES b/CHANGES
index 379377b403af13d83cf1542718871cc94fd25113..8b223f56e92f3ba1a11429032c5bc9385090a499 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,10 @@ Thu Jun  7 16:29:56 EEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
          resolved then check it from the public key.  Affected file is
          silcd/packet_receive.c.
 
+       * Fixed a fatal bug in Irssi SILC client. Do not send QUIT command
+         if the server disconnected us and the connection is not valid
+         anymore.  Affected file irssi/src/silc/core/silc-channels.c.
+
 Thu Jun  7 08:57:16 CEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
 
        * Close log file after open.  Affected file 
index 9c1f638aae6b67c82faf259c68a768ca30f69bd2..1614ff44b187abb1a8b44906b721bef6d4c18b5f 100644 (file)
@@ -85,6 +85,7 @@ static void silc_channels_join(SILC_SERVER_REC *server,
     silc_command_exec(server, "JOIN", channel);
     g_free(channel);
   }
+
   g_strfreev(list);
 }
 
@@ -99,7 +100,7 @@ static void sig_connected(SILC_SERVER_REC *server)
 
 static void sig_server_quit(SILC_SERVER_REC *server, const char *msg)
 {
-  if (IS_SILC_SERVER(server))
+  if (IS_SILC_SERVER(server) && server->conn && server->conn->sock)
     silc_command_exec(server, "QUIT", msg);
 }
 
index 510bdff2bc9c3a2c637173422dbf1d8ccf4998da..787290ccfa8556807779485a086b857ac37730b3 100644 (file)
@@ -277,8 +277,7 @@ void silc_core_init_finish(void)
   silc_config = silc_client_config_alloc(SILC_CLIENT_HOME_CONFIG_FILE);
 
   /* Get user information */
-//  silc_client->username = g_strdup(settings_get_str("user_name"));
-  silc_client->username = strdup("priikone@pelle.palle.polle.puu");
+  silc_client->username = g_strdup(settings_get_str("user_name"));
   silc_client->hostname = silc_net_localhost();
   silc_client->realname = g_strdup(settings_get_str("real_name"));
 
index 340a20a945a2aa8325487febd4a5af2efbc59e7f..1600f0b52c6112c71221715f20aa83f0f450edde 100644 (file)
@@ -1338,16 +1338,9 @@ SilcClientEntry silc_server_new_client(SilcServer server,
     hostname = silc_calloc((strlen(username) - tlen) + 1, sizeof(char));
     memcpy(hostname, username + tlen + 1, strlen(username) - tlen - 1);
 
-    pident = silc_pkcs_decode_identifier(client->data.public_key->identifier);
-    if (pident) {
-      phostname = strdup(pident->host);
-      silc_pkcs_free_identifier(pident);
-    }
-
     if (strcmp(sock->hostname, sock->ip) && 
        strcmp(sock->hostname, hostname)) {
       silc_free(username);
-      silc_free(phostname);
       silc_free(hostname);
       if (realname)
        silc_free(realname);
@@ -1357,11 +1350,18 @@ SilcClientEntry silc_server_new_client(SilcServer server,
       return NULL;
     }
     
+    pident = silc_pkcs_decode_identifier(client->data.public_key->identifier);
+    if (pident) {
+      phostname = strdup(pident->host);
+      silc_pkcs_free_identifier(pident);
+    }
+
     if (!strcmp(sock->hostname, sock->ip) && 
        phostname && strcmp(phostname, hostname)) {
       silc_free(username);
-      silc_free(phostname);
       silc_free(hostname);
+      if (phostname)
+       silc_free(phostname);
       if (realname)
        silc_free(realname);
       silc_server_disconnect_remote(server, sock, 
@@ -1445,8 +1445,8 @@ SilcClientEntry silc_server_new_client(SilcServer server,
 
   /* Send some nice info to the client */
   SILC_SERVER_SEND_NOTIFY(server, sock, SILC_NOTIFY_TYPE_NONE,
-                         ("Welcome to the SILC Network %s@%s",
-                          username, sock->hostname));
+                         ("Welcome to the SILC Network %s",
+                          username));
   SILC_SERVER_SEND_NOTIFY(server, sock, SILC_NOTIFY_TYPE_NONE,
                          ("Your host is %s, running version %s",
                           server->config->server_info->server_name,