Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc,test: clarify that Http2Stream is destroyed after data is read #27891

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,9 @@ the value is `undefined`, the stream is not yet ready for use.

All [`Http2Stream`][] instances are destroyed either when:

* An `RST_STREAM` frame for the stream is received by the connected peer.
* The `http2stream.close()` method is called.
* An `RST_STREAM` frame for the stream is received by the connected peer,
and pending data has been read.
* The `http2stream.close()` method is called, and pending data has been read.
* The `http2stream.destroy()` or `http2session.destroy()` methods are called.

When an `Http2Stream` instance is destroyed, an attempt will be made to send an
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-http2-large-write-destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ server.listen(0, common.mustCall(() => {

const req = client.request({ ':path': '/' });
req.end();
req.resume(); // Otherwise close won't be emitted if there's pending data
mildsunrise marked this conversation as resolved.
Show resolved Hide resolved

req.on('close', common.mustCall(() => {
client.close();
Expand Down