]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) mod_http2: Fix handling of 304 responses from mod_cache. PR 69580.
authorStefan Eissing <icing@apache.org>
Mon, 10 Mar 2025 10:09:43 +0000 (10:09 +0000)
committerStefan Eissing <icing@apache.org>
Mon, 10 Mar 2025 10:09:43 +0000 (10:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924267 13f79535-47bb-0310-9956-ffa450edef68

changes-entries/pr69580.txt [new file with mode: 0644]
modules/http2/h2_stream.c

diff --git a/changes-entries/pr69580.txt b/changes-entries/pr69580.txt
new file mode 100644 (file)
index 0000000..08647ea
--- /dev/null
@@ -0,0 +1,2 @@
+  *) mod_http2: Fix handling of 304 responses from mod_cache. PR 69580.
+     [Stefan Eissing]
index 35b53860c03641033ae9d7758bcf068effadb8cb..a50713cac0fdb57ac3dd6896749f6f34f92bbaf2 100644 (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)) {