From: Yann Ylavic Date: Wed, 29 May 2024 09:41:25 +0000 (+0000) Subject: Follow up to r1918022: MMN minor bump and checks for the new conn_state_e aliases... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0af40590501c9a7039cb1e4a2aa019f3ce41edef;p=thirdparty%2Fapache%2Fhttpd.git Follow up to r1918022: MMN minor bump and checks for the new conn_state_e aliases' usability. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918035 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/ap_mmn.h b/include/ap_mmn.h index 9d79c14e95d..06c04bd50ec 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -723,6 +723,7 @@ * 20211221.17 (2.5.1-dev) Add ap_proxy_worker_get_name() * 20211221.18 (2.5.1-dev) Add ap_regexec_ex() * 20211221.19 (2.5.1-dev) Add AP_REG_NOTEMPTY_ATSTART + * 20211221.20 (2.5.1-dev) Add CONN_STATE_KEEPALIVE and CONN_STATE_PROCESS */ #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */ @@ -730,7 +731,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 20211221 #endif -#define MODULE_MAGIC_NUMBER_MINOR 19 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 20 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/modules/http2/h2.h b/modules/http2/h2.h index f496a6dcb2b..0ca72238a4d 100644 --- a/modules/http2/h2.h +++ b/modules/http2/h2.h @@ -49,6 +49,12 @@ struct h2_stream; #define H2_USE_WEBSOCKETS 0 #endif +#if AP_MODULE_MAGIC_AT_LEAST(20211221, 20) +#define H2_USE_STATE_PROCESS 1 +#else +#define H2_USE_STATE_PROCESS 0 +#endif + /** * The magic PRIamble of RFC 7540 that is always sent when starting * a h2 communication. diff --git a/modules/http2/h2_c1.c b/modules/http2/h2_c1.c index 0a3e8395add..6ba6dffb1b2 100644 --- a/modules/http2/h2_c1.c +++ b/modules/http2/h2_c1.c @@ -161,7 +161,11 @@ apr_status_t h2_c1_run(conn_rec *c) * the Timeout behaviour instead of a KeepAliveTimeout * See PR 63534. */ +#if H2_USE_STATE_PROCESS c->cs->state = CONN_STATE_PROCESS; +#else + c->cs->state = CONN_STATE_WRITE_COMPLETION; +#endif c->cs->sense = CONN_SENSE_WANT_READ; } break; diff --git a/modules/http2/h2_session.c b/modules/http2/h2_session.c index 25001730a70..e5809d59ac5 100644 --- a/modules/http2/h2_session.c +++ b/modules/http2/h2_session.c @@ -1762,6 +1762,7 @@ static void unblock_c1_out(h2_session *session) { } } +#if H2_USE_STATE_PROCESS static int h2_send_flow_blocked(h2_session *session) { /* We are completely send blocked if either the connection window @@ -1769,6 +1770,7 @@ static int h2_send_flow_blocked(h2_session *session) return ((nghttp2_session_get_remote_window_size(session->ngh2) <= 0) || h2_mplx_c1_all_streams_send_win_exhausted(session->mplx)); } +#endif apr_status_t h2_session_process(h2_session *session, int async, int *pkeepalive) @@ -1952,7 +1954,7 @@ apr_status_t h2_session_process(h2_session *session, int async, break; } } -#if AP_MODULE_MAGIC_AT_LEAST(20211221, 19) +#if H2_USE_STATE_PROCESS else if (async && h2_send_flow_blocked(session)) { /* On a recent HTTPD, we can return to mpm c1 monitoring, * as it does not treat all connections as having KeepAlive