Skip to content

Commit f3448d0

Browse files
committed
*) 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
1 parent 8d71cf3 commit f3448d0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

changes-entries/pr69580.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*) mod_http2: Fix handling of 304 responses from mod_cache. PR 69580.
2+
[Stefan Eissing]

modules/http2/h2_stream.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,8 @@ static ssize_t stream_data_cb(nghttp2_session *ng2s,
14931493
buf_len = output_data_buffered(stream, &eos, &header_blocked);
14941494
}
14951495
else if (APR_EOF == rv) {
1496-
if (!stream->output_eos) {
1496+
if (!stream->output_eos &&
1497+
!AP_STATUS_IS_HEADER_ONLY(stream->response->status)) {
14971498
/* Seeing APR_EOF without an EOS bucket received before indicates
14981499
* that stream output is incomplete. Commonly, we expect to see
14991500
* an ERROR bucket to have been generated. But faulty handlers
@@ -1601,8 +1602,9 @@ static apr_status_t stream_do_response(h2_stream *stream)
16011602
ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c1,
16021603
H2_STRM_MSG(stream, "process response %d"),
16031604
resp->status);
1604-
is_empty = (e != APR_BRIGADE_SENTINEL(stream->out_buffer)
1605-
&& APR_BUCKET_IS_EOS(e));
1605+
is_empty = AP_STATUS_IS_HEADER_ONLY(resp->status) ||
1606+
((e != APR_BRIGADE_SENTINEL(stream->out_buffer) &&
1607+
APR_BUCKET_IS_EOS(e)));
16061608
break;
16071609
}
16081610
else if (APR_BUCKET_IS_EOS(b)) {

0 commit comments

Comments
 (0)