*) mod_http2: Fix handling of 304 responses from mod_cache. PR 69580.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924267 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Eissing
2025-03-10 10:09:43 +00:00
parent 8d71cf3c9e
commit f3448d02da
2 changed files with 7 additions and 3 deletions

View File

@ -0,0 +1,2 @@
*) mod_http2: Fix handling of 304 responses from mod_cache. PR 69580.
[Stefan Eissing]

View File

@ -1493,7 +1493,8 @@ static ssize_t stream_data_cb(nghttp2_session *ng2s,
buf_len = output_data_buffered(stream, &eos, &header_blocked);
}
else if (APR_EOF == rv) {
if (!stream->output_eos) {
if (!stream->output_eos &&
!AP_STATUS_IS_HEADER_ONLY(stream->response->status)) {
/* Seeing APR_EOF without an EOS bucket received before indicates
* that stream output is incomplete. Commonly, we expect to see
* an ERROR bucket to have been generated. But faulty handlers
@ -1601,8 +1602,9 @@ static apr_status_t stream_do_response(h2_stream *stream)
ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c1,
H2_STRM_MSG(stream, "process response %d"),
resp->status);
is_empty = (e != APR_BRIGADE_SENTINEL(stream->out_buffer)
&& APR_BUCKET_IS_EOS(e));
is_empty = AP_STATUS_IS_HEADER_ONLY(resp->status) ||
((e != APR_BRIGADE_SENTINEL(stream->out_buffer) &&
APR_BUCKET_IS_EOS(e)));
break;
}
else if (APR_BUCKET_IS_EOS(b)) {