nghttpx: Don't check HEADERS category in on_frame_not_send_callback
This commit is contained in:
parent
eb94603c51
commit
115d7133a0
|
@ -1122,24 +1122,24 @@ int on_frame_not_send_callback(nghttp2_session *session,
|
||||||
<< nghttp2_strerror(lib_error_code);
|
<< nghttp2_strerror(lib_error_code);
|
||||||
}
|
}
|
||||||
if (frame->hd.type == NGHTTP2_HEADERS &&
|
if (frame->hd.type == NGHTTP2_HEADERS &&
|
||||||
frame->headers.cat == NGHTTP2_HCAT_REQUEST) {
|
lib_error_code != NGHTTP2_ERR_STREAM_CLOSED &&
|
||||||
// To avoid stream hanging around, flag Downstream::MSG_RESET and
|
lib_error_code != NGHTTP2_ERR_STREAM_CLOSING) {
|
||||||
// terminate the upstream and downstream connections.
|
// To avoid stream hanging around, flag Downstream::MSG_RESET.
|
||||||
auto sd = static_cast<StreamData *>(
|
auto sd = static_cast<StreamData *>(
|
||||||
nghttp2_session_get_stream_user_data(session, frame->hd.stream_id));
|
nghttp2_session_get_stream_user_data(session, frame->hd.stream_id));
|
||||||
if (!sd) {
|
if (!sd) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (sd->dconn) {
|
if (!sd->dconn) {
|
||||||
auto downstream = sd->dconn->get_downstream();
|
return 0;
|
||||||
if (!downstream ||
|
|
||||||
downstream->get_downstream_stream_id() != frame->hd.stream_id) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
downstream->set_response_state(Downstream::MSG_RESET);
|
|
||||||
call_downstream_readcb(http2session, downstream);
|
|
||||||
}
|
}
|
||||||
http2session->remove_stream_data(sd);
|
auto downstream = sd->dconn->get_downstream();
|
||||||
|
if (!downstream ||
|
||||||
|
downstream->get_downstream_stream_id() != frame->hd.stream_id) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
downstream->set_response_state(Downstream::MSG_RESET);
|
||||||
|
call_downstream_readcb(http2session, downstream);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -605,7 +605,6 @@ int on_frame_not_send_callback(nghttp2_session *session,
|
||||||
<< nghttp2_strerror(lib_error_code);
|
<< nghttp2_strerror(lib_error_code);
|
||||||
}
|
}
|
||||||
if (frame->hd.type == NGHTTP2_HEADERS &&
|
if (frame->hd.type == NGHTTP2_HEADERS &&
|
||||||
frame->headers.cat == NGHTTP2_HCAT_RESPONSE &&
|
|
||||||
lib_error_code != NGHTTP2_ERR_STREAM_CLOSED &&
|
lib_error_code != NGHTTP2_ERR_STREAM_CLOSED &&
|
||||||
lib_error_code != NGHTTP2_ERR_STREAM_CLOSING) {
|
lib_error_code != NGHTTP2_ERR_STREAM_CLOSING) {
|
||||||
// To avoid stream hanging around, issue RST_STREAM.
|
// To avoid stream hanging around, issue RST_STREAM.
|
||||||
|
|
Loading…
Reference in New Issue