[minor] Listen to error events re-emitted by pool into the ClientRequest

This commit is contained in:
indexzero 2010-09-10 17:34:38 -04:00
parent 6d47d98f53
commit f8bff4c618

View File

@ -137,7 +137,7 @@ HttpProxy.prototype = {
}; };
// Add a listener for the connection timeout event // Add a listener for the connection timeout event
reverse_proxy.connection.addListener('error', error); reverse_proxy.addListener('error', error);
// Add a listener for the reverse_proxy response event // Add a listener for the reverse_proxy response event
reverse_proxy.addListener('response', function (response) { reverse_proxy.addListener('response', function (response) {
@ -173,7 +173,7 @@ HttpProxy.prototype = {
// At the end of the client request, we are going to stop the proxied request // At the end of the client request, we are going to stop the proxied request
req.addListener('end', function () { req.addListener('end', function () {
reverse_proxy.end(); reverse_proxy.end();
reverse_proxy.connection.removeListener('error', error); reverse_proxy.removeListener('error', error);
}); });
self.unwatch(req); self.unwatch(req);