changeset 29:cf9d294bc52f

rlgwebd.js: fix reference error httpServer needs to be in the global scope so shutdown() can find it.
author John "Elwin" Edwards <elwin@sdf.org>
date Mon, 04 Jun 2012 21:34:57 -0700
parents 2ad2b6491aa9
children b5570a594266
files rlgwebd.js
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rlgwebd.js	Mon Jun 04 20:45:27 2012 -0700
+++ b/rlgwebd.js	Mon Jun 04 21:34:57 2012 -0700
@@ -689,6 +689,8 @@
   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 @@
     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/'); 
 });