90: pin buffer while stream write is pending, switch to direct byte buffer
Reviewed-by: kinsleyw
This commit is contained in:
parent
20bb10e9fd
commit
940e0ab530
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user