Skip to content

Commit

Permalink
Fixes memory leak when clients abort connections
Browse files Browse the repository at this point in the history
  • Loading branch information
c4milo committed Nov 16, 2011
1 parent c5dc929 commit c98ccb4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/node-http-proxy/http-proxy.js
Expand Up @@ -326,6 +326,13 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
}
});

//Aborts reverseProxy if client aborts the connection.
req.on('close', function () {
if (!errState) {
reverseProxy.abort();
}
});

//
// If we have been passed buffered data, resume it.
//
Expand Down

0 comments on commit c98ccb4

Please sign in to comment.