From: Stefan Eissing Date: Mon, 10 Mar 2025 10:09:43 +0000 (+0000) Subject: *) mod_http2: Fix handling of 304 responses from mod_cache. PR 69580. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f3448d02da6e8bc91419f44685b8c0a0b60fd580;p=thirdparty%2Fapache%2Fhttpd.git *) 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 --- diff --git a/changes-entries/pr69580.txt b/changes-entries/pr69580.txt new file mode 100644 index 0000000000..08647ea5ae --- /dev/null +++ b/changes-entries/pr69580.txt @@ -0,0 +1,2 @@ + *) mod_http2: Fix handling of 304 responses from mod_cache. PR 69580. + [Stefan Eissing] diff --git a/modules/http2/h2_stream.c b/modules/http2/h2_stream.c index 35b53860c0..a50713cac0 100644 --- a/modules/http2/h2_stream.c +++ b/modules/http2/h2_stream.c @@ -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)) {