From 9ce00774c6ed746fa8809580016e81ebfeb38cfd Mon Sep 17 00:00:00 2001 From: librelois <elois@ifee.fr> Date: Fri, 8 Dec 2017 21:23:45 +0100 Subject: [PATCH] [fix] replace hardcoded max ws2p quota by constant --- app/modules/ws2p/lib/WS2PServer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/modules/ws2p/lib/WS2PServer.ts b/app/modules/ws2p/lib/WS2PServer.ts index bf5903076..010a435eb 100644 --- a/app/modules/ws2p/lib/WS2PServer.ts +++ b/app/modules/ws2p/lib/WS2PServer.ts @@ -139,7 +139,7 @@ export class WS2PServer extends events.EventEmitter { async removeExcessIncomingConnections() { await this.removeDuplicateConnections() - const ws2pPublicMax = (this.server.conf.ws2p && this.server.conf.ws2p.maxPublic) ? this.server.conf.ws2p.maxPublic:10 + const ws2pPublicMax = (this.server.conf.ws2p && this.server.conf.ws2p.maxPublic) ? this.server.conf.ws2p.maxPublic:WS2PConstants.MAX_LEVEL_2_PEERS let privilegedKeys = (this.server.conf.ws2p && this.server.conf.ws2p.privilegedNodes) ? this.server.conf.ws2p.privilegedNodes:[] while (this.countConnexions() > ws2pPublicMax) { await this.removeLowPriorityConnection(privilegedKeys) -- GitLab