|
@ -317,10 +317,6 @@ ClientRequest.prototype.close = function () { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function createIncomingMessageStream (connection, incoming_listener) { |
|
|
function createIncomingMessageStream (connection, incoming_listener) { |
|
|
var stream = new events.EventEmitter(); |
|
|
|
|
|
|
|
|
|
|
|
stream.addListener("incoming", incoming_listener); |
|
|
|
|
|
|
|
|
|
|
|
var incoming, field, value; |
|
|
var incoming, field, value; |
|
|
|
|
|
|
|
|
connection.addListener("messageBegin", function () { |
|
|
connection.addListener("messageBegin", function () { |
|
@ -372,7 +368,7 @@ function createIncomingMessageStream (connection, incoming_listener) { |
|
|
incoming.statusCode = info.statusCode; |
|
|
incoming.statusCode = info.statusCode; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
stream.emit("incoming", incoming, info.should_keep_alive); |
|
|
incoming_listener(incoming, info.should_keep_alive); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
connection.addListener("body", function (chunk) { |
|
|
connection.addListener("body", function (chunk) { |
|
@ -382,8 +378,6 @@ function createIncomingMessageStream (connection, incoming_listener) { |
|
|
connection.addListener("messageComplete", function () { |
|
|
connection.addListener("messageComplete", function () { |
|
|
incoming.emit('end'); |
|
|
incoming.emit('end'); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
return stream; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* Returns true if the message queue is finished and the connection |
|
|
/* Returns true if the message queue is finished and the connection |
|
|