mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-13 12:37:17 +08:00
Fixed crashes
This commit is contained in:
@@ -25,8 +25,6 @@ module.exports.loadConfig = function(basepath, server, fn) {
|
||||
, src = {}
|
||||
, error;
|
||||
|
||||
var $DEBUGTRACE = false;
|
||||
|
||||
server.__resourceCache = null;
|
||||
|
||||
if(resources.length) {
|
||||
@@ -49,12 +47,6 @@ module.exports.loadConfig = function(basepath, server, fn) {
|
||||
remaining = -1;
|
||||
finished = true;
|
||||
|
||||
if ($DEBUGTRACE) {
|
||||
console.log("First trace", $DEBUGTRACE);
|
||||
console.trace("Current trace");
|
||||
}
|
||||
$DEBUGTRACE = new Error().stack;
|
||||
|
||||
var InternalResources = require('./resources/internal-resources');
|
||||
|
||||
debug('done, adding internals');
|
||||
|
||||
@@ -36,6 +36,12 @@ Router.prototype.route = function (req, res) {
|
||||
, i = 0
|
||||
, globals = 0;
|
||||
|
||||
if (req._routed) {
|
||||
return;
|
||||
}
|
||||
|
||||
req._routed = true;
|
||||
|
||||
function next() {
|
||||
globals++;
|
||||
return function() {
|
||||
|
||||
@@ -52,9 +52,6 @@ function Server(options) {
|
||||
var server = this;
|
||||
http.Server.call(this);
|
||||
|
||||
var $DEBUGSTREAM = fs.createWriteStream("crashes.log", {flags: 'r+'})
|
||||
, $CRASHES = 0;
|
||||
|
||||
// defaults
|
||||
this.options = options = extend({
|
||||
port: 2403,
|
||||
@@ -81,7 +78,6 @@ function Server(options) {
|
||||
var keys = this.keys = new Keys();
|
||||
|
||||
this.on('request', function (req, res) {
|
||||
$DEBUGSTREAM.write(req.method + " " + req.url + "\r\n");
|
||||
|
||||
if(req.url.indexOf('/socket.io/') === 0) return;
|
||||
|
||||
@@ -109,14 +105,6 @@ function Server(options) {
|
||||
}
|
||||
var router = new Router(resourcesInstances, server);
|
||||
server.router = router;
|
||||
|
||||
if (res.$DEBUGFLAG) {
|
||||
$DEBUGSTREAM.write("CRASH on " + req.method + " " + req.url + "\r\n");
|
||||
$CRASHES++;
|
||||
console.log("Crashes: ", $CRASHES);
|
||||
return;
|
||||
}
|
||||
res.$DEBUGFLAG = true;
|
||||
|
||||
server.resources = resourcesInstances;
|
||||
router.route(req, res);
|
||||
|
||||
Reference in New Issue
Block a user