diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-10-26 09:04:39 +0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-10-26 12:10:18 +0400 |
commit | 2470d2ee92b162ebcc4eda68958769715c3d17fb (patch) | |
tree | ec2c5b0039eb7652e12bf48101db9204ca6c3ccb /lib/http.js | |
parent | a7b4af0ae5408c96020e79c224e17891f836c28a (diff) |
allowHalfOpen disabled by default
Users too often would forget to add
socket.on('end', function () {
socket.end();
});
Which is a mistake. Therefore we default to this behavior and
only optionally let people handle the 'end' case themselves.
Diffstat (limited to 'lib/http.js')
-rwxr-xr-x | lib/http.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/http.js b/lib/http.js index 50bc6f16d08..d561058b793 100755 --- a/lib/http.js +++ b/lib/http.js @@ -743,9 +743,9 @@ function httpSocketSetup (socket) { function Server (requestListener) { if (!(this instanceof Server)) return new Server(requestListener); - net.Server.call(this); + net.Server.call(this, { allowHalfOpen: true }); - if(requestListener){ + if (requestListener) { this.addListener("request", requestListener); } @@ -877,7 +877,7 @@ function connectionListener (socket) { function Client ( ) { if (!(this instanceof Client)) return new Client(); - net.Stream.call(this); + net.Stream.call(this, { allowHalfOpen: true }); var self = this; httpSocketSetup(self); |