Server: max_client_conns = 0 to disable limit
authorDarren <darren@darrenwhitlen.com>
Mon, 29 Oct 2012 20:00:22 +0000 (20:00 +0000)
committerDarren <darren@darrenwhitlen.com>
Mon, 29 Oct 2012 20:00:22 +0000 (20:00 +0000)
config.js
server/weblistener.js

index ed20689dc041ec19cccc72e0bb35a9da882fb9aa..57aaf6c6081da9d147f7e800c713f7800d7a8865 100644 (file)
--- 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)
index c8147649eb2e6505d6185d5c9f477c1b50c92e38..5e893e30cf135a622ed6757bbf884d87480da6b7 100644 (file)
@@ -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;