From 182f6d25eec71fe784017c315163d808a9b3e26b Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Wed, 14 Feb 2001 17:46:49 +0000 Subject: [PATCH] updates. --- CHANGES | 9 +++++++++ apps/silcd/command_reply.c | 5 +++-- apps/silcd/idlist.c | 7 ++++++- apps/silcd/packet_receive.c | 8 ++++---- apps/silcd/testi2.conf | 8 +++----- 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index b214f5f5..09beadc1 100644 --- a/CHANGES +++ b/CHANGES @@ -21,6 +21,15 @@ Wed Feb 14 16:03:25 EET 2001 Pekka Riikonen 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 * Added --with-gmp configuration option. If set the GMP diff --git a/apps/silcd/command_reply.c b/apps/silcd/command_reply.c index b6858d77..bc73928a 100644 --- a/apps/silcd/command_reply.c +++ b/apps/silcd/command_reply.c @@ -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 */ diff --git a/apps/silcd/idlist.c b/apps/silcd/idlist.c index 1a56eeab..c1354143 100644 --- a/apps/silcd/idlist.c +++ b/apps/silcd/idlist.c @@ -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, diff --git a/apps/silcd/packet_receive.c b/apps/silcd/packet_receive.c index 1ffa088e..81938177 100644 --- a/apps/silcd/packet_receive.c +++ b/apps/silcd/packet_receive.c @@ -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); diff --git a/apps/silcd/testi2.conf b/apps/silcd/testi2.conf index 11fea2da..f6818db1 100644 --- a/apps/silcd/testi2.conf +++ b/apps/silcd/testi2.conf @@ -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] -- 2.24.0