Skip to content

Node.js based forum software built for the modern web

fix workerIndex for ipv6

barisusakli14a2db4b2e58
diff --git a/loader.js b/loader.js
index 839aaecaa7..68d67db1e0 100644
--- a/loader.js
+++ b/loader.js
@@ -251,11 +251,11 @@ function forkWorker(isPrimary) {
function workerIndex(ip, numProcs) {
var s = '';
for (var i = 0, _len = ip.length; i < _len; i++) {
- if (ip[i] !== '.') {
+ if (parseInt(ip[i], 10)) {
s += ip[i];
}
}
- return Number(s) % numProcs;
+ return Number(s) % numProcs || 0;
}
function clusterWorkers() {