Skip to content

Commit 9cd30dd

Browse files
http2: address review feedback
1 parent 613734e commit 9cd30dd

2 files changed

Lines changed: 2 additions & 15 deletions

File tree

‎src/node_http2.cc‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,10 +1067,7 @@ int Http2Session::OnBeginHeadersCallback(nghttp2_session* handle,
10671067
// whose JS wrapper (and onread) is never installed.
10681068
if (session->is_closing()) {
10691069
nghttp2_submit_rst_stream(
1070-
session->session(),
1071-
NGHTTP2_FLAG_NONE,
1072-
id,
1073-
NGHTTP2_CANCEL);
1070+
session->session(), NGHTTP2_FLAG_NONE, id, NGHTTP2_REFUSED_STREAM);
10741071
return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
10751072
}
10761073
if (!session->CanAddStream() ||
@@ -1536,16 +1533,6 @@ void Http2StreamListener::OnStreamRead(ssize_t nread, const uv_buf_t& buf) {
15361533
return;
15371534
}
15381535

1539-
// Streams created after a deferred session close may never get a JS
1540-
// wrapper (handle.onread is only set in Http2Stream[kInit]). Drop the
1541-
// chunk instead of asserting in CallJSOnreadMethod.
1542-
Local<Value> onread =
1543-
stream->object()
1544-
->GetInternalField(StreamBase::kOnReadFunctionField)
1545-
.As<Value>();
1546-
if (!onread->IsFunction())
1547-
return;
1548-
15491536
Local<ArrayBuffer> ab;
15501537
if (session->stream_buf_ab_.IsEmpty()) {
15511538
ab = ArrayBuffer::New(env->isolate(),

‎test/parallel/test-http2-session-destroy-stream-handler.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ server.listen(0, '127.0.0.1', common.mustCall(() => {
5757
};
5858

5959
round();
60-
}));
60+
}));

0 commit comments

Comments
 (0)