From 7e24a05cba2373c0ab1f0629366b664a593f357f Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 11 Oct 2010 16:00:36 -0700 Subject: [PATCH] Fix test-http-buffer-sanity --- lib/http.js | 3 +-- lib/net.js | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/http.js b/lib/http.js index 5ab28cb177..463184e148 100755 --- a/lib/http.js +++ b/lib/http.js @@ -322,7 +322,7 @@ OutgoingMessage.prototype._send = function (data, encoding) { } this._headerSent = true; } - this._writeRaw(data, encoding); + return this._writeRaw(data, encoding); }; OutgoingMessage.prototype._writeRaw = function(data, encoding) { @@ -347,7 +347,6 @@ OutgoingMessage.prototype._writeRaw = function(data, encoding) { }; OutgoingMessage.prototype._buffer = function (data, encoding) { - // Buffer if (data.length === 0) return; var length = this.output.length; diff --git a/lib/net.js b/lib/net.js index 0b9426cd56..de9f840b27 100644 --- a/lib/net.js +++ b/lib/net.js @@ -665,7 +665,8 @@ Stream.prototype.write = function (data, encoding, fd) { } if (typeof data == 'string' && - this._writeQueueEncoding.length && + this._writeQueue.length && + typeof this._writeQueue[this._writeQueue.length-1] === 'string' && this._writeQueueEncoding[this._writeQueueEncoding.length-1] === encoding) { // optimization - concat onto last this._writeQueue[this._writeQueue.length-1] += data;