Skip to content

Commit

Permalink
Fix ondrain. Kind of working.
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Nov 30, 2010
1 parent a261a24 commit 19264c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,8 @@ function connectionListener (socket) {
// 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();
if (socket._writeWatcher.firstBucket) {
socket._eof = true;
} else {
socket.destroy();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ IOWatcher.prototype.ondrain = function () {
this.socket.emit('drain');
}

if (this.writable && this.socket._eof) this.socket._shutdown();
if (this.socket._eof) this.socket._shutdown();
};


Expand Down

0 comments on commit 19264c1

Please sign in to comment.