Permalink
Browse files

Updated drain to fire only once (so we don't leak event listeners)

  • Loading branch information...
1 parent 3099468 commit e45833acc8d4d58fe015c73652406376c2f55cd1 Hunter Loftis committed Mar 4, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/middleware/timeout.js
@@ -43,7 +43,7 @@ module.exports = function timeout(options) {
req.socket.setTimeout(0);
};
- req.socket.on('drain', req.clearTimeout); // Clear whenever we send anything
+ req.socket.once('drain', req.clearTimeout); // Clear whenever we send anything
return next();
};

0 comments on commit e45833a

Please sign in to comment.