From 64d0e328e8a03251223dcbba8c4cc92319036d16 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 3 Mar 2010 12:41:31 -0800 Subject: [PATCH] Remove unused EventEmitter object --- lib/http.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/http.js b/lib/http.js index d9eab022ee..109351371d 100644 --- a/lib/http.js +++ b/lib/http.js @@ -317,10 +317,6 @@ ClientRequest.prototype.close = function () { function createIncomingMessageStream (connection, incoming_listener) { - var stream = new events.EventEmitter(); - - stream.addListener("incoming", incoming_listener); - var incoming, field, value; connection.addListener("messageBegin", function () { @@ -372,7 +368,7 @@ function createIncomingMessageStream (connection, incoming_listener) { incoming.statusCode = info.statusCode; } - stream.emit("incoming", incoming, info.should_keep_alive); + incoming_listener(incoming, info.should_keep_alive); }); connection.addListener("body", function (chunk) { @@ -382,8 +378,6 @@ function createIncomingMessageStream (connection, incoming_listener) { connection.addListener("messageComplete", function () { incoming.emit('end'); }); - - return stream; } /* Returns true if the message queue is finished and the connection