mirror of
https://gitee.com/openharmony/third_party_nghttp2
synced 2024-12-03 13:41:14 +00:00
nghttpx: Fix bug that h3 stream ends prematurely
This commit is contained in:
parent
a6537cb9ce
commit
f3d4b4f846
@ -1202,9 +1202,8 @@ nghttp3_ssize downstream_read_data_callback(nghttp3_conn *conn,
|
|||||||
|
|
||||||
assert(body);
|
assert(body);
|
||||||
|
|
||||||
if (downstream->get_response_state() == DownstreamState::MSG_COMPLETE) {
|
if (downstream->get_response_state() != DownstreamState::MSG_COMPLETE &&
|
||||||
*pflags |= NGHTTP3_DATA_FLAG_EOF;
|
body->rleft_mark() == 0) {
|
||||||
} else if (body->rleft_mark() == 0) {
|
|
||||||
downstream->disable_upstream_wtimer();
|
downstream->disable_upstream_wtimer();
|
||||||
return NGHTTP3_ERR_WOULDBLOCK;
|
return NGHTTP3_ERR_WOULDBLOCK;
|
||||||
}
|
}
|
||||||
@ -1213,6 +1212,11 @@ nghttp3_ssize downstream_read_data_callback(nghttp3_conn *conn,
|
|||||||
|
|
||||||
veccnt = body->riovec_mark(reinterpret_cast<struct iovec *>(vec), veccnt);
|
veccnt = body->riovec_mark(reinterpret_cast<struct iovec *>(vec), veccnt);
|
||||||
|
|
||||||
|
if (downstream->get_response_state() == DownstreamState::MSG_COMPLETE &&
|
||||||
|
body->rleft_mark() == 0) {
|
||||||
|
*pflags |= NGHTTP3_DATA_FLAG_EOF;
|
||||||
|
}
|
||||||
|
|
||||||
assert((*pflags & NGHTTP3_DATA_FLAG_EOF) || veccnt);
|
assert((*pflags & NGHTTP3_DATA_FLAG_EOF) || veccnt);
|
||||||
|
|
||||||
downstream->response_sent_body_length += nghttp3_vec_len(vec, veccnt);
|
downstream->response_sent_body_length += nghttp3_vec_len(vec, veccnt);
|
||||||
|
Loading…
Reference in New Issue
Block a user