Permalink
Browse files

Added clearTimeout on socket 'drain' to support streaming (eg static …

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

0 comments on commit 3099468

Please sign in to comment.