From 7e352fcc207bd4dd0cb12fc66eee5418f06a4122 Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Mon, 4 Jun 2012 21:34:57 -0700 Subject: [PATCH] rlgwebd.js: fix reference error httpServer needs to be in the global scope so shutdown() can find it. --- rlgwebd.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rlgwebd.js b/rlgwebd.js index 88532ba..e8bfaee 100755 --- a/rlgwebd.js +++ b/rlgwebd.js @@ -689,6 +689,8 @@ if (process.getuid() != 0) { process.exit(1); } +var httpServer; // declare here so shutdown() can find it + /* Open the control socket before chrooting where it can't be found */ var ctlServer = net.createServer(function (sock) { sock.on('data', conHandler); @@ -719,7 +721,7 @@ ctlServer.listen(ctlsocket, function () { tslog("Could not drop permissions: %s", err); process.exit(1); } - var httpServer = http.createServer(webHandler); + httpServer = http.createServer(webHandler); httpServer.listen(8080, "127.0.0.1"); tslog('rlgwebd running at http://127.0.0.1:8080/'); });