Check content-length before calling stream_close_callback with error code 0

This commit is contained in:
Gil Pedersen 2020-09-15 12:36:34 +00:00 committed by Gil Pedersen
parent 2f4fe25ec0
commit cb0ebb38c6
1 changed files with 5 additions and 0 deletions

View File

@ -1196,6 +1196,11 @@ int nghttp2_session_close_stream(nghttp2_session *session, int32_t stream_id,
}
}
if (error_code == NGHTTP2_NO_ERROR &&
nghttp2_http_on_remote_end_stream(stream) == -1) {
error_code = NGHTTP2_PROTOCOL_ERROR;
}
/* We call on_stream_close_callback even if stream->state is
NGHTTP2_STREAM_INITIAL. This will happen while sending request
HEADERS, a local endpoint receives RST_STREAM for that stream. It