File apache2-mod_http2-issue-167.patch of Package apache2
40
1
Index: httpd-2.4.34/modules/http2/h2_from_h1.c
2
===================================================================
3
--- httpd-2.4.34.orig/modules/http2/h2_from_h1.c 2018-05-29 23:16:29.000000000 +0200
4
+++ httpd-2.4.34/modules/http2/h2_from_h1.c 2019-02-27 12:39:19.503285243 +0100
5
6
#include <apr_strings.h>
7
8
#include <httpd.h>
9
+#define AP_STATUS_IS_HEADER_ONLY(x) ((x) == HTTP_NO_CONTENT || \
10
+ (x) == HTTP_NOT_MODIFIED)
11
#include <http_core.h>
12
#include <http_log.h>
13
#include <http_connection.h>
14
15
}
16
}
17
18
- if (r->header_only) {
19
+ if (r->header_only || AP_STATUS_IS_HEADER_ONLY(r->status)) {
20
ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, f->c,
21
- "h2_task(%s): header_only, cleanup output brigade",
22
+ "h2_task(%s): headers only, cleanup output brigade",
23
task->id);
24
b = body_bucket? body_bucket : APR_BRIGADE_FIRST(bb);
25
while (b != APR_BRIGADE_SENTINEL(bb)) {
26
next = APR_BUCKET_NEXT(b);
27
if (APR_BUCKET_IS_EOS(b) || AP_BUCKET_IS_EOR(b)) {
28
break;
29
- }
30
- APR_BUCKET_REMOVE(b);
31
- apr_bucket_destroy(b);
32
+ }
33
+ if (!H2_BUCKET_IS_HEADERS(b)) {
34
+ APR_BUCKET_REMOVE(b);
35
+ apr_bucket_destroy(b);
36
+ }
37
b = next;
38
}
39
}
40