diff options
author | Bert Belder <bertbelder@gmail.com> | 2011-01-05 02:41:59 +0300 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2011-01-05 02:41:59 +0300 |
commit | 3c330b05b10ffabe1b45d06efadc1f4e49830dc7 (patch) | |
tree | fd000a35785793332a3b9490ae55c50b4d91ba3a /lib/http.js | |
parent | c3ffbf219ca8049c901ec58d4d4b3df5b96c5097 (diff) | |
parent | 131546e7339d6960ea91629915468c6f04a33cf7 (diff) |
Merge branch 'master' of git://github.com/ry/node
Conflicts:
src/node.cc
src/node.js
Diffstat (limited to 'lib/http.js')
-rw-r--r-- | lib/http.js | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/http.js b/lib/http.js index 0b4a0e2212f..960d28aaa36 100644 --- a/lib/http.js +++ b/lib/http.js @@ -6,8 +6,7 @@ var HTTPParser = process.binding('http_parser').HTTPParser; var debug; -var debugLevel = parseInt(process.env.NODE_DEBUG, 16); -if (debugLevel & 0x4) { +if (process.env.NODE_DEBUG && /http/.test(process.env.NODE_DEBUG)) { debug = function(x) { console.error('HTTP: %s', x); }; } else { debug = function() { }; @@ -734,13 +733,11 @@ function httpSocketSetup(socket) { // An array of outgoing messages for the socket. In pipelined connections // we need to keep track of the order they were sent. socket._outgoing = []; - socket.__destroyOnDrain = false; // NOTE: be sure not to use ondrain elsewhere in this file! socket.ondrain = function() { var message = socket._outgoing[0]; if (message) message.emit('drain'); - if (socket.__destroyOnDrain) socket.destroy(); }; } @@ -834,12 +831,7 @@ function connectionListener(socket) { if (message._last) { // No more messages to be pushed out. - // HACK: need way to do this with socket interface - if (socket._writeQueue.length) { - socket.__destroyOnDrain = true; //socket.end(); - } else { - socket.destroy(); - } + socket.destroySoon(); } else if (socket._outgoing.length) { // Push out the next message. @@ -872,6 +864,7 @@ function connectionListener(socket) { return false; // Not a HEAD response. (Not even a response!) }; } +exports._connectionListener = connectionListener; function Client() { |