0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 15:06:33 +01:00

HTTP Server: check the ready state of the connection before each send.

This commit is contained in:
Ryan 2009-05-18 14:02:50 +02:00
parent 310eed03e0
commit 9c70bf356b

View File

@ -72,6 +72,12 @@ node.http.Server = function (RequestHandler, options) {
// is wasteful. *I think* its rather faster to concat inside of JS
// Thus I attempt to concat as much as possible.
function send (data) {
if (connection.readyState === "closed" || connection.readyState === "readOnly")
{
responses = [];
return;
}
if (output.length == 0) {
output.push(data);
return;
@ -267,7 +273,8 @@ node.http.Server = function (RequestHandler, options) {
};
}
this.__proto__.__proto__ = new node.http.LowLevelServer(ConnectionHandler, options);
this.__proto__.__proto__ =
new node.http.LowLevelServer(ConnectionHandler, options);
};
node.http.Client = function (port, host) {