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;
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});