]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) mod_http2: Fixed regression that caused connections to close when mod_reqtimeout
authorStefan Eissing <icing@apache.org>
Fri, 15 May 2020 11:59:32 +0000 (11:59 +0000)
committerStefan Eissing <icing@apache.org>
Fri, 15 May 2020 11:59:32 +0000 (11:59 +0000)
     was configured with a handshake timeout. Fixes gitub issue #196.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1877783 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/http2/h2_conn.c
modules/http2/h2_session.c
modules/http2/h2_switch.c

diff --git a/CHANGES b/CHANGES
index 9a940c3a3e75d898a44fdaf7f416d3f7fe6b0293..39900f0a4a7e57ec2c47a3e1885f10f95aad38f0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.1
 
+  *) mod_http2: Fixed regression that caused connections to close when mod_reqtimeout
+     was configured with a handshake timeout. Fixes gitub issue #196.
+     [Stefan Eissing]
+
   *) mod_proxy_http: handle Upgrade request, 101 (Switching Protocol) response
      and switched protocol forwarding.  [Yann Ylavic]
 
index 5be285390dbf1ad53a04fd85a4aa68a3177a7beb..39b94b59352eef9f53012fefac22e3759366e3fc 100644 (file)
@@ -187,6 +187,12 @@ apr_status_t h2_conn_setup(conn_rec *c, request_rec *r, server_rec *s)
     if (APR_SUCCESS == (status = h2_session_create(&session, c, r, s, workers))) {
         ctx = h2_ctx_get(c, 1);
         h2_ctx_session_set(ctx, session);
+
+        /* remove the input filter of mod_reqtimeout, now that the connection
+         * is established and we have swtiched to h2. reqtimeout has supervised
+         * possibly configured handshake timeouts and needs to get out of the way
+         * now since the rest of its state handling assumes http/1.x to take place. */
+        ap_remove_input_filter_byhandle(c->input_filters, "reqtimeout");
     }
     
     return status;
index f7538316e16b87dab6986256419a32abbeef3ab7..4e48762c5b9eca2e10c94cc89db94ba5e4be7bad 100644 (file)
@@ -1179,7 +1179,7 @@ struct h2_stream *h2_session_push(h2_session *session, h2_stream *is,
     stream = h2_session_open_stream(session, nid, is->id);
     if (!stream) {
         ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c, 
-                      H2_STRM_LOG(APLOGNO(03077), stream, 
+                      H2_STRM_LOG(APLOGNO(03077), is,
                       "failed to create stream obj %d"), nid);
         /* kill the push_promise */
         nghttp2_submit_rst_stream(session->ngh2, NGHTTP2_FLAG_NONE, nid,
index 07a30cc690119a49059bcf934564f75afa80377f..9ec658b8e173da297746c764bfc0f22d331f2b93 100644 (file)
@@ -159,7 +159,6 @@ static int h2_protocol_switch(conn_rec *c, request_rec *r, server_rec *s,
              * right away.
              */
             ap_remove_input_filter_byhandle(r->input_filters, "http_in");
-            ap_remove_input_filter_byhandle(r->input_filters, "reqtimeout");
             ap_remove_output_filter_byhandle(r->output_filters, "HTTP_HEADER");
             
             /* Ok, start an h2_conn on this one. */