From 0f1d3c4c071985a1658aeb5b30569b7541b0fc29 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 11 Nov 2021 14:02:14 +0100 Subject: [PATCH] * Fixed input handling for requests without body that nevertheless try to read one (e.g. mod_cgid handling) to deliver at least an EOS bucket before signalling an EOF. --- ChangeLog | 3 +++ mod_http2/h2_c2.c | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4466427f..e8cc48e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ + * Fixed input handling for requests without body that nevertheless try + to read one (e.g. mod_cgid handling) to deliver at least an EOS bucket + before signalling an EOF. * A regression in v1.15.24 was fixed that could lead to httpd child processes not being terminated on a graceful reload or when reaching MaxConnectionsPerChild. When unprocessed h2 requests were queued at diff --git a/mod_http2/h2_c2.c b/mod_http2/h2_c2.c index fd0adb51..dd2e10b3 100644 --- a/mod_http2/h2_c2.c +++ b/mod_http2/h2_c2.c @@ -269,14 +269,14 @@ static apr_status_t h2_c2_filter_in(ap_filter_t* f, return APR_ECONNABORTED; } - if (!conn_ctx->beam_in) { - return APR_EOF; - } - if (!fctx) { fctx = apr_pcalloc(f->c->pool, sizeof(*fctx)); f->ctx = fctx; fctx->bb = apr_brigade_create(f->c->pool, f->c->bucket_alloc); + if (!conn_ctx->beam_in) { + b = apr_bucket_eos_create(f->c->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(fctx->bb, b); + } } /* Cleanup brigades from those nasty 0 length non-meta buckets