From: Pekka Riikonen Date: Wed, 14 Feb 2001 15:31:33 +0000 (+0000) Subject: Do not allow several server connections. X-Git-Tag: SILC.0.1~228 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=44d77402af6395a687621dc0ec6f77a9576450ef;p=silc.git Do not allow several server connections. --- diff --git a/CHANGES b/CHANGES index 81ad9c49..b214f5f5 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,13 @@ Wed Feb 14 16:03:25 EET 2001 Pekka Riikonen * Sort the ID Cache in client library when the ID Cache data has changed (needs sorting). + * Do not allow for SILC client to create several connections to + several servers. The client does not support windows right now + and generating multiple connections causes weird behaviour. + + Irssi-silc client does support windows and can handle several + connections without problems, see: www.irssi.org and SILC plugin. + Tue Feb 13 19:55:59 EET 2001 Pekka Riikonen * Added --with-gmp configuration option. If set the GMP diff --git a/apps/silc/local_command.c b/apps/silc/local_command.c index 110a8eb8..56e36da4 100644 --- a/apps/silc/local_command.c +++ b/apps/silc/local_command.c @@ -20,6 +20,9 @@ /* * $Id$ * $Log$ + * Revision 1.3 2001/02/14 15:31:33 priikone + * Do not allow several server connections. + * * Revision 1.2 2001/01/30 21:40:21 priikone * updates. * @@ -204,6 +207,17 @@ SILC_CLIENT_LCMD_FUNC(server) port = 706; } + if (conn && conn->remote_host) { + if (!strcmp(hostname, conn->remote_host) && port == conn->remote_port) { + silc_say(client, conn, "You are already connected to that server"); + goto out; + } + + /* Close connection */ + cmd->client->ops->disconnect(cmd->client, cmd->conn); + silc_client_close_connection(cmd->client, cmd->conn->sock); + } + /* Connect asynchronously to not to block user interface */ silc_client_connect_to_server(cmd->client, port, hostname, NULL);