diff options
author | Timo Sirainen <cras@irssi.org> | 2000-09-27 00:25:26 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-09-27 00:25:26 +0000 |
commit | b6de29afbd9a7ddc3e9f10c7bf52b19190df3dd0 (patch) | |
tree | 9d1dfef0d06ef0e8e5875b31147c220121124ea2 /src | |
parent | 833bf37831325d2da3c345d253a38c6b33063cd1 (diff) | |
download | irssi-b6de29afbd9a7ddc3e9f10c7bf52b19190df3dd0.zip |
/SERVER irc.server.org 1234 now connects to port 1234 always even if
some other port is specified for the same server in setup.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@682 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/core/servers-setup.c | 7 | ||||
-rw-r--r-- | src/core/servers.c | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/core/servers-setup.c b/src/core/servers-setup.c index 3faf76b6..9e8a1c66 100644 --- a/src/core/servers-setup.c +++ b/src/core/servers-setup.c @@ -103,7 +103,7 @@ static void server_setup_fill(SERVER_CONNECT_REC *conn, conn->type = module_get_uniq_id("SERVER CONNECT", 0); conn->address = g_strdup(address); - conn->port = port > 0 ? port : 6667; + if (port > 0) conn->port = port; if (!conn->nick) conn->nick = g_strdup(settings_get_str("nick")); conn->username = g_strdup(settings_get_str("user_name")); @@ -132,7 +132,8 @@ static void server_setup_fill_server(SERVER_CONNECT_REC *conn, sserver->last_connect = time(NULL); - if (sserver->port > 0) conn->port = sserver->port; + if (sserver->port > 0 && conn->port <= 0) + conn->port = sserver->port; server_setup_fill_reconn(conn, sserver); signal_emit("server setup fill server", 2, conn, sserver); @@ -304,7 +305,7 @@ static SERVER_SETUP_REC *server_setup_read(CONFIG_NODE *node) if (server == NULL) return NULL; - port = config_node_get_int(node, "port", 6667); + port = config_node_get_int(node, "port", 0); if (server_setup_find_port(server, port) != NULL) { /* already exists - don't let it get there twice or server reconnects will screw up! */ diff --git a/src/core/servers.c b/src/core/servers.c index 2abc7434..d857de13 100644 --- a/src/core/servers.c +++ b/src/core/servers.c @@ -204,12 +204,12 @@ int server_start_connect(SERVER_REC *server) const char *connect_address; g_return_val_if_fail(server != NULL, FALSE); + if (server->connrec->port <= 0) return FALSE; MODULE_DATA_INIT(server); server->type = module_get_uniq_id("SERVER", 0); server->nick = g_strdup(server->connrec->nick); - if (server->connrec->port <= 0) server->connrec->port = 6667; if (server->connrec->username == NULL || *server->connrec->username == '\0') { g_free_not_null(server->connrec->username); |