90: pin buffer while stream write is pending, switch to direct byte buffer

Reviewed-by: kinsleyw
This commit is contained in:
akhil 2013-11-25 16:32:27 -08:00
parent 20bb10e9fd
commit 940e0ab530
3 changed files with 6 additions and 6 deletions

View File

@ -233,9 +233,9 @@
Pipe.prototype.writeBuffer = function(message) {
if (message._impl) message = message._impl; // unwrap if necessary
var wrapper = {bytes: message.array().length};
var wrapper = {bytes: message.underlying().length};
this._writeWrappers.push(wrapper);
this._pipe.write(message.array());
this._pipe.write(message.underlying());
return wrapper;
}

View File

@ -206,10 +206,10 @@
TCP.prototype.writeBuffer = function(data) {
if (data._impl) data = data._impl; // unwrap if necessary
var wrapper = {bytes: data.array().length};
var wrapper = {bytes: data.underlying().capacity()};
this._writeWrappers.push(wrapper);
Object.defineProperty(wrapper, '_socketHandle', { value: this.owner });
this._connection.write(data.array());
this._connection.write(data.underlying());
return wrapper;
}

View File

@ -94,9 +94,9 @@
TTY.prototype.writeBuffer = function(data) {
if (data._impl) data = data._impl; // unwrap if necessary
var wrapper = {bytes: data.array().length};
var wrapper = {bytes: data.underlying().capacity()};
this._writeWrappers.push(wrapper);
this._tty.write(data.array());
this._tty.write(data.underlying());
return wrapper;
}