From 0adb700fd80f6a8d2b6f99f518c934b3a14a9602 Mon Sep 17 00:00:00 2001 From: Peter Dalgaard-Jensen Date: Fri, 19 Jan 2018 21:11:09 +0100 Subject: [PATCH 1/3] doc: improve callback documentation of http2Stream.pushstream() Improve documentation of callback signature of http2Stream.pushStream() function to align with the changes made in https://github.com/nodejs/node/pull/17406. Fixes: https://github.com/nodejs/node/issues/18198 Refs: https://github.com/nodejs/node/pull/17406 --- doc/api/http2.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index e79e46ac3e69b8..8ae13d1c8fc92a 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -1197,8 +1197,10 @@ added: v8.4.0 **Default:** `false` * `parent` {number} Specifies the numeric identifier of a stream the newly created stream is dependent on. -* `callback` {Function} Callback that is called once the push stream has been - initiated. +* `callback` {Function} Callback that is called once the push stream has been initiated. + * `err` {Error} + * `pushStream` {[`ServerHttp2Stream`][]} The returned pushStream object. + * `headers` {[Headers Object][]} Headers object the pushStream was initiated with. * Returns: {undefined} Initiates a push stream. The callback is invoked with the new `Http2Stream` @@ -1210,7 +1212,7 @@ const http2 = require('http2'); const server = http2.createServer(); server.on('stream', (stream) => { stream.respond({ ':status': 200 }); - stream.pushStream({ ':path': '/' }, (err, pushStream) => { + stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { if (err) throw err; pushStream.respond({ ':status': 200 }); pushStream.end('some pushed data'); From e0eb65c8196bb0126620ff180fbd0d0518466e16 Mon Sep 17 00:00:00 2001 From: Peter Dalgaard-Jensen Date: Fri, 19 Jan 2018 22:58:16 +0100 Subject: [PATCH 2/3] fix line length to wrap at 80chars --- doc/api/http2.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index 8ae13d1c8fc92a..a224e325ed77a6 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -1197,7 +1197,8 @@ added: v8.4.0 **Default:** `false` * `parent` {number} Specifies the numeric identifier of a stream the newly created stream is dependent on. -* `callback` {Function} Callback that is called once the push stream has been initiated. +* `callback` {Function} Callback that is called once the push stream has been +initiated. * `err` {Error} * `pushStream` {[`ServerHttp2Stream`][]} The returned pushStream object. * `headers` {[Headers Object][]} Headers object the pushStream was initiated with. From 6eac640c5cb71abae3504149ba1fd694a998deff Mon Sep 17 00:00:00 2001 From: Peter Dalgaard-Jensen Date: Fri, 19 Jan 2018 23:34:28 +0100 Subject: [PATCH 3/3] Trying to fix 80 char line wrapping --- doc/api/http2.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index a224e325ed77a6..e2f9aabfca53aa 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -1197,11 +1197,12 @@ added: v8.4.0 **Default:** `false` * `parent` {number} Specifies the numeric identifier of a stream the newly created stream is dependent on. -* `callback` {Function} Callback that is called once the push stream has been -initiated. +* `callback` {Function} Callback that is called once the push stream has been + initiated. * `err` {Error} * `pushStream` {[`ServerHttp2Stream`][]} The returned pushStream object. - * `headers` {[Headers Object][]} Headers object the pushStream was initiated with. + * `headers` {[Headers Object][]} Headers object the pushStream was initiated + with. * Returns: {undefined} Initiates a push stream. The callback is invoked with the new `Http2Stream`