You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2021/10/13 11:15:03 UTC
svn commit: r1894189 - in /httpd/httpd/trunk: modules/http2/config2.m4
modules/http2/h2_session.c test/modules/http2/test_200_header_invalid.py
Author: icing
Date: Wed Oct 13 11:15:03 2021
New Revision: 1894189
URL: http://svn.apache.org/viewvc?rev=1894189&view=rev
Log:
* mod_http2: checking for nghttp2 function 'set_no_closed_streams' on configure.
adapting test result expectations for new nghttp2 1.45 change in checking
pseudo header fields for invalid characters.
Modified:
httpd/httpd/trunk/modules/http2/config2.m4
httpd/httpd/trunk/modules/http2/h2_session.c
httpd/httpd/trunk/test/modules/http2/test_200_header_invalid.py
Modified: httpd/httpd/trunk/modules/http2/config2.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/config2.m4?rev=1894189&r1=1894188&r2=1894189&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/config2.m4 (original)
+++ httpd/httpd/trunk/modules/http2/config2.m4 Wed Oct 13 11:15:03 2021
@@ -161,6 +161,9 @@ dnl # nghttp2 >= 1.14.0: invalid header
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
Modified: httpd/httpd/trunk/modules/http2/h2_session.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_session.c?rev=1894189&r1=1894188&r2=1894189&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_session.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_session.c Wed Oct 13 11:15:03 2021
@@ -890,11 +890,12 @@ apr_status_t h2_session_create(h2_sessio
/* 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);
Modified: httpd/httpd/trunk/test/modules/http2/test_200_header_invalid.py
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/test/modules/http2/test_200_header_invalid.py?rev=1894189&r1=1894188&r2=1894189&view=diff
==============================================================================
--- httpd/httpd/trunk/test/modules/http2/test_200_header_invalid.py (original)
+++ httpd/httpd/trunk/test/modules/http2/test_200_header_invalid.py Wed Oct 13 11:15:03 2021
@@ -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