Skip to content

Commit 15d6e5a

Browse files
santigimenoTrott
authored andcommitted
Revert "src: let http2 streams end after session close"
This reverts commit dee882e. Moved the test that demonstrated what this commit was fixing to the `known_issues` folder. Fixes: nodejs#46234
1 parent b4a962d commit 15d6e5a

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

src/node_http2.cc

-11
Original file line numberDiff line numberDiff line change
@@ -1124,17 +1124,6 @@ int Http2Session::OnStreamClose(nghttp2_session* handle,
11241124
if (!stream || stream->is_destroyed())
11251125
return 0;
11261126

1127-
// Don't close synchronously in case there's pending data to be written. This
1128-
// may happen when writing trailing headers.
1129-
if (code == NGHTTP2_NO_ERROR && nghttp2_session_want_write(handle) &&
1130-
env->can_call_into_js()) {
1131-
env->SetImmediate([handle, id, code, user_data](Environment* env) {
1132-
OnStreamClose(handle, id, code, user_data);
1133-
});
1134-
1135-
return 0;
1136-
}
1137-
11381127
stream->Close(code);
11391128

11401129
// It is possible for the stream close to occur before the stream is

test/parallel/test-http2-trailers-after-session-close.js test/known_issues/test-http2-trailers-after-session-close.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
'use strict';
22

3+
// Fixes: https://github.com/nodejs/node/issues/42713
34
const common = require('../common');
4-
if (!common.hasCrypto)
5-
common.skip('missing crypto');
5+
if (!common.hasCrypto) {
6+
// Change require('assert').fail to common.skip when issue is fixed and test
7+
// is moved out of the known_issues directory
8+
require('assert').fail('missing crypto');
9+
}
610
const assert = require('assert');
711
const http2 = require('http2');
812

@@ -31,7 +35,7 @@ server.listen(0, common.mustCall(() => {
3135
client.socket.on('close', common.mustCall());
3236
const req = client.request({
3337
[HTTP2_HEADER_PATH]: '/',
34-
[HTTP2_HEADER_METHOD]: 'POST'
38+
[HTTP2_HEADER_METHOD]: 'POST',
3539
});
3640
req.end();
3741
req.on('response', common.mustCall());

0 commit comments

Comments
 (0)