updates.
authorPekka Riikonen <priikone@silcnet.org>
Wed, 14 Feb 2001 17:46:49 +0000 (17:46 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 14 Feb 2001 17:46:49 +0000 (17:46 +0000)
CHANGES
apps/silcd/command_reply.c
apps/silcd/idlist.c
apps/silcd/packet_receive.c
apps/silcd/testi2.conf

diff --git a/CHANGES b/CHANGES
index b214f5f5fe55e38d119acb901376e8b5e0c2f8b6..09beadc1d44ea9fb8157cbce7638c1f762895b70 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -21,6 +21,15 @@ Wed Feb 14 16:03:25 EET 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
          Irssi-silc client does support windows and can handle several
          connections without problems, see: www.irssi.org and SILC plugin.
 
+       * Fixed some places where client was added to the IDList.  The
+         rule of thumb is following (in order to get everything right):
+         If the client is directly connected local client then the 
+         `connection' argument must be set and `router' argument must be 
+         NULL to silc_idlist_add_client function.  If the client is not
+         directly connected client then the `router' argument must
+         bet set and the `connection' argument must be NULL to the
+         silc_idlist_add_client function.
+
 Tue Feb 13 19:55:59 EET 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
 
        * Added --with-gmp configuration option.  If set the GMP
index b6858d77ff63f33ba78018a00bbe57b7730f8a08..bc73928ad24a2b57590e9f2c84fcb82230fdbf28 100644 (file)
@@ -175,7 +175,8 @@ silc_server_command_reply_whois_save(SilcServerCommandReplyContext cmd)
        global. */
     silc_idlist_add_client(server->global_list, nick,
                           strdup(username), 
-                          strdup(realname), client_id, NULL, NULL);
+                          strdup(realname), client_id, 
+                          cmd->sock->user_data, NULL);
   } else {
     /* We have the client already, update the data */
 
@@ -293,7 +294,7 @@ silc_server_command_reply_identify_save(SilcServerCommandReplyContext cmd)
        global. */
     silc_idlist_add_client(server->global_list, nick,
                           username ? strdup(username) : NULL, NULL,
-                          client_id, NULL, NULL);
+                          client_id, cmd->sock->user_data, NULL);
   } else {
     /* We have the client already, update the data */
 
index 1a56eeabdd9eda4e00f080ba194dffeff734b9c1..c1354143fb3c67c69a20c7ec7525fc711b7cce84 100644 (file)
@@ -183,7 +183,12 @@ void silc_idlist_del_server(SilcIDList id_list, SilcServerEntry entry)
 
 /* Add new client entry. This adds the client entry to ID cache system
    and returns the allocated client entry or NULL on error.  This is
-   called when new client connection is accepted to the server. */
+   called when new client connection is accepted to the server. If The
+   `router' is provided then the all server routines assume that the client
+   is not directly connected local client but it has router set and is
+   remote.  If this is the case then `connection' must be NULL.  If, on the
+   other hand, the `connection' is provided then the client is assumed
+   to be directly connected local client and `router' must be NULL. */
 
 SilcClientEntry
 silc_idlist_add_client(SilcIDList id_list, unsigned char *nickname, 
index 1ffa088e35ac3822219831af89fcdea595f3a45a..81938177f4f08b9597ddcbd9238ea958280eeb5b 100644 (file)
@@ -68,10 +68,10 @@ void silc_server_private_message(SilcServer server,
       /* We are of course in this case the client's router thus the real
         "router" of the client is the server who owns the client. Thus
         we will send the packet to that server. */
-      router = (SilcServerEntry)dst_sock->user_data;
+      router = (SilcServerEntry)client->router;
       idata = (SilcIDListData)router;
 
-      silc_server_send_private_message(server, dst_sock,
+      silc_server_send_private_message(server, router->connection,
                                       idata->send_key,
                                       idata->hmac,
                                       packet);
@@ -718,7 +718,7 @@ void silc_server_new_id(SilcServer server, SilcSocketConnection sock,
       memcpy(hash, ((SilcClientID *)id)->hash, 
             sizeof(((SilcClientID *)id)->hash));
       entry = silc_idlist_add_client(id_list, hash, NULL, NULL, id, 
-                                    router, router_sock);
+                                    router, NULL);
       entry->nickname = NULL;
 
       if (sock->type == SILC_SOCKET_TYPE_SERVER)
@@ -1000,7 +1000,7 @@ void silc_server_notify(SilcServer server,
                                             client_id, NULL);
       if (!client) {
        client = silc_idlist_add_client(server->global_list, NULL, NULL, NULL,
-                                       client_id, sock->user_data, sock);
+                                       client_id, sock->user_data, NULL);
        if (!client) {
          silc_free(channel_id);
          silc_free(client_id);
index 11fea2dadf57561fc92dc16e57ce119d4007462b..f6818db19560df19b7e1d4cfdf9addf7d93a4395 100644 (file)
@@ -19,10 +19,10 @@ nobody:nobody
 Mun huone:Mun servo:Pekka Riikonen:priikone@poseidon.pspt.fi
 
 [ServerInfo]
-lassi.kuo.fi.ssh.com:10.2.1.7:Kuopio, Finland:1334
+lassi.kuo.fi.ssh.com:212.146.8.245:Kuopio, Finland:1334
 
 [ListenPort]
-10.2.1.7:10.2.1.7:1334
+212.146.8.245:212.146.8.245:1334
 
 [Logging]
 infologfile:silcd2.log:10000
@@ -43,11 +43,9 @@ errorlogfile:silcd2.log:10000
 [AdminConnection]
 
 [ServerConnection]
-10.2.1.7:passwd:priikone:1333:1:1
-10.2.1.7:passwd:priikone:1336:1:1
+212.146.8.245:passwd:priikone:1333:1:1
 
 [RouterConnection]
-10.2.1.7:passwd:priikone:1335:1:1:0
 
 [DenyConnection]
 [RedirectClient]