From: Stefan Eissing Date: Wed, 3 Jul 2019 13:46:31 +0000 (+0000) Subject: *) mod_http2/mpm_event: Fixes the behaviour when a HTTP/2 connection has nothing X-Git-Tag: 2.5.0-alpha2-ci-test-only~1991 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=018caeddd81bc282acb2ed4df8fd0535cf4745f7;p=thirdparty%2Fapache%2Fhttpd.git *) mod_http2/mpm_event: Fixes the behaviour when a HTTP/2 connection has nothing more to write with streams ongoing (flow control block). The timeout waiting for the client to send WINODW_UPDATE was incorrectly KeepAliveTimeout and not Timeout as it should be. Fixes PR 63534. [Yann Ylavic, Stefan Eissing] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1862475 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index eab4237a2bf..35fd06ac7e7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.1 + *) mod_http2/mpm_event: Fixes the behaviour when a HTTP/2 connection has nothing + more to write with streams ongoing (flow control block). The timeout waiting + for the client to send WINODW_UPDATE was incorrectly KeepAliveTimeout and not + Timeout as it should be. Fixes PR 63534. [Yann Ylavic, Stefan Eissing] + *) mod_ssl/mod_md: reversing dependency by letting mod_ssl offer hooks for adding certificates and keys to a virtual host. An additional hook allows answering special TLS connections as used in ACME challenges. diff --git a/modules/http2/h2_conn.c b/modules/http2/h2_conn.c index d29cd7e996b..796bea8f3cc 100644 --- a/modules/http2/h2_conn.c +++ b/modules/http2/h2_conn.c @@ -231,6 +231,13 @@ apr_status_t h2_conn_run(conn_rec *c) case H2_SESSION_ST_BUSY: case H2_SESSION_ST_WAIT: c->cs->state = CONN_STATE_WRITE_COMPLETION; + if (c->cs && (session->open_streams || !session->remote.emitted_count)) { + /* let the MPM know that we are not done and want + * the Timeout behaviour instead of a KeepAliveTimeout + * See PR 63534. + */ + c->cs->sense = CONN_SENSE_WANT_READ; + } break; case H2_SESSION_ST_CLEANUP: case H2_SESSION_ST_DONE: diff --git a/modules/http2/h2_version.h b/modules/http2/h2_version.h index a26bdd89235..e5a9dca3fd4 100644 --- a/modules/http2/h2_version.h +++ b/modules/http2/h2_version.h @@ -27,7 +27,7 @@ * @macro * Version number of the http2 module as c string */ -#define MOD_HTTP2_VERSION "1.15.2" +#define MOD_HTTP2_VERSION "1.15.3" /** * @macro @@ -35,7 +35,7 @@ * release. This is a 24 bit number with 8 bits for major number, 8 bits * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. */ -#define MOD_HTTP2_VERSION_NUM 0x010f02 +#define MOD_HTTP2_VERSION_NUM 0x010f03 #endif /* mod_h2_h2_version_h */ diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 4bb2d5bd0fd..f9cc820b95a 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -1153,10 +1153,11 @@ read_request: else if (ap_filter_should_yield(c->output_filters)) { pending = OK; } - if (pending == OK) { + if (pending == OK || (pending == DECLINED && + cs->pub.sense == CONN_SENSE_WANT_READ)) { /* Still in WRITE_COMPLETION_STATE: - * Set a write timeout for this connection, and let the - * event thread poll for writeability. + * Set a read/write timeout for this connection, and let the + * event thread poll for read/writeability. */ cs->queue_timestamp = apr_time_now(); notify_suspend(cs);