misc fixes.

This commit is contained in:
Christopher Jeffrey 2016-02-22 23:31:05 -08:00
parent 1ced7af7b4
commit 5923726e78
2 changed files with 33 additions and 28 deletions

View File

@ -256,7 +256,6 @@ HTTPServer.prototype._initRouter = function _initRouter() {
return done(new Error('No routes found.')); return done(new Error('No routes found.'));
(function next() { (function next() {
utils.nextTick(function() {
var route, path, callback, compiled, matched; var route, path, callback, compiled, matched;
if (i === routes.length) if (i === routes.length)
@ -284,6 +283,8 @@ HTTPServer.prototype._initRouter = function _initRouter() {
req.params[i] = item; req.params[i] = item;
}); });
// Avoid stack overflows
utils.nextTick(function() {
try { try {
callback(req, res, next, _send); callback(req, res, next, _send);
} catch (e) { } catch (e) {

View File

@ -1421,7 +1421,11 @@ utils.ccmp = function(a, b) {
var res = 0; var res = 0;
var i; var i;
assert(a.length === b.length); assert(Buffer.isBuffer(a));
assert(Buffer.isBuffer(b));
if (a.length !== b.length)
return false;
for (i = 0; i < a.length; i++) for (i = 0; i < a.length; i++)
res |= a[i] ^ b[i]; res |= a[i] ^ b[i];