From 13d7faa33566bc59020cc4c01a6362d2323033cf Mon Sep 17 00:00:00 2001 From: Darren Date: Mon, 29 Oct 2012 20:00:22 +0000 Subject: [PATCH] Server: max_client_conns = 0 to disable limit --- config.js | 2 +- server/weblistener.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config.js b/config.js index ed20689..57aaf6c 100644 --- a/config.js +++ b/config.js @@ -32,7 +32,7 @@ conf.servers.push({ // Where the client files are conf.public_http = "client/"; -// Max connections per connection +// Max connections per connection. 0 to disable conf.max_client_conns = 5; // Enabled CAP extensions (See ENTER URL TO CAP INFO HERE PLS) diff --git a/server/weblistener.js b/server/weblistener.js index c814764..5e893e3 100644 --- a/server/weblistener.js +++ b/server/weblistener.js @@ -119,10 +119,13 @@ function authoriseConnection(handshakeData, callback) { handshakeData.real_address = address; - if (global.clients.numOnAddress(address) + 1 > config.get().max_client_conns) { - return callback(null, false); + // If enabled, don't go over the connection limit + if (config.get().max_client_conns && config.get().max_client_conns > 0) { + if (global.clients.numOnAddress(address) + 1 > config.get().max_client_conns) { + return callback(null, false); + } } - + dns.reverse(address, function (err, domains) { if (err || domains.length === 0) { handshakeData.revdns = address; -- 2.25.1