fix socket error handler event listener leak
This commit is contained in:
parent
fe89dc3783
commit
4e4fcfc642
1 changed files with 3 additions and 1 deletions
|
@ -125,7 +125,9 @@ app.callback = function(){
|
||||||
return function(req, res){
|
return function(req, res){
|
||||||
var ctx = new self.Context(self, req, res);
|
var ctx = new self.Context(self, req, res);
|
||||||
|
|
||||||
|
if (!~ctx.socket.listeners('error').indexOf(onerror)) {
|
||||||
ctx.socket.on('error', onerror);
|
ctx.socket.on('error', onerror);
|
||||||
|
}
|
||||||
|
|
||||||
function done(err) {
|
function done(err) {
|
||||||
if (err) ctx.onerror(err);
|
if (err) ctx.onerror(err);
|
||||||
|
|
Loading…
Reference in a new issue