From 8ae445ce01e21a4de50bd1f446f53923a71160f3 Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Sat, 30 Mar 2013 21:38:24 +0000 Subject: [PATCH] Also check ip_as_username config when applying per-server limit --- config.example.js | 5 ++++- server/irc/state.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config.example.js b/config.example.js index 03f73cc..3a413a3 100644 --- a/config.example.js +++ b/config.example.js @@ -54,7 +54,10 @@ conf.public_http = "client/"; conf.max_client_conns = 5; // Max connections per server. 0 to disable. -// Setting is ignored if there is a WEBIRC password configured for the server or kiwi is running in restricted server mode. +// Setting is ignored if: +// - There is a WEBIRC password configured for the server, +// - Kiwi is configured to send the client's ip as a username for the server, or +// - Kiwi is running in restricted server mode. conf.max_server_conns = 0; diff --git a/server/irc/state.js b/server/irc/state.js index 9e7c8d7..4b368c1 100755 --- a/server/irc/state.js +++ b/server/irc/state.js @@ -41,6 +41,7 @@ State.prototype.connect = function (hostname, port, ssl, nick, user, pass, callb if ((global.config.max_server_conns > 0) && (!global.config.restrict_server) && (!(global.config.webirc_pass && global.config.webirc_pass[hostname])) && + (!(global.config.ip_as_username && _.contains(global.config.ip_as_username, hostname))) && (global.servers.numOnHost(hostname) >= global.config.max_server_conns)) { return callback('Too many connections to host', {host: hostname, limit: global.config.max_server_conns}); -- 2.25.1