From 4a0f27656d645f6eda5632214ab7d9f4956cba9d Mon Sep 17 00:00:00 2001 From: Ouyang Yadong Date: Wed, 17 Oct 2018 00:44:49 +0800 Subject: [PATCH] http2: add Http2Stream.bufferSize This commit adds `bufferSize` for `Http2Stream`. Refs: https://github.com/nodejs/node/issues/21631 PR-URL: https://github.com/nodejs/node/pull/23711 Reviewed-By: James M Snell --- doc/api/http2.md | 10 +++ lib/internal/http2/core.js | 6 ++ test/parallel/test-http2-buffersize.js | 51 +++++++++++++ .../test-tls-streamwrap-buffersize.js | 72 +++++++++++++++++++ 4 files changed, 139 insertions(+) create mode 100644 test/parallel/test-http2-buffersize.js create mode 100644 test/parallel/test-tls-streamwrap-buffersize.js diff --git a/doc/api/http2.md b/doc/api/http2.md index f3314695cfcc02..2cd39437362326 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -1012,6 +1012,15 @@ added: v8.4.0 Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, the `'aborted'` event will have been emitted. +#### http2stream.bufferSize + +* {number} + +This property shows the number of characters currently buffered to be written. +See [`net.Socket.bufferSize`][] for details. + #### http2stream.close(code[, callback])