From 1bdf23d960536d352aaeefedff59d3c10d25d912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=81yszczek?= Date: Wed, 26 Aug 2020 02:02:36 +0200 Subject: [PATCH] master.js: fix missing response for /api/getID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to rfc2616#section-6: > After receiving and interpreting a request message, a server > responds with an HTTP response message. That response was missing for /api/getID which could lead to EMFILE, because needle module was waiting indefiniately for response from server. Since client sends /api/getID once every 10 seconds, this piles up, ultimately reaching ulimit for opened file descriptors. Signed-off-by: Michał Łyszczek --- master.js | 1 + 1 file changed, 1 insertion(+) diff --git a/master.js b/master.js index 38285a79..95fc61a5 100644 --- a/master.js +++ b/master.js @@ -329,6 +329,7 @@ app.post("/api/getID", authenticate.middleware, function(req,res) { } // console.log("Slave registered: " + slaves[req.body.unique].mac + " : " + slaves[req.body.unique].serverPort+" at " + slaves[req.body.unique].publicIP + " with name " + slaves[req.body.unique].instanceName); } + res.sendStatus(200); }); /** POST Allows you to add metadata related to slaves for other tools, like owner data, descriptions or statistics.