From faac40ffe77cebd36ddbc661dff0f7ccbd1cee57 Mon Sep 17 00:00:00 2001 From: dev-313 Date: Tue, 12 Nov 2019 16:35:53 +0530 Subject: [PATCH 1/2] doc: improve doc Http2Stream: FrameError, Timeout and Trailers Add line in doc/http2.md for 'frameError', 'timeout', 'trailers' events which tell readers that these events except any arguments or doesn't. Fixes: https://github.com/nodejs/help/issues/877 --- doc/api/http2.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index 53461ac58d4605..381c341a56ec39 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -970,6 +970,11 @@ an `Http2Stream`. added: v8.4.0 --> +* `type` {integer} The frame type. +* `code` {integer} The error code. +* `id` {integer} The stream id (or `0` if the frame isn't associated with a + stream). + The `'frameError'` event is emitted when an error occurs while attempting to send a frame. When invoked, the handler function will receive an integer argument identifying the frame type, and an integer argument identifying the @@ -984,6 +989,7 @@ added: v8.4.0 The `'timeout'` event is emitted after no activity is received for this `Http2Stream` within the number of milliseconds set using `http2stream.setTimeout()`. +Its listener does not expect any arguments. #### Event: 'trailers' The `'trailers'` event is emitted when a block of headers associated with -trailing header fields is received. The listener callback is passed the +trailing header fields is received. Its listener does not expect any arguments. +The listener callback is passed the [HTTP/2 Headers Object][] and flags associated with the headers. This event might not be emitted if `http2stream.end()` is called From c91ba691ae7e5e204dcd57857dfeff2e413e4d4a Mon Sep 17 00:00:00 2001 From: dev-313 Date: Tue, 12 Nov 2019 22:56:44 +0530 Subject: [PATCH 2/2] doc: improve doc Http2Stream: Trailers Add arguments in doc/http2.md for 'trailers' event which tell readers that 'trailers' event except arguments. Fixes: https://github.com/nodejs/help/issues/877 --- doc/api/http2.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index 381c341a56ec39..c8f29cd4ca59d9 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -996,9 +996,11 @@ Its listener does not expect any arguments. added: v8.4.0 --> +* `headers` {HTTP/2 Headers Object} An object describing the headers +* `flags` {number} The associated numeric flags + The `'trailers'` event is emitted when a block of headers associated with -trailing header fields is received. Its listener does not expect any arguments. -The listener callback is passed the +trailing header fields is received. The listener callback is passed the [HTTP/2 Headers Object][] and flags associated with the headers. This event might not be emitted if `http2stream.end()` is called