rlgwebd.js: fix reference error

httpServer needs to be in the global scope so shutdown() can find it.
This commit is contained in:
John "Elwin" Edwards 2012-06-04 21:34:57 -07:00
parent bb17dd58a2
commit 7e352fcc20

View file

@ -689,6 +689,8 @@ if (process.getuid() != 0) {
process.exit(1); process.exit(1);
} }
var httpServer; // declare here so shutdown() can find it
/* Open the control socket before chrooting where it can't be found */ /* Open the control socket before chrooting where it can't be found */
var ctlServer = net.createServer(function (sock) { var ctlServer = net.createServer(function (sock) {
sock.on('data', conHandler); sock.on('data', conHandler);
@ -719,7 +721,7 @@ ctlServer.listen(ctlsocket, function () {
tslog("Could not drop permissions: %s", err); tslog("Could not drop permissions: %s", err);
process.exit(1); process.exit(1);
} }
var httpServer = http.createServer(webHandler); httpServer = http.createServer(webHandler);
httpServer.listen(8080, "127.0.0.1"); httpServer.listen(8080, "127.0.0.1");
tslog('rlgwebd running at http://127.0.0.1:8080/'); tslog('rlgwebd running at http://127.0.0.1:8080/');
}); });