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){
|
||||
var ctx = new self.Context(self, req, res);
|
||||
|
||||
ctx.socket.on('error', onerror);
|
||||
if (!~ctx.socket.listeners('error').indexOf(onerror)) {
|
||||
ctx.socket.on('error', onerror);
|
||||
}
|
||||
|
||||
function done(err) {
|
||||
if (err) ctx.onerror(err);
|
||||
|
|
Loading…
Reference in a new issue