summaryrefslogtreecommitdiffstats
path: root/modules/http2/h2_stream.c
diff options
context:
space:
mode:
authorStefan Eissing <icing@apache.org>2022-03-21 10:54:41 +0100
committerStefan Eissing <icing@apache.org>2022-03-21 10:54:41 +0100
commit5b44e011362830de3fee365eca770f6ab0a4ab79 (patch)
tree6a48724f9adf0996da3f331655bf076ae8006725 /modules/http2/h2_stream.c
parent *) mod_http2: remove internal bucket beamer registry and just (diff)
downloadapache2-5b44e011362830de3fee365eca770f6ab0a4ab79.tar.xz
apache2-5b44e011362830de3fee365eca770f6ab0a4ab79.zip
*) mod_http2: small improvements from the http1-separation
branch that apply in general. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899107 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/http2/h2_stream.c')
-rw-r--r--modules/http2/h2_stream.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/modules/http2/h2_stream.c b/modules/http2/h2_stream.c
index da8443fe7c..71c005ff2f 100644
--- a/modules/http2/h2_stream.c
+++ b/modules/http2/h2_stream.c
@@ -197,18 +197,17 @@ static void H2_STREAM_OUT_LOG(int lvl, h2_stream *s, const char *tag)
apr_status_t h2_stream_setup_input(h2_stream *stream)
{
- if (stream->input == NULL) {
- int empty = (stream->input_closed
- && (!stream->in_buffer
- || APR_BRIGADE_EMPTY(stream->in_buffer)));
- if (!empty) {
- ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, stream->session->c1,
- H2_STRM_MSG(stream, "setup input beam"));
- h2_beam_create(&stream->input, stream->session->c1,
- stream->pool, stream->id,
- "input", 0, stream->session->s->timeout);
- }
- }
+ /* already done? */
+ if (stream->input != NULL) goto cleanup;
+ /* if already closed and nothing was every sent, leave it */
+ if (stream->input_closed && !stream->in_buffer) goto cleanup;
+
+ ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, stream->session->c1,
+ H2_STRM_MSG(stream, "setup input beam"));
+ h2_beam_create(&stream->input, stream->session->c1,
+ stream->pool, stream->id,
+ "input", 0, stream->session->s->timeout);
+cleanup:
return APR_SUCCESS;
}