Skip to content

Commit

Permalink
[debug] Added some debugging to figure out why AB wont complete a tes…
Browse files Browse the repository at this point in the history
…t with v0.2.0
  • Loading branch information
indexzero committed Sep 7, 2010
1 parent f291efb commit 9715ebd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/node-http-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,12 @@ var createProxy = function () {
sys.pump(req, reverse_proxy);

if (e) {
sys.puts('end outgoing request');
req.removeListener('end', e);
req.addListener('end', function () { reverse_proxy.end() });
req.addListener('end', function () {
sys.puts('request ended');
reverse_proxy.end()
});
}
else {
reverse_proxy.end();
Expand All @@ -121,6 +125,7 @@ var createProxy = function () {
response.addListener('end', function() {
server.emit('proxy', null, data);
});
sys.puts('response');

// Set the response headers of the client response
res.writeHead(response.statusCode, response.headers);
Expand Down

0 comments on commit 9715ebd

Please sign in to comment.