]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* mod_http2: checking for nghttp2 function 'set_no_closed_streams' on configure.
authorStefan Eissing <icing@apache.org>
Wed, 13 Oct 2021 11:15:03 +0000 (11:15 +0000)
committerStefan Eissing <icing@apache.org>
Wed, 13 Oct 2021 11:15:03 +0000 (11:15 +0000)
    adapting test result expectations for new nghttp2 1.45 change in checking
    pseudo header fields for invalid characters.

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

modules/http2/config2.m4
modules/http2/h2_session.c
test/modules/http2/test_200_header_invalid.py

index a82051d0a26e915722c60714fcf925587d31c850..67065e01acc40ecafb333cdc03e3928ddf11c728 100644 (file)
@@ -161,6 +161,9 @@ dnl # nghttp2 >= 1.14.0: invalid header callback
 dnl # nghttp2 >= 1.15.0: get/set stream window sizes
       AC_CHECK_FUNCS([nghttp2_session_get_stream_local_window_size], 
         [APR_ADDTO(MOD_CPPFLAGS, ["-DH2_NG2_LOCAL_WIN_SIZE"])], [])
+dnl # nghttp2 >= 1.15.0: don't keep info on closed streams
+      AC_CHECK_FUNCS([nghttp2_option_set_no_closed_streams],
+        [APR_ADDTO(MOD_CPPFLAGS, ["-DH2_NG2_NO_CLOSED_STREAMS"])], [])
     else
       AC_MSG_WARN([nghttp2 version is too old])
     fi
index 20102ba218900572475b9ad2d838b27630bcfeed..60a5e3707dc1d5dd085df5343cff6436c989a35c 100644 (file)
@@ -890,11 +890,12 @@ apr_status_t h2_session_create(h2_session **psession, conn_rec *c, request_rec *
     /* We need to handle window updates ourself, otherwise we
      * get flooded by nghttp2. */
     nghttp2_option_set_no_auto_window_update(options, 1);
+#ifdef H2_NG2_NO_CLOSED_STREAMS
     /* We do not want nghttp2 to keep information about closed streams as
      * that accumulates memory on long connections. This makes PRIORITY
      * setting in relation to older streams non-working. */
     nghttp2_option_set_no_closed_streams(options, 1);
-
+#endif
     rv = nghttp2_session_server_new2(&session->ngh2, callbacks,
                                      session, options);
     nghttp2_session_callbacks_del(callbacks);
index fbaa11173922ef98458ba5b0e804a9626026bffe..b412d7c37cf59859187601d9cc20ed4f8c898f6b 100644 (file)
@@ -168,10 +168,12 @@ class TestStore:
         opt = ["-H:method: GET /hello.py"]
         r = env.nghttp().get(url, options=opt)
         assert r.exit_code == 0, r
-        assert r.response
-        assert r.response["status"] == 400
+        # nghttp version >= 1.45.0 check pseudo headers and RST streams,
+        # which means we see no response.
+        if r.response is not None:
+            assert r.response["status"] == 400
         url = env.mkurl("https", "cgi", "/proxy/hello.py")
         r = env.nghttp().get(url, options=opt)
         assert r.exit_code == 0, r
-        assert r.response
-        assert r.response["status"] == 400
+        if r.response is not None:
+            assert r.response["status"] == 400