Skip to content

Commit ae6f128

Browse files
http2: address review feedback
1 parent 5ef12f1 commit ae6f128

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

‎src/node_http2.cc‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,10 +1096,7 @@ int Http2Session::OnBeginHeadersCallback(nghttp2_session* handle,
10961096
// whose JS wrapper (and onread) is never installed.
10971097
if (session->is_closing()) {
10981098
nghttp2_submit_rst_stream(
1099-
session->session(),
1100-
NGHTTP2_FLAG_NONE,
1101-
id,
1102-
NGHTTP2_CANCEL);
1099+
session->session(), NGHTTP2_FLAG_NONE, id, NGHTTP2_REFUSED_STREAM);
11031100
return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
11041101
}
11051102
if (!session->CanAddStream() ||
@@ -1574,16 +1571,6 @@ void Http2StreamListener::OnStreamRead(ssize_t nread, const uv_buf_t& buf) {
15741571
return;
15751572
}
15761573

1577-
// Streams created after a deferred session close may never get a JS
1578-
// wrapper (handle.onread is only set in Http2Stream[kInit]). Drop the
1579-
// chunk instead of asserting in CallJSOnreadMethod.
1580-
Local<Value> onread =
1581-
stream->object()
1582-
->GetInternalField(StreamBase::kOnReadFunctionField)
1583-
.As<Value>();
1584-
if (!onread->IsFunction())
1585-
return;
1586-
15871574
Local<ArrayBuffer> ab;
15881575
if (session->stream_buf_ab_.IsEmpty()) {
15891576
ab = ArrayBuffer::New(env->isolate(),

0 commit comments

Comments
 (0)