summaryrefslogtreecommitdiff
path: root/lib/_http_outgoing.js
diff options
context:
space:
mode:
authorRobert Nagy <ronagy@icloud.com>2019-08-06 15:30:06 +0200
committerRich Trott <rtrott@gmail.com>2019-08-10 18:59:10 -0700
commitbd857084de75815d0d60d4a7dd4897dfc9e6cdec (patch)
tree3646acb263fe3f4d47f47a5907170f6be46dc060 /lib/_http_outgoing.js
parent83495e778319603c3ed61e31d37dc9715df14329 (diff)
downloadandroid-node-v8-bd857084de75815d0d60d4a7dd4897dfc9e6cdec.tar.gz
android-node-v8-bd857084de75815d0d60d4a7dd4897dfc9e6cdec.tar.bz2
android-node-v8-bd857084de75815d0d60d4a7dd4897dfc9e6cdec.zip
http: add missing stream-like properties to OutgoingMessage
PR-URL: https://github.com/nodejs/node/pull/29018 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'lib/_http_outgoing.js')
-rw-r--r--lib/_http_outgoing.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js
index e10f068f32..9477a9b7f7 100644
--- a/lib/_http_outgoing.js
+++ b/lib/_http_outgoing.js
@@ -112,7 +112,7 @@ Object.setPrototypeOf(OutgoingMessage.prototype, Stream.prototype);
Object.setPrototypeOf(OutgoingMessage, Stream);
Object.defineProperty(OutgoingMessage.prototype, 'writableFinished', {
- get: function() {
+ get() {
return (
this.finished &&
this.outputSize === 0 &&
@@ -121,6 +121,24 @@ Object.defineProperty(OutgoingMessage.prototype, 'writableFinished', {
}
});
+Object.defineProperty(OutgoingMessage.prototype, 'writableObjectMode', {
+ get() {
+ return false;
+ }
+});
+
+Object.defineProperty(OutgoingMessage.prototype, 'writableLength', {
+ get() {
+ return this.outputSize + (this.socket ? this.socket.writableLength : 0);
+ }
+});
+
+Object.defineProperty(OutgoingMessage.prototype, 'writableHighWaterMark', {
+ get() {
+ return this.socket ? this.socket.writableHighWaterMark : HIGH_WATER_MARK;
+ }
+});
+
Object.defineProperty(OutgoingMessage.prototype, '_headers', {
get: internalUtil.deprecate(function() {
return this.getHeaders();