From c49841f7191f55034198f52ffd430c868020dcd7 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sun, 24 Dec 2017 11:39:30 +0000 Subject: [PATCH] mpm_event: follow up to r1818804 and r1818960. Align mod_http2 with expected returned state from process_connection hooks in async MPMs. When the master connection is handled, enter CONN_STATE_LINGER in any case. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1819214 13f79535-47bb-0310-9956-ffa450edef68 --- modules/http2/h2_conn.c | 21 ++++----------------- modules/http2/h2_h2.c | 5 +++-- modules/http2/h2_switch.c | 5 ++--- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/modules/http2/h2_conn.c b/modules/http2/h2_conn.c index 53497d03ef..f37d951727 100644 --- a/modules/http2/h2_conn.c +++ b/modules/http2/h2_conn.c @@ -253,25 +253,12 @@ apr_status_t h2_conn_run(struct h2_ctx *ctx, conn_rec *c) } while (!async_mpm && c->keepalive == AP_CONN_KEEPALIVE && mpm_state != AP_MPMQ_STOPPING); - + if (c->cs) { - switch (session->state) { - case H2_SESSION_ST_INIT: - case H2_SESSION_ST_CLEANUP: - case H2_SESSION_ST_DONE: - case H2_SESSION_ST_IDLE: - c->cs->state = CONN_STATE_WRITE_COMPLETION; - break; - case H2_SESSION_ST_BUSY: - case H2_SESSION_ST_WAIT: - default: - c->cs->state = CONN_STATE_HANDLER; - break; - - } + c->cs->state = CONN_STATE_LINGER; } - - return DONE; + + return APR_SUCCESS; } apr_status_t h2_conn_pre_close(struct h2_ctx *ctx, conn_rec *c) diff --git a/modules/http2/h2_h2.c b/modules/http2/h2_h2.c index 8487e413f4..f206beb788 100644 --- a/modules/http2/h2_h2.c +++ b/modules/http2/h2_h2.c @@ -669,10 +669,11 @@ int h2_h2_process_conn(conn_rec* c) ap_log_cerror(APLOG_MARK, APLOG_TRACE1, status, c, "conn_setup"); if (status != APR_SUCCESS) { h2_ctx_clear(c); - return status; + return !OK; } } - return h2_conn_run(ctx, c); + h2_conn_run(ctx, c); + return OK; } ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c, "h2_h2, declined"); diff --git a/modules/http2/h2_switch.c b/modules/http2/h2_switch.c index 3a8567eb1b..ef6ae29e08 100644 --- a/modules/http2/h2_switch.c +++ b/modules/http2/h2_switch.c @@ -185,13 +185,12 @@ static int h2_protocol_switch(conn_rec *c, request_rec *r, server_rec *s, ap_log_rerror(APLOG_MARK, APLOG_DEBUG, status, r, APLOGNO(03088) "session setup"); h2_ctx_clear(c); - return status; + return !OK; } h2_conn_run(ctx, c); - return DONE; } - return DONE; + return OK; } return DECLINED; -- 2.40.0