(tomcat) branch main updated: Drop the cheat for experimenting
This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/main by this push: new 36c226f214 Drop the cheat for experimenting 36c226f214 is described below commit 36c226f2141573a841b6cd4d7ad8e8b582080510 Author: remm AuthorDate: Thu Sep 26 10:31:06 2024 +0200 Drop the cheat for experimenting Some crashes may occur ... --- test/org/apache/catalina/manager/TestManagerWebappSsl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/org/apache/catalina/manager/TestManagerWebappSsl.java b/test/org/apache/catalina/manager/TestManagerWebappSsl.java index 19d19c619c..fe8aed4fe5 100644 --- a/test/org/apache/catalina/manager/TestManagerWebappSsl.java +++ b/test/org/apache/catalina/manager/TestManagerWebappSsl.java @@ -54,10 +54,10 @@ public class TestManagerWebappSsl extends TomcatBaseTest { List parameterSets = new ArrayList<>(); parameterSets.add(new Object[] { "JSSE", Boolean.FALSE, "org.apache.tomcat.util.net.jsse.JSSEImplementation"}); -parameterSets.add(new Object[] { -"OpenSSL-FFM", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation"}); parameterSets.add(new Object[] { "OpenSSL", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.OpenSSLImplementation"}); +parameterSets.add(new Object[] { +"OpenSSL-FFM", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation"}); return parameterSets; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Buildbot failure in on tomcat-12.0.x
Build status: BUILD FAILED: failed compile (failure) Worker used: bb_worker2_ubuntu URL: https://ci2.apache.org/#builders/120/builds/81 Blamelist: remm Build Text: failed compile (failure) Status Detected: new failure Build Source Stamp: [branch main] 36c226f2141573a841b6cd4d7ad8e8b582080510 Steps: worker_preparation: 0 git: 0 shell: 0 shell_1: 0 shell_2: 0 shell_3: 0 shell_4: 0 shell_5: 0 shell_6: 0 compile: 1 shell_7: 0 shell_8: 0 shell_9: 0 shell_10: 0 Rsync docs to nightlies.apache.org: 0 shell_11: 0 Rsync RAT to nightlies.apache.org: 0 compile_1: 2 shell_12: 0 Rsync Logs to nightlies.apache.org: 0 -- ASF Buildbot - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Buildbot failure in on tomcat-12.0.x
On Thu, Sep 26, 2024 at 11:18 AM wrote: > > Build status: BUILD FAILED: failed compile (failure) > Worker used: bb_worker2_ubuntu > URL: https://ci2.apache.org/#builders/120/builds/81 > Blamelist: remm > Build Text: failed compile (failure) > Status Detected: new failure > Build Source Stamp: [branch main] 36c226f2141573a841b6cd4d7ad8e8b582080510 Certificate reloading, plus the use of the FFM version of the implementation in parallel, causes a reliable crash on shutdown for tomcat-native/JNI. I haven't been able to find out yet what is wrong (certainly this kind of use is inappropriate, you would use either tomcat-native or FFM, not both). Rémy > > Steps: > > worker_preparation: 0 > > git: 0 > > shell: 0 > > shell_1: 0 > > shell_2: 0 > > shell_3: 0 > > shell_4: 0 > > shell_5: 0 > > shell_6: 0 > > compile: 1 > > shell_7: 0 > > shell_8: 0 > > shell_9: 0 > > shell_10: 0 > > Rsync docs to nightlies.apache.org: 0 > > shell_11: 0 > > Rsync RAT to nightlies.apache.org: 0 > > compile_1: 2 > > shell_12: 0 > > Rsync Logs to nightlies.apache.org: 0 > > > -- ASF Buildbot > > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch main updated: Add support for server and serverRemoveAppProvidedValues to h2
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/main by this push: new dcb4e3f347 Add support for server and serverRemoveAppProvidedValues to h2 dcb4e3f347 is described below commit dcb4e3f347844d39ce59fd4793d8be9a662da993 Author: Mark Thomas AuthorDate: Thu Sep 26 11:42:38 2024 +0100 Add support for server and serverRemoveAppProvidedValues to h2 These configuration properties are inherited from the parent HTTP/1.1 connector. --- java/org/apache/coyote/http2/StreamProcessor.java | 13 ++ .../apache/coyote/http2/TestStreamProcessor.java | 146 + webapps/docs/config/http2.xml | 2 + 3 files changed, 161 insertions(+) diff --git a/java/org/apache/coyote/http2/StreamProcessor.java b/java/org/apache/coyote/http2/StreamProcessor.java index 6bde60d921..72c86020fd 100644 --- a/java/org/apache/coyote/http2/StreamProcessor.java +++ b/java/org/apache/coyote/http2/StreamProcessor.java @@ -242,6 +242,19 @@ class StreamProcessor extends AbstractProcessor { headers.addValue("date").setString(FastHttpDateFormat.getCurrentDate()); } +// Server header +if (protocol != null) { +String server = protocol.getHttp11Protocol().getServer(); +if (server == null) { +if (protocol.getHttp11Protocol().getServerRemoveAppProvidedValues()) { +headers.removeHeader("server"); +} +} else { +// server always overrides anything the app might set +headers.setValue("Server").setString(server); +} +} + // Exclude some HTTP header fields where the value is determined only // while generating the content as per section 9.3.2 of RFC 9110. if (coyoteRequest != null && coyoteRequest.method().equals("HEAD")) { diff --git a/test/org/apache/coyote/http2/TestStreamProcessor.java b/test/org/apache/coyote/http2/TestStreamProcessor.java index 4208ff5954..bfc4d8595b 100644 --- a/test/org/apache/coyote/http2/TestStreamProcessor.java +++ b/test/org/apache/coyote/http2/TestStreamProcessor.java @@ -653,4 +653,150 @@ public class TestStreamProcessor extends Http2TestBase { resp.getWriter().write("OK"); } } + + +@Test +public void testServerHeaderDefault() throws Exception { +enableHttp2(); + +Tomcat tomcat = getTomcatInstance(); + +Context ctxt = getProgrammaticRootContext(); +Tomcat.addServlet(ctxt, "simple", new SimpleServlet()); +ctxt.addServletMappingDecoded("/simple", "simple"); +Tomcat.addServlet(ctxt, "server", new ServerHeaderServlet()); +ctxt.addServletMappingDecoded("/server", "server"); +tomcat.start(); + +openClientConnection(); +doHttpUpgrade(); +sendClientPreface(); +validateHttp2InitialResponse(); + +// Disable overhead protection for window update as it breaks some tests +http2Protocol.setOverheadWindowUpdateThreshold(0); + +byte[] headersFrameHeader = new byte[9]; +ByteBuffer headersPayload = ByteBuffer.allocate(128); + +buildGetRequest(headersFrameHeader, headersPayload, null, 3, "/server"); + +// Write the headers +writeFrame(headersFrameHeader, headersPayload); + +parser.readFrame(); +parser.readFrame(); + +Assert.assertEquals("3-HeadersStart\n" + "3-Header-[:status]-[200]\n" + +"3-Header-[server]-[TestServerApp]\n" + +"3-Header-[content-type]-[text/plain;charset=UTF-8]\n" + +"3-Header-[content-length]-[2]\n" + +"3-Header-[date]-[" + DEFAULT_DATE + "]\n" + "3-HeadersEnd\n" + "3-Body-2\n" + "3-EndOfStream\n", +output.getTrace()); +} + + +@Test +public void testServerHeaderRemove() throws Exception { +enableHttp2(); + +Tomcat tomcat = getTomcatInstance(); + +tomcat.getConnector().setProperty("serverRemoveAppProvidedValues", "true"); + +Context ctxt = getProgrammaticRootContext(); +Tomcat.addServlet(ctxt, "simple", new SimpleServlet()); +ctxt.addServletMappingDecoded("/simple", "simple"); +Tomcat.addServlet(ctxt, "server", new ServerHeaderServlet()); +ctxt.addServletMappingDecoded("/server", "server"); +tomcat.start(); + +openClientConnection(); +doHttpUpgrade(); +sendClientPreface(); +validateHttp2InitialResponse(); + +// Disable overhead protection for window update as it breaks some tests +http2Protocol.setOverheadWindowUpdateThreshold(0); + +byte[] headersFrameHeader = new byte[9]; +ByteBuffer headersPayload = ByteBuffer.allocate(128); + +buildGetReques
(tomcat) branch 11.0.x updated: Add support for server and serverRemoveAppProvidedValues to h2
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/11.0.x by this push: new a5bc1e4841 Add support for server and serverRemoveAppProvidedValues to h2 a5bc1e4841 is described below commit a5bc1e484144f940e060381217c8b27772bdcfc2 Author: Mark Thomas AuthorDate: Thu Sep 26 11:42:38 2024 +0100 Add support for server and serverRemoveAppProvidedValues to h2 These configuration properties are inherited from the parent HTTP/1.1 connector. --- java/org/apache/coyote/http2/StreamProcessor.java | 13 ++ .../apache/coyote/http2/TestStreamProcessor.java | 146 + webapps/docs/changelog.xml | 5 + webapps/docs/config/http2.xml | 2 + 4 files changed, 166 insertions(+) diff --git a/java/org/apache/coyote/http2/StreamProcessor.java b/java/org/apache/coyote/http2/StreamProcessor.java index 6bde60d921..72c86020fd 100644 --- a/java/org/apache/coyote/http2/StreamProcessor.java +++ b/java/org/apache/coyote/http2/StreamProcessor.java @@ -242,6 +242,19 @@ class StreamProcessor extends AbstractProcessor { headers.addValue("date").setString(FastHttpDateFormat.getCurrentDate()); } +// Server header +if (protocol != null) { +String server = protocol.getHttp11Protocol().getServer(); +if (server == null) { +if (protocol.getHttp11Protocol().getServerRemoveAppProvidedValues()) { +headers.removeHeader("server"); +} +} else { +// server always overrides anything the app might set +headers.setValue("Server").setString(server); +} +} + // Exclude some HTTP header fields where the value is determined only // while generating the content as per section 9.3.2 of RFC 9110. if (coyoteRequest != null && coyoteRequest.method().equals("HEAD")) { diff --git a/test/org/apache/coyote/http2/TestStreamProcessor.java b/test/org/apache/coyote/http2/TestStreamProcessor.java index 4208ff5954..bfc4d8595b 100644 --- a/test/org/apache/coyote/http2/TestStreamProcessor.java +++ b/test/org/apache/coyote/http2/TestStreamProcessor.java @@ -653,4 +653,150 @@ public class TestStreamProcessor extends Http2TestBase { resp.getWriter().write("OK"); } } + + +@Test +public void testServerHeaderDefault() throws Exception { +enableHttp2(); + +Tomcat tomcat = getTomcatInstance(); + +Context ctxt = getProgrammaticRootContext(); +Tomcat.addServlet(ctxt, "simple", new SimpleServlet()); +ctxt.addServletMappingDecoded("/simple", "simple"); +Tomcat.addServlet(ctxt, "server", new ServerHeaderServlet()); +ctxt.addServletMappingDecoded("/server", "server"); +tomcat.start(); + +openClientConnection(); +doHttpUpgrade(); +sendClientPreface(); +validateHttp2InitialResponse(); + +// Disable overhead protection for window update as it breaks some tests +http2Protocol.setOverheadWindowUpdateThreshold(0); + +byte[] headersFrameHeader = new byte[9]; +ByteBuffer headersPayload = ByteBuffer.allocate(128); + +buildGetRequest(headersFrameHeader, headersPayload, null, 3, "/server"); + +// Write the headers +writeFrame(headersFrameHeader, headersPayload); + +parser.readFrame(); +parser.readFrame(); + +Assert.assertEquals("3-HeadersStart\n" + "3-Header-[:status]-[200]\n" + +"3-Header-[server]-[TestServerApp]\n" + +"3-Header-[content-type]-[text/plain;charset=UTF-8]\n" + +"3-Header-[content-length]-[2]\n" + +"3-Header-[date]-[" + DEFAULT_DATE + "]\n" + "3-HeadersEnd\n" + "3-Body-2\n" + "3-EndOfStream\n", +output.getTrace()); +} + + +@Test +public void testServerHeaderRemove() throws Exception { +enableHttp2(); + +Tomcat tomcat = getTomcatInstance(); + +tomcat.getConnector().setProperty("serverRemoveAppProvidedValues", "true"); + +Context ctxt = getProgrammaticRootContext(); +Tomcat.addServlet(ctxt, "simple", new SimpleServlet()); +ctxt.addServletMappingDecoded("/simple", "simple"); +Tomcat.addServlet(ctxt, "server", new ServerHeaderServlet()); +ctxt.addServletMappingDecoded("/server", "server"); +tomcat.start(); + +openClientConnection(); +doHttpUpgrade(); +sendClientPreface(); +validateHttp2InitialResponse(); + +// Disable overhead protection for window update as it breaks some tests +http2Protocol.setOverheadWindowUpdateThreshold(0); + +byte[] headersFrameHeader = new byte[9]; +ByteBuffer head
(tomcat) branch 10.1.x updated: Add support for server and serverRemoveAppProvidedValues to h2
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/10.1.x by this push: new 748c584f8c Add support for server and serverRemoveAppProvidedValues to h2 748c584f8c is described below commit 748c584f8c8225a8d875e4396c74fa92349de147 Author: Mark Thomas AuthorDate: Thu Sep 26 11:42:38 2024 +0100 Add support for server and serverRemoveAppProvidedValues to h2 These configuration properties are inherited from the parent HTTP/1.1 connector. --- java/org/apache/coyote/http2/StreamProcessor.java | 13 ++ .../apache/coyote/http2/TestStreamProcessor.java | 146 + webapps/docs/changelog.xml | 5 + webapps/docs/config/http2.xml | 2 + 4 files changed, 166 insertions(+) diff --git a/java/org/apache/coyote/http2/StreamProcessor.java b/java/org/apache/coyote/http2/StreamProcessor.java index 6344e0f610..fe5bb2ade0 100644 --- a/java/org/apache/coyote/http2/StreamProcessor.java +++ b/java/org/apache/coyote/http2/StreamProcessor.java @@ -241,6 +241,19 @@ class StreamProcessor extends AbstractProcessor { if (statusCode >= 200 && headers.getValue("date") == null) { headers.addValue("date").setString(FastHttpDateFormat.getCurrentDate()); } + +// Server header +if (protocol != null) { +String server = protocol.getHttp11Protocol().getServer(); +if (server == null) { +if (protocol.getHttp11Protocol().getServerRemoveAppProvidedValues()) { +headers.removeHeader("server"); +} +} else { +// server always overrides anything the app might set +headers.setValue("Server").setString(server); +} +} } diff --git a/test/org/apache/coyote/http2/TestStreamProcessor.java b/test/org/apache/coyote/http2/TestStreamProcessor.java index 5082349a6e..0788815e76 100644 --- a/test/org/apache/coyote/http2/TestStreamProcessor.java +++ b/test/org/apache/coyote/http2/TestStreamProcessor.java @@ -652,4 +652,150 @@ public class TestStreamProcessor extends Http2TestBase { resp.getWriter().write("OK"); } } + + +@Test +public void testServerHeaderDefault() throws Exception { +enableHttp2(); + +Tomcat tomcat = getTomcatInstance(); + +Context ctxt = getProgrammaticRootContext(); +Tomcat.addServlet(ctxt, "simple", new SimpleServlet()); +ctxt.addServletMappingDecoded("/simple", "simple"); +Tomcat.addServlet(ctxt, "server", new ServerHeaderServlet()); +ctxt.addServletMappingDecoded("/server", "server"); +tomcat.start(); + +openClientConnection(); +doHttpUpgrade(); +sendClientPreface(); +validateHttp2InitialResponse(); + +// Disable overhead protection for window update as it breaks some tests +http2Protocol.setOverheadWindowUpdateThreshold(0); + +byte[] headersFrameHeader = new byte[9]; +ByteBuffer headersPayload = ByteBuffer.allocate(128); + +buildGetRequest(headersFrameHeader, headersPayload, null, 3, "/server"); + +// Write the headers +writeFrame(headersFrameHeader, headersPayload); + +parser.readFrame(); +parser.readFrame(); + +Assert.assertEquals("3-HeadersStart\n" + "3-Header-[:status]-[200]\n" + +"3-Header-[server]-[TestServerApp]\n" + +"3-Header-[content-type]-[text/plain;charset=UTF-8]\n" + +"3-Header-[content-length]-[2]\n" + +"3-Header-[date]-[" + DEFAULT_DATE + "]\n" + "3-HeadersEnd\n" + "3-Body-2\n" + "3-EndOfStream\n", +output.getTrace()); +} + + +@Test +public void testServerHeaderRemove() throws Exception { +enableHttp2(); + +Tomcat tomcat = getTomcatInstance(); + +tomcat.getConnector().setProperty("serverRemoveAppProvidedValues", "true"); + +Context ctxt = getProgrammaticRootContext(); +Tomcat.addServlet(ctxt, "simple", new SimpleServlet()); +ctxt.addServletMappingDecoded("/simple", "simple"); +Tomcat.addServlet(ctxt, "server", new ServerHeaderServlet()); +ctxt.addServletMappingDecoded("/server", "server"); +tomcat.start(); + +openClientConnection(); +doHttpUpgrade(); +sendClientPreface(); +validateHttp2InitialResponse(); + +// Disable overhead protection for window update as it breaks some tests +http2Protocol.setOverheadWindowUpdateThreshold(0); + +byte[] headersFrameHeader = new byte[9]; +ByteBuffer headersPayload = ByteBuffer.allocate(128); + +buildGetRequest(headersFrameHeader, headersPayload, null, 3, "/server"); + +// Write the header
(tomcat) branch 10.1.x updated: Fix back-port
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/10.1.x by this push: new 3c8f38b63d Fix back-port 3c8f38b63d is described below commit 3c8f38b63de7787f632096fd1489b4f86b1dc7b0 Author: Mark Thomas AuthorDate: Thu Sep 26 12:00:09 2024 +0100 Fix back-port --- test/org/apache/coyote/http2/TestStreamProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/org/apache/coyote/http2/TestStreamProcessor.java b/test/org/apache/coyote/http2/TestStreamProcessor.java index 0788815e76..9a0ed2092b 100644 --- a/test/org/apache/coyote/http2/TestStreamProcessor.java +++ b/test/org/apache/coyote/http2/TestStreamProcessor.java @@ -792,7 +792,7 @@ public class TestStreamProcessor extends Http2TestBase { protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { resp.addHeader("server", "TestServerApp"); -resp.setCharacterEncoding(StandardCharsets.UTF_8); +resp.setCharacterEncoding("UTF-8"); resp.setContentType("text/plain"); resp.getWriter().write("OK"); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 9.0.x updated: Add support for server and serverRemoveAppProvidedValues to h2
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/9.0.x by this push: new 3701d8468d Add support for server and serverRemoveAppProvidedValues to h2 3701d8468d is described below commit 3701d8468dce193dfa38302dd20d413eb18af30f Author: Mark Thomas AuthorDate: Thu Sep 26 11:42:38 2024 +0100 Add support for server and serverRemoveAppProvidedValues to h2 These configuration properties are inherited from the parent HTTP/1.1 connector. --- java/org/apache/coyote/http2/StreamProcessor.java | 13 ++ .../apache/coyote/http2/TestStreamProcessor.java | 146 + webapps/docs/changelog.xml | 5 + webapps/docs/config/http2.xml | 2 + 4 files changed, 166 insertions(+) diff --git a/java/org/apache/coyote/http2/StreamProcessor.java b/java/org/apache/coyote/http2/StreamProcessor.java index 6c53748d46..e33c521b5a 100644 --- a/java/org/apache/coyote/http2/StreamProcessor.java +++ b/java/org/apache/coyote/http2/StreamProcessor.java @@ -241,6 +241,19 @@ class StreamProcessor extends AbstractProcessor { if (statusCode >= 200 && headers.getValue("date") == null) { headers.addValue("date").setString(FastHttpDateFormat.getCurrentDate()); } + +// Server header +if (protocol != null) { +String server = ((AbstractHttp11Protocol) protocol.getHttp11Protocol()).getServer(); +if (server == null) { +if (((AbstractHttp11Protocol) protocol.getHttp11Protocol()).getServerRemoveAppProvidedValues()) { +headers.removeHeader("server"); +} +} else { +// server always overrides anything the app might set +headers.setValue("Server").setString(server); +} +} } diff --git a/test/org/apache/coyote/http2/TestStreamProcessor.java b/test/org/apache/coyote/http2/TestStreamProcessor.java index 5c3daac77c..ce14db27bc 100644 --- a/test/org/apache/coyote/http2/TestStreamProcessor.java +++ b/test/org/apache/coyote/http2/TestStreamProcessor.java @@ -657,4 +657,150 @@ public class TestStreamProcessor extends Http2TestBase { resp.getWriter().write("OK"); } } + + +@Test +public void testServerHeaderDefault() throws Exception { +enableHttp2(); + +Tomcat tomcat = getTomcatInstance(); + +Context ctxt = getProgrammaticRootContext(); +Tomcat.addServlet(ctxt, "simple", new SimpleServlet()); +ctxt.addServletMappingDecoded("/simple", "simple"); +Tomcat.addServlet(ctxt, "server", new ServerHeaderServlet()); +ctxt.addServletMappingDecoded("/server", "server"); +tomcat.start(); + +openClientConnection(); +doHttpUpgrade(); +sendClientPreface(); +validateHttp2InitialResponse(); + +// Disable overhead protection for window update as it breaks some tests +http2Protocol.setOverheadWindowUpdateThreshold(0); + +byte[] headersFrameHeader = new byte[9]; +ByteBuffer headersPayload = ByteBuffer.allocate(128); + +buildGetRequest(headersFrameHeader, headersPayload, null, 3, "/server"); + +// Write the headers +writeFrame(headersFrameHeader, headersPayload); + +parser.readFrame(); +parser.readFrame(); + +Assert.assertEquals("3-HeadersStart\n" + "3-Header-[:status]-[200]\n" + +"3-Header-[server]-[TestServerApp]\n" + +"3-Header-[content-type]-[text/plain;charset=UTF-8]\n" + +"3-Header-[content-length]-[2]\n" + +"3-Header-[date]-[" + DEFAULT_DATE + "]\n" + "3-HeadersEnd\n" + "3-Body-2\n" + "3-EndOfStream\n", +output.getTrace()); +} + + +@Test +public void testServerHeaderRemove() throws Exception { +enableHttp2(); + +Tomcat tomcat = getTomcatInstance(); + +tomcat.getConnector().setProperty("serverRemoveAppProvidedValues", "true"); + +Context ctxt = getProgrammaticRootContext(); +Tomcat.addServlet(ctxt, "simple", new SimpleServlet()); +ctxt.addServletMappingDecoded("/simple", "simple"); +Tomcat.addServlet(ctxt, "server", new ServerHeaderServlet()); +ctxt.addServletMappingDecoded("/server", "server"); +tomcat.start(); + +openClientConnection(); +doHttpUpgrade(); +sendClientPreface(); +validateHttp2InitialResponse(); + +// Disable overhead protection for window update as it breaks some tests +http2Protocol.setOverheadWindowUpdateThreshold(0); + +byte[] headersFrameHeader = new byte[9]; +ByteBuffer headersPayload = ByteBuffer.allocate(128); + +buildGetRequest(headersFrameHeader, headersPayload,
(tomcat) branch 9.0.x updated: Improve wording
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/9.0.x by this push: new fc352ed54e Improve wording fc352ed54e is described below commit fc352ed54e48555cbb051459ad04b5fcbebfcaf2 Author: Mark Thomas AuthorDate: Thu Sep 26 12:10:07 2024 +0100 Improve wording --- webapps/docs/config/http2.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapps/docs/config/http2.xml b/webapps/docs/config/http2.xml index 2293233651..78ec1fe79b 100644 --- a/webapps/docs/config/http2.xml +++ b/webapps/docs/config/http2.xml @@ -311,8 +311,8 @@ - The HTTP/2 upgrade protocol will also inherit the following limits from the - HTTP Connector it is nested with: + The HTTP/2 upgrade protocol will also inherit the following attributes from + the HTTP Connector within which it is nested: maxCookieCount - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 10.1.x updated: Improve wording
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/10.1.x by this push: new b0df150803 Improve wording b0df150803 is described below commit b0df1508034e3d7ba83c7c589d3a8aa535b3c172 Author: Mark Thomas AuthorDate: Thu Sep 26 12:10:07 2024 +0100 Improve wording --- webapps/docs/config/http2.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapps/docs/config/http2.xml b/webapps/docs/config/http2.xml index a7b8b12ee5..ca6eeed7d5 100644 --- a/webapps/docs/config/http2.xml +++ b/webapps/docs/config/http2.xml @@ -228,8 +228,8 @@ - The HTTP/2 upgrade protocol will also inherit the following limits from the - HTTP Connector it is nested with: + The HTTP/2 upgrade protocol will also inherit the following attributes from + the HTTP Connector within which it is nested: allowedTrailerHeaders - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 11.0.x updated: Improve wording
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/11.0.x by this push: new 1a42db9322 Improve wording 1a42db9322 is described below commit 1a42db93222c31711762a59a7c5eee75739de48a Author: Mark Thomas AuthorDate: Thu Sep 26 12:10:07 2024 +0100 Improve wording --- webapps/docs/config/http2.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapps/docs/config/http2.xml b/webapps/docs/config/http2.xml index 8d918a5db9..49592bc9e1 100644 --- a/webapps/docs/config/http2.xml +++ b/webapps/docs/config/http2.xml @@ -228,8 +228,8 @@ - The HTTP/2 upgrade protocol will also inherit the following limits from the - HTTP Connector it is nested with: + The HTTP/2 upgrade protocol will also inherit the following attributes from + the HTTP Connector within which it is nested: allowedTrailerHeaders - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch main updated: Improve wording
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/main by this push: new d0296e39b9 Improve wording d0296e39b9 is described below commit d0296e39b96ae90f4fa386d4cd290ac57b96b407 Author: Mark Thomas AuthorDate: Thu Sep 26 12:10:07 2024 +0100 Improve wording --- webapps/docs/config/http2.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapps/docs/config/http2.xml b/webapps/docs/config/http2.xml index 8d918a5db9..49592bc9e1 100644 --- a/webapps/docs/config/http2.xml +++ b/webapps/docs/config/http2.xml @@ -228,8 +228,8 @@ - The HTTP/2 upgrade protocol will also inherit the following limits from the - HTTP Connector it is nested with: + The HTTP/2 upgrade protocol will also inherit the following attributes from + the HTTP Connector within which it is nested: allowedTrailerHeaders - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 04/04: Update generated code for optimised "not empty" support
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 8bd408fe6930dff99cdaa6ccbe8d044b3363f5a6 Author: Mark Thomas AuthorDate: Thu Sep 26 16:33:21 2024 +0100 Update generated code for optimised "not empty" support --- java/org/apache/el/parser/ELParser.java| 914 - .../apache/el/parser/ELParserTreeConstants.java| 45 +- 2 files changed, 527 insertions(+), 432 deletions(-) diff --git a/java/org/apache/el/parser/ELParser.java b/java/org/apache/el/parser/ELParser.java index 6ba979629e..963e234aec 100644 --- a/java/org/apache/el/parser/ELParser.java +++ b/java/org/apache/el/parser/ELParser.java @@ -1606,117 +1606,175 @@ public class ELParser/* @bgen(jjtree) */ implements ELParserTreeConstants, ELPar } break; } -case NOT0: -case NOT1: { -switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { -case NOT0: { -jj_consume_token(NOT0); -break; -} -case NOT1: { -jj_consume_token(NOT1); -break; -} -default: -jj_la1[35] = jj_gen; -jj_consume_token(-1); -throw new ParseException(); -} -AstNot jjtn002 = new AstNot(JJTNOT); -boolean jjtc002 = true; -jjtree.openNodeScope(jjtn002); -try { -Unary(); -} catch (Throwable jjte002) { -if (jjtc002) { -jjtree.clearNodeScope(jjtn002); -jjtc002 = false; -} else { -jjtree.popNode(); +default: +jj_la1[37] = jj_gen; +if (jj_2_6(2)) { +switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { +case NOT0: { +jj_consume_token(NOT0); +break; +} +case NOT1: { +jj_consume_token(NOT1); +break; +} +default: +jj_la1[35] = jj_gen; +jj_consume_token(-1); +throw new ParseException(); } -if (jjte002 instanceof RuntimeException) { -{ -if (true) { -throw (RuntimeException) jjte002; +jj_consume_token(EMPTY); +AstNotEmpty jjtn002 = new AstNotEmpty(JJTNOTEMPTY); +boolean jjtc002 = true; +jjtree.openNodeScope(jjtn002); +try { +Unary(); +} catch (Throwable jjte002) { +if (jjtc002) { +jjtree.clearNodeScope(jjtn002); +jjtc002 = false; +} else { +jjtree.popNode(); +} +if (jjte002 instanceof RuntimeException) { +{ +if (true) { +throw (RuntimeException) jjte002; +} +} +} +if (jjte002 instanceof ParseException) { +{ +if (true) { +throw (ParseException) jjte002; +} } } -} -if (jjte002 instanceof ParseException) { { if (true) { -throw (ParseException) jjte002; +throw (Error) jjte002; } } -} -{ -if (true) { -throw (Error) jjte002; +} finally { +if (jjtc002) { +jjtree.closeNodeScope(jjtn002, true); } } -} finally { -if (jjtc002) { -jjtree.closeNodeScope(jjtn002, true); -} -} -break; -} -case EMPTY: { -jj_consume_token(EMPTY); -
(tomcat) branch main updated (405672312b -> 8bd408fe69)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git from 405672312b Avoid possible crashes with OpenSSL new 675daacc5a Add further test case for BZ 69338 new 5f63ba1590 Add tests for empty new d7615a5c10 Complete fix for BZ 69338. Optimise "not empty" new 8bd408fe69 Update generated code for optimised "not empty" support The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../{AstEmpty.java => AstAbstractEmpty.java} | 35 +- java/org/apache/el/parser/AstEmpty.java| 37 +- .../org/apache/el/parser/AstNotEmpty.java | 14 +- java/org/apache/el/parser/ELParser.java| 914 - java/org/apache/el/parser/ELParser.jjt | 3 + .../apache/el/parser/ELParserTreeConstants.java| 45 +- .../parser/{TestAstNot.java => TestAstEmpty.java} | 16 +- .../{TestAstNot.java => TestAstNotEmpty.java} | 14 +- .../apache/el/parser/TestELParserPerformance.java | 32 + 9 files changed, 596 insertions(+), 514 deletions(-) copy java/org/apache/el/parser/{AstEmpty.java => AstAbstractEmpty.java} (62%) copy test/org/apache/el/parser/TesterBeanB.java => java/org/apache/el/parser/AstNotEmpty.java (82%) copy test/org/apache/el/parser/{TestAstNot.java => TestAstEmpty.java} (78%) copy test/org/apache/el/parser/{TestAstNot.java => TestAstNotEmpty.java} (78%) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 03/04: Complete fix for BZ 69338. Optimise "not empty"
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git commit d7615a5c1041c738afc91af6feab46a98fa3f929 Author: Mark Thomas AuthorDate: Thu Sep 26 16:33:02 2024 +0100 Complete fix for BZ 69338. Optimise "not empty" --- .../{AstEmpty.java => AstAbstractEmpty.java} | 35 ++-- java/org/apache/el/parser/AstEmpty.java| 37 ++ java/org/apache/el/parser/AstNotEmpty.java | 24 ++ java/org/apache/el/parser/ELParser.jjt | 3 ++ 4 files changed, 48 insertions(+), 51 deletions(-) diff --git a/java/org/apache/el/parser/AstEmpty.java b/java/org/apache/el/parser/AstAbstractEmpty.java similarity index 62% copy from java/org/apache/el/parser/AstEmpty.java copy to java/org/apache/el/parser/AstAbstractEmpty.java index 0fc73218ed..58577fe267 100644 --- a/java/org/apache/el/parser/AstEmpty.java +++ b/java/org/apache/el/parser/AstAbstractEmpty.java @@ -24,13 +24,21 @@ import jakarta.el.ELException; import org.apache.el.lang.EvaluationContext; +public abstract class AstAbstractEmpty extends SimpleNode { -/** - * @author Jacob Hookom [ja...@hookom.net] - */ -public final class AstEmpty extends SimpleNode { -public AstEmpty(int id) { +private final Boolean RETURN_EMPTY; +private final Boolean RETURN_NOT_EMPTY; + + +public AstAbstractEmpty(int id, boolean invert) { super(id); +if (invert) { +RETURN_EMPTY = Boolean.FALSE; +RETURN_NOT_EMPTY = Boolean.TRUE; +} else { +RETURN_EMPTY = Boolean.TRUE; +RETURN_NOT_EMPTY = Boolean.FALSE; +} } @Override @@ -41,17 +49,12 @@ public final class AstEmpty extends SimpleNode { @Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj = this.children[0].getValue(ctx); -if (obj == null) { -return Boolean.TRUE; -} else if (obj instanceof String) { -return Boolean.valueOf(((String) obj).length() == 0); -} else if (obj instanceof Object[]) { -return Boolean.valueOf(((Object[]) obj).length == 0); -} else if (obj instanceof Collection) { -return Boolean.valueOf(((Collection) obj).isEmpty()); -} else if (obj instanceof Map) { -return Boolean.valueOf(((Map) obj).isEmpty()); +if (obj == null || obj instanceof String && ((String) obj).length() == 0 || +obj instanceof Object[] && ((Object[]) obj).length == 0 || +obj instanceof Collection && ((Collection) obj).isEmpty() || +obj instanceof Map && ((Map) obj).isEmpty()) { +return RETURN_EMPTY; } -return Boolean.FALSE; +return RETURN_NOT_EMPTY; } } diff --git a/java/org/apache/el/parser/AstEmpty.java b/java/org/apache/el/parser/AstEmpty.java index 0fc73218ed..0517091b9c 100644 --- a/java/org/apache/el/parser/AstEmpty.java +++ b/java/org/apache/el/parser/AstEmpty.java @@ -17,41 +17,8 @@ /* Generated By:JJTree: Do not edit this line. AstEmpty.java */ package org.apache.el.parser; -import java.util.Collection; -import java.util.Map; - -import jakarta.el.ELException; - -import org.apache.el.lang.EvaluationContext; - - -/** - * @author Jacob Hookom [ja...@hookom.net] - */ -public final class AstEmpty extends SimpleNode { +public final class AstEmpty extends AstAbstractEmpty { public AstEmpty(int id) { -super(id); -} - -@Override -public Class getType(EvaluationContext ctx) throws ELException { -return Boolean.class; -} - -@Override -public Object getValue(EvaluationContext ctx) throws ELException { -Object obj = this.children[0].getValue(ctx); -if (obj == null) { -return Boolean.TRUE; -} else if (obj instanceof String) { -return Boolean.valueOf(((String) obj).length() == 0); -} else if (obj instanceof Object[]) { -return Boolean.valueOf(((Object[]) obj).length == 0); -} else if (obj instanceof Collection) { -return Boolean.valueOf(((Collection) obj).isEmpty()); -} else if (obj instanceof Map) { -return Boolean.valueOf(((Map) obj).isEmpty()); -} -return Boolean.FALSE; +super(id, false); } } diff --git a/java/org/apache/el/parser/AstNotEmpty.java b/java/org/apache/el/parser/AstNotEmpty.java new file mode 100644 index 00..0066c07afb --- /dev/null +++ b/java/org/apache/el/parser/AstNotEmpty.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "Lic
(tomcat) 01/04: Add further test case for BZ 69338
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 675daacc5a998fb0326cdbbb342eb74503626ed1 Author: Mark Thomas AuthorDate: Thu Sep 26 14:53:23 2024 +0100 Add further test case for BZ 69338 --- .../apache/el/parser/TestELParserPerformance.java | 32 ++ 1 file changed, 32 insertions(+) diff --git a/test/org/apache/el/parser/TestELParserPerformance.java b/test/org/apache/el/parser/TestELParserPerformance.java index 424a6fe27f..c5e8b5a3bc 100644 --- a/test/org/apache/el/parser/TestELParserPerformance.java +++ b/test/org/apache/el/parser/TestELParserPerformance.java @@ -142,4 +142,36 @@ public class TestELParserPerformance extends ELBaseTest { } System.out.println(""); } + + +/* + * Ignored by default since this is an absolute test primarily for + * https://bz.apache.org/bugzilla/show_bug.cgi?id=69338 + */ +@Ignore +@Test +public void testAstNotEmpty() { + +ELManager manager = new ELManager(); +ELContext context = manager.getELContext(); +ExpressionFactory factory = ELManager.getExpressionFactory(); + +for (int j = 0; j < 5; j++) { + +String expression = "${not empty 'abc'}"; + +long start = System.nanoTime(); + +for (int i = 0; i < 1000; i++) { +ValueExpression ve = factory.createValueExpression(context, expression, Boolean.class); +Boolean result = ve.getValue(context); +Assert.assertEquals(Boolean.TRUE, result); +} + +long duration = System.nanoTime() - start; +System.out.println("duration [" + duration + "]"); + +} +System.out.println(""); +} } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/04: Add tests for empty
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 89e573e582264afe77db45609b3e839b31de8a8a Author: Mark Thomas AuthorDate: Thu Sep 26 16:32:03 2024 +0100 Add tests for empty --- test/org/apache/el/parser/TestAstEmpty.java| 40 ++ test/org/apache/el/parser/TestAstNotEmpty.java | 40 ++ 2 files changed, 80 insertions(+) diff --git a/test/org/apache/el/parser/TestAstEmpty.java b/test/org/apache/el/parser/TestAstEmpty.java new file mode 100644 index 00..1523967189 --- /dev/null +++ b/test/org/apache/el/parser/TestAstEmpty.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.el.parser; + +import jakarta.el.ELProcessor; + +import org.junit.Assert; +import org.junit.Test; + +public class TestAstEmpty { + +@Test +public void test01() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("empty 'abc'"); +Assert.assertEquals(Boolean.FALSE, result); +} + + +@Test +public void test02() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("empty ''"); +Assert.assertEquals(Boolean.TRUE, result); +} +} diff --git a/test/org/apache/el/parser/TestAstNotEmpty.java b/test/org/apache/el/parser/TestAstNotEmpty.java new file mode 100644 index 00..dceca6bb1c --- /dev/null +++ b/test/org/apache/el/parser/TestAstNotEmpty.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.el.parser; + +import jakarta.el.ELProcessor; + +import org.junit.Assert; +import org.junit.Test; + +public class TestAstNotEmpty { + +@Test +public void test01() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("not empty 'abc'"); +Assert.assertEquals(Boolean.TRUE, result); +} + + +@Test +public void test02() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("not empty ''"); +Assert.assertEquals(Boolean.FALSE, result); +} +} - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 04/04: Update generated code for 'not empty' optimisation
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 5ba377b5a42c07290223297234f1997e1b88ca1f Author: Mark Thomas AuthorDate: Thu Sep 26 16:39:35 2024 +0100 Update generated code for 'not empty' optimisation --- java/org/apache/el/parser/ELParser.java| 853 - .../apache/el/parser/ELParserTreeConstants.java| 45 +- 2 files changed, 497 insertions(+), 401 deletions(-) diff --git a/java/org/apache/el/parser/ELParser.java b/java/org/apache/el/parser/ELParser.java index 06c07abe13..e18120242c 100644 --- a/java/org/apache/el/parser/ELParser.java +++ b/java/org/apache/el/parser/ELParser.java @@ -1552,117 +1552,175 @@ public class ELParser/* @bgen(jjtree) */ implements ELParserTreeConstants, ELPar } break; } -case NOT0: -case NOT1: { -switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { -case NOT0: { -jj_consume_token(NOT0); -break; -} -case NOT1: { -jj_consume_token(NOT1); -break; -} -default: -jj_la1[33] = jj_gen; -jj_consume_token(-1); -throw new ParseException(); -} -AstNot jjtn002 = new AstNot(JJTNOT); -boolean jjtc002 = true; -jjtree.openNodeScope(jjtn002); -try { -Unary(); -} catch (Throwable jjte002) { -if (jjtc002) { -jjtree.clearNodeScope(jjtn002); -jjtc002 = false; -} else { -jjtree.popNode(); +default: +jj_la1[35] = jj_gen; +if (jj_2_6(2)) { +switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { +case NOT0: { +jj_consume_token(NOT0); +break; +} +case NOT1: { +jj_consume_token(NOT1); +break; +} +default: +jj_la1[33] = jj_gen; +jj_consume_token(-1); +throw new ParseException(); } -if (jjte002 instanceof RuntimeException) { -{ -if (true) { -throw (RuntimeException) jjte002; +jj_consume_token(EMPTY); +AstNotEmpty jjtn002 = new AstNotEmpty(JJTNOTEMPTY); +boolean jjtc002 = true; +jjtree.openNodeScope(jjtn002); +try { +Unary(); +} catch (Throwable jjte002) { +if (jjtc002) { +jjtree.clearNodeScope(jjtn002); +jjtc002 = false; +} else { +jjtree.popNode(); +} +if (jjte002 instanceof RuntimeException) { +{ +if (true) { +throw (RuntimeException) jjte002; +} +} +} +if (jjte002 instanceof ParseException) { +{ +if (true) { +throw (ParseException) jjte002; +} } } -} -if (jjte002 instanceof ParseException) { { if (true) { -throw (ParseException) jjte002; +throw (Error) jjte002; } } -} -{ -if (true) { -throw (Error) jjte002; +} finally { +if (jjtc002) { +jjtree.closeNodeScope(jjtn002, true); } } -} finally { -if (jjtc002) { -jjtree.closeNodeScope(jjtn002, true); -} -} -break; -} -case EMPTY: { -jj_consume_token(EMPTY); -As
Buildbot failure in on tomcat-11.0.x
Build status: BUILD FAILED: failed compile (failure) Worker used: bb_worker2_ubuntu URL: https://ci2.apache.org/#builders/112/builds/1297 Blamelist: remm Build Text: failed compile (failure) Status Detected: new failure Build Source Stamp: [branch 11.0.x] c6ac581742410da3a89b5c01d976e78eed96bf55 Steps: worker_preparation: 0 git: 0 shell: 0 shell_1: 0 shell_2: 0 shell_3: 0 shell_4: 0 shell_5: 0 shell_6: 0 compile: 1 shell_7: 0 shell_8: 0 shell_9: 0 shell_10: 0 Rsync docs to nightlies.apache.org: 0 shell_11: 0 Rsync RAT to nightlies.apache.org: 0 compile_1: 2 shell_12: 0 Rsync Logs to nightlies.apache.org: 0 -- ASF Buildbot - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 03/04: Complete fix for BZ 69338. Optimise "not empty"
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 35f06b3e9669de9653746dbca4ca415475870eae Author: Mark Thomas AuthorDate: Thu Sep 26 16:33:02 2024 +0100 Complete fix for BZ 69338. Optimise "not empty" --- .../{AstEmpty.java => AstAbstractEmpty.java} | 37 ++-- java/org/apache/el/parser/AstEmpty.java| 39 ++ java/org/apache/el/parser/AstNotEmpty.java | 24 + java/org/apache/el/parser/ELParser.jjt | 3 ++ webapps/docs/changelog.xml | 3 +- 5 files changed, 50 insertions(+), 56 deletions(-) diff --git a/java/org/apache/el/parser/AstEmpty.java b/java/org/apache/el/parser/AstAbstractEmpty.java similarity index 62% copy from java/org/apache/el/parser/AstEmpty.java copy to java/org/apache/el/parser/AstAbstractEmpty.java index d01e7f18ec..844d183291 100644 --- a/java/org/apache/el/parser/AstEmpty.java +++ b/java/org/apache/el/parser/AstAbstractEmpty.java @@ -24,36 +24,37 @@ import javax.el.ELException; import org.apache.el.lang.EvaluationContext; -/** - * @author Jacob Hookom [ja...@hookom.net] - */ -public final class AstEmpty extends SimpleNode { +public abstract class AstAbstractEmpty extends SimpleNode { + +private final Boolean RETURN_EMPTY; +private final Boolean RETURN_NOT_EMPTY; + -public AstEmpty(int id) { +public AstAbstractEmpty(int id, boolean invert) { super(id); +if (invert) { +RETURN_EMPTY = Boolean.FALSE; +RETURN_NOT_EMPTY = Boolean.TRUE; +} else { +RETURN_EMPTY = Boolean.TRUE; +RETURN_NOT_EMPTY = Boolean.FALSE; +} } - @Override public Class getType(EvaluationContext ctx) throws ELException { return Boolean.class; } - @Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj = this.children[0].getValue(ctx); -if (obj == null) { -return Boolean.TRUE; -} else if (obj instanceof String) { -return Boolean.valueOf(((String) obj).length() == 0); -} else if (obj instanceof Object[]) { -return Boolean.valueOf(((Object[]) obj).length == 0); -} else if (obj instanceof Collection) { -return Boolean.valueOf(((Collection) obj).isEmpty()); -} else if (obj instanceof Map) { -return Boolean.valueOf(((Map) obj).isEmpty()); +if (obj == null || obj instanceof String && ((String) obj).length() == 0 || +obj instanceof Object[] && ((Object[]) obj).length == 0 || +obj instanceof Collection && ((Collection) obj).isEmpty() || +obj instanceof Map && ((Map) obj).isEmpty()) { +return RETURN_EMPTY; } -return Boolean.FALSE; +return RETURN_NOT_EMPTY; } } diff --git a/java/org/apache/el/parser/AstEmpty.java b/java/org/apache/el/parser/AstEmpty.java index d01e7f18ec..0517091b9c 100644 --- a/java/org/apache/el/parser/AstEmpty.java +++ b/java/org/apache/el/parser/AstEmpty.java @@ -17,43 +17,8 @@ /* Generated By:JJTree: Do not edit this line. AstEmpty.java */ package org.apache.el.parser; -import java.util.Collection; -import java.util.Map; - -import javax.el.ELException; - -import org.apache.el.lang.EvaluationContext; - -/** - * @author Jacob Hookom [ja...@hookom.net] - */ -public final class AstEmpty extends SimpleNode { - +public final class AstEmpty extends AstAbstractEmpty { public AstEmpty(int id) { -super(id); -} - - -@Override -public Class getType(EvaluationContext ctx) throws ELException { -return Boolean.class; -} - - -@Override -public Object getValue(EvaluationContext ctx) throws ELException { -Object obj = this.children[0].getValue(ctx); -if (obj == null) { -return Boolean.TRUE; -} else if (obj instanceof String) { -return Boolean.valueOf(((String) obj).length() == 0); -} else if (obj instanceof Object[]) { -return Boolean.valueOf(((Object[]) obj).length == 0); -} else if (obj instanceof Collection) { -return Boolean.valueOf(((Collection) obj).isEmpty()); -} else if (obj instanceof Map) { -return Boolean.valueOf(((Map) obj).isEmpty()); -} -return Boolean.FALSE; +super(id, false); } } diff --git a/java/org/apache/el/parser/AstNotEmpty.java b/java/org/apache/el/parser/AstNotEmpty.java new file mode 100644 index 00..0066c07afb --- /dev/null +++ b/java/org/apache/el/parser/AstNotEmpty.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyr
(tomcat) 01/04: Add further test case for BZ 69338
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit fab2071c78532d4afdd5a610cc92c07a754dc4d9 Author: Mark Thomas AuthorDate: Thu Sep 26 14:53:23 2024 +0100 Add further test case for BZ 69338 --- .../apache/el/parser/TestELParserPerformance.java | 32 ++ 1 file changed, 32 insertions(+) diff --git a/test/org/apache/el/parser/TestELParserPerformance.java b/test/org/apache/el/parser/TestELParserPerformance.java index 668e0d695d..f92f311041 100644 --- a/test/org/apache/el/parser/TestELParserPerformance.java +++ b/test/org/apache/el/parser/TestELParserPerformance.java @@ -141,4 +141,36 @@ public class TestELParserPerformance { } System.out.println(""); } + + +/* + * Ignored by default since this is an absolute test primarily for + * https://bz.apache.org/bugzilla/show_bug.cgi?id=69338 + */ +@Ignore +@Test +public void testAstNotEmpty() { + +ELManager manager = new ELManager(); +ELContext context = manager.getELContext(); +ExpressionFactory factory = ELManager.getExpressionFactory(); + +for (int j = 0; j < 5; j++) { + +String expression = "${not empty 'abc'}"; + +long start = System.nanoTime(); + +for (int i = 0; i < 1000; i++) { +ValueExpression ve = factory.createValueExpression(context, expression, Boolean.class); +Boolean result = ve.getValue(context); +Assert.assertEquals(Boolean.TRUE, result); +} + +long duration = System.nanoTime() - start; +System.out.println("duration [" + duration + "]"); + +} +System.out.println(""); +} } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/04: Add tests for empty
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 8840684587833d48509ccebfade5d29932aa6406 Author: Mark Thomas AuthorDate: Thu Sep 26 16:32:03 2024 +0100 Add tests for empty --- test/org/apache/el/parser/TestAstEmpty.java| 40 ++ test/org/apache/el/parser/TestAstNotEmpty.java | 40 ++ 2 files changed, 80 insertions(+) diff --git a/test/org/apache/el/parser/TestAstEmpty.java b/test/org/apache/el/parser/TestAstEmpty.java new file mode 100644 index 00..1523967189 --- /dev/null +++ b/test/org/apache/el/parser/TestAstEmpty.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.el.parser; + +import jakarta.el.ELProcessor; + +import org.junit.Assert; +import org.junit.Test; + +public class TestAstEmpty { + +@Test +public void test01() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("empty 'abc'"); +Assert.assertEquals(Boolean.FALSE, result); +} + + +@Test +public void test02() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("empty ''"); +Assert.assertEquals(Boolean.TRUE, result); +} +} diff --git a/test/org/apache/el/parser/TestAstNotEmpty.java b/test/org/apache/el/parser/TestAstNotEmpty.java new file mode 100644 index 00..dceca6bb1c --- /dev/null +++ b/test/org/apache/el/parser/TestAstNotEmpty.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.el.parser; + +import jakarta.el.ELProcessor; + +import org.junit.Assert; +import org.junit.Test; + +public class TestAstNotEmpty { + +@Test +public void test01() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("not empty 'abc'"); +Assert.assertEquals(Boolean.TRUE, result); +} + + +@Test +public void test02() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("not empty ''"); +Assert.assertEquals(Boolean.FALSE, result); +} +} - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 9.0.x updated (bb4a5a0860 -> 53f49059fb)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git from bb4a5a0860 Avoid possible crashes with OpenSSL new fab2071c78 Add further test case for BZ 69338 new 8840684587 Add tests for empty new 35f06b3e96 Complete fix for BZ 69338. Optimise "not empty" new 53f49059fb Update generated code after 'not empty' optimisations The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../{AstEmpty.java => AstAbstractEmpty.java} | 37 +- java/org/apache/el/parser/AstEmpty.java| 39 +- .../org/apache/el/parser/AstNotEmpty.java | 14 +- java/org/apache/el/parser/ELParser.java| 1472 +--- java/org/apache/el/parser/ELParser.jjt |3 + .../org/apache/el/parser/ELParserTokenManager.java | 701 -- .../apache/el/parser/ELParserTreeConstants.java| 45 +- .../parser/{TestAstNot.java => TestAstEmpty.java} | 18 +- .../{TestAstNot.java => TestAstNotEmpty.java} | 16 +- .../apache/el/parser/TestELParserPerformance.java | 32 + webapps/docs/changelog.xml |3 +- 11 files changed, 991 insertions(+), 1389 deletions(-) copy java/org/apache/el/parser/{AstEmpty.java => AstAbstractEmpty.java} (62%) copy test/org/apache/el/parser/TesterBeanB.java => java/org/apache/el/parser/AstNotEmpty.java (82%) copy test/org/apache/el/parser/{TestAstNot.java => TestAstEmpty.java} (77%) copy test/org/apache/el/parser/{TestAstNot.java => TestAstNotEmpty.java} (77%) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 01/04: Add further test case for BZ 69338
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit a501929e6aa3cfbd1789e67cbbe64ce534313d55 Author: Mark Thomas AuthorDate: Thu Sep 26 14:53:23 2024 +0100 Add further test case for BZ 69338 --- .../apache/el/parser/TestELParserPerformance.java | 32 ++ 1 file changed, 32 insertions(+) diff --git a/test/org/apache/el/parser/TestELParserPerformance.java b/test/org/apache/el/parser/TestELParserPerformance.java index 424a6fe27f..c5e8b5a3bc 100644 --- a/test/org/apache/el/parser/TestELParserPerformance.java +++ b/test/org/apache/el/parser/TestELParserPerformance.java @@ -142,4 +142,36 @@ public class TestELParserPerformance extends ELBaseTest { } System.out.println(""); } + + +/* + * Ignored by default since this is an absolute test primarily for + * https://bz.apache.org/bugzilla/show_bug.cgi?id=69338 + */ +@Ignore +@Test +public void testAstNotEmpty() { + +ELManager manager = new ELManager(); +ELContext context = manager.getELContext(); +ExpressionFactory factory = ELManager.getExpressionFactory(); + +for (int j = 0; j < 5; j++) { + +String expression = "${not empty 'abc'}"; + +long start = System.nanoTime(); + +for (int i = 0; i < 1000; i++) { +ValueExpression ve = factory.createValueExpression(context, expression, Boolean.class); +Boolean result = ve.getValue(context); +Assert.assertEquals(Boolean.TRUE, result); +} + +long duration = System.nanoTime() - start; +System.out.println("duration [" + duration + "]"); + +} +System.out.println(""); +} } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 11.0.x updated (43fb4594fe -> 5ba377b5a4)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git from 43fb4594fe Changelog update new a501929e6a Add further test case for BZ 69338 new 89e573e582 Add tests for empty new 52240c4ffe Complete fix for BZ 69338. Optimise "not empty" new 5ba377b5a4 Update generated code for 'not empty' optimisation The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../{AstEmpty.java => AstAbstractEmpty.java} | 35 +- java/org/apache/el/parser/AstEmpty.java| 37 +- .../org/apache/el/parser/AstNotEmpty.java | 14 +- java/org/apache/el/parser/ELParser.java| 853 - java/org/apache/el/parser/ELParser.jjt | 3 + .../apache/el/parser/ELParserTreeConstants.java| 45 +- .../parser/{TestAstNot.java => TestAstEmpty.java} | 16 +- .../{TestAstNot.java => TestAstNotEmpty.java} | 14 +- .../apache/el/parser/TestELParserPerformance.java | 32 + webapps/docs/changelog.xml | 3 +- 10 files changed, 568 insertions(+), 484 deletions(-) copy java/org/apache/el/parser/{AstEmpty.java => AstAbstractEmpty.java} (62%) copy test/org/apache/el/parser/TesterBeanB.java => java/org/apache/el/parser/AstNotEmpty.java (82%) copy test/org/apache/el/parser/{TestAstNot.java => TestAstEmpty.java} (78%) copy test/org/apache/el/parser/{TestAstNot.java => TestAstNotEmpty.java} (78%) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 03/04: Complete fix for BZ 69338. Optimise "not empty"
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 52240c4ffe3cfa0844a338d27b0ac907d1d8638f Author: Mark Thomas AuthorDate: Thu Sep 26 16:33:02 2024 +0100 Complete fix for BZ 69338. Optimise "not empty" --- .../{AstEmpty.java => AstAbstractEmpty.java} | 35 ++-- java/org/apache/el/parser/AstEmpty.java| 37 ++ java/org/apache/el/parser/AstNotEmpty.java | 24 ++ java/org/apache/el/parser/ELParser.jjt | 3 ++ webapps/docs/changelog.xml | 3 +- 5 files changed, 50 insertions(+), 52 deletions(-) diff --git a/java/org/apache/el/parser/AstEmpty.java b/java/org/apache/el/parser/AstAbstractEmpty.java similarity index 62% copy from java/org/apache/el/parser/AstEmpty.java copy to java/org/apache/el/parser/AstAbstractEmpty.java index 0fc73218ed..58577fe267 100644 --- a/java/org/apache/el/parser/AstEmpty.java +++ b/java/org/apache/el/parser/AstAbstractEmpty.java @@ -24,13 +24,21 @@ import jakarta.el.ELException; import org.apache.el.lang.EvaluationContext; +public abstract class AstAbstractEmpty extends SimpleNode { -/** - * @author Jacob Hookom [ja...@hookom.net] - */ -public final class AstEmpty extends SimpleNode { -public AstEmpty(int id) { +private final Boolean RETURN_EMPTY; +private final Boolean RETURN_NOT_EMPTY; + + +public AstAbstractEmpty(int id, boolean invert) { super(id); +if (invert) { +RETURN_EMPTY = Boolean.FALSE; +RETURN_NOT_EMPTY = Boolean.TRUE; +} else { +RETURN_EMPTY = Boolean.TRUE; +RETURN_NOT_EMPTY = Boolean.FALSE; +} } @Override @@ -41,17 +49,12 @@ public final class AstEmpty extends SimpleNode { @Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj = this.children[0].getValue(ctx); -if (obj == null) { -return Boolean.TRUE; -} else if (obj instanceof String) { -return Boolean.valueOf(((String) obj).length() == 0); -} else if (obj instanceof Object[]) { -return Boolean.valueOf(((Object[]) obj).length == 0); -} else if (obj instanceof Collection) { -return Boolean.valueOf(((Collection) obj).isEmpty()); -} else if (obj instanceof Map) { -return Boolean.valueOf(((Map) obj).isEmpty()); +if (obj == null || obj instanceof String && ((String) obj).length() == 0 || +obj instanceof Object[] && ((Object[]) obj).length == 0 || +obj instanceof Collection && ((Collection) obj).isEmpty() || +obj instanceof Map && ((Map) obj).isEmpty()) { +return RETURN_EMPTY; } -return Boolean.FALSE; +return RETURN_NOT_EMPTY; } } diff --git a/java/org/apache/el/parser/AstEmpty.java b/java/org/apache/el/parser/AstEmpty.java index 0fc73218ed..0517091b9c 100644 --- a/java/org/apache/el/parser/AstEmpty.java +++ b/java/org/apache/el/parser/AstEmpty.java @@ -17,41 +17,8 @@ /* Generated By:JJTree: Do not edit this line. AstEmpty.java */ package org.apache.el.parser; -import java.util.Collection; -import java.util.Map; - -import jakarta.el.ELException; - -import org.apache.el.lang.EvaluationContext; - - -/** - * @author Jacob Hookom [ja...@hookom.net] - */ -public final class AstEmpty extends SimpleNode { +public final class AstEmpty extends AstAbstractEmpty { public AstEmpty(int id) { -super(id); -} - -@Override -public Class getType(EvaluationContext ctx) throws ELException { -return Boolean.class; -} - -@Override -public Object getValue(EvaluationContext ctx) throws ELException { -Object obj = this.children[0].getValue(ctx); -if (obj == null) { -return Boolean.TRUE; -} else if (obj instanceof String) { -return Boolean.valueOf(((String) obj).length() == 0); -} else if (obj instanceof Object[]) { -return Boolean.valueOf(((Object[]) obj).length == 0); -} else if (obj instanceof Collection) { -return Boolean.valueOf(((Collection) obj).isEmpty()); -} else if (obj instanceof Map) { -return Boolean.valueOf(((Map) obj).isEmpty()); -} -return Boolean.FALSE; +super(id, false); } } diff --git a/java/org/apache/el/parser/AstNotEmpty.java b/java/org/apache/el/parser/AstNotEmpty.java new file mode 100644 index 00..0066c07afb --- /dev/null +++ b/java/org/apache/el/parser/AstNotEmpty.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this f
(tomcat) branch 10.1.x updated (daeee9c38a -> 0067cdc9ba)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git from daeee9c38a Changelog update new b145298584 Add further test case for BZ 69338 new d8a2effa68 Add tests for empty new f9a0336be9 Complete fix for BZ 69338. Optimise "not empty" new d74158a9cb Code clean-up - no fucntional change new 0067cdc9ba Update generated code after 'not empty' optimisations The 5 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../{AstEmpty.java => AstAbstractEmpty.java} | 36 +- java/org/apache/el/parser/AstEmpty.java| 38 +- .../org/apache/el/parser/AstNotEmpty.java | 13 +- java/org/apache/el/parser/ELParser.java| 1472 +--- java/org/apache/el/parser/ELParser.jjt |3 + .../org/apache/el/parser/ELParserTokenManager.java | 701 -- .../apache/el/parser/ELParserTreeConstants.java| 45 +- .../parser/{TestAstNot.java => TestAstEmpty.java} | 16 +- .../{TestAstNot.java => TestAstNotEmpty.java} | 14 +- .../apache/el/parser/TestELParserPerformance.java | 32 + webapps/docs/changelog.xml |3 +- 11 files changed, 990 insertions(+), 1383 deletions(-) copy java/org/apache/el/parser/{AstEmpty.java => AstAbstractEmpty.java} (62%) copy test/org/apache/el/parser/TesterBeanB.java => java/org/apache/el/parser/AstNotEmpty.java (82%) copy test/org/apache/el/parser/{TestAstNot.java => TestAstEmpty.java} (78%) copy test/org/apache/el/parser/{TestAstNot.java => TestAstNotEmpty.java} (78%) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 01/05: Add further test case for BZ 69338
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit b1452985843bab06638feae953ba70059e193a44 Author: Mark Thomas AuthorDate: Thu Sep 26 14:53:23 2024 +0100 Add further test case for BZ 69338 --- .../apache/el/parser/TestELParserPerformance.java | 32 ++ 1 file changed, 32 insertions(+) diff --git a/test/org/apache/el/parser/TestELParserPerformance.java b/test/org/apache/el/parser/TestELParserPerformance.java index 36b7853c58..7f56c7d224 100644 --- a/test/org/apache/el/parser/TestELParserPerformance.java +++ b/test/org/apache/el/parser/TestELParserPerformance.java @@ -141,4 +141,36 @@ public class TestELParserPerformance { } System.out.println(""); } + + +/* + * Ignored by default since this is an absolute test primarily for + * https://bz.apache.org/bugzilla/show_bug.cgi?id=69338 + */ +@Ignore +@Test +public void testAstNotEmpty() { + +ELManager manager = new ELManager(); +ELContext context = manager.getELContext(); +ExpressionFactory factory = ELManager.getExpressionFactory(); + +for (int j = 0; j < 5; j++) { + +String expression = "${not empty 'abc'}"; + +long start = System.nanoTime(); + +for (int i = 0; i < 1000; i++) { +ValueExpression ve = factory.createValueExpression(context, expression, Boolean.class); +Boolean result = ve.getValue(context); +Assert.assertEquals(Boolean.TRUE, result); +} + +long duration = System.nanoTime() - start; +System.out.println("duration [" + duration + "]"); + +} +System.out.println(""); +} } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 04/05: Code clean-up - no fucntional change
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit d74158a9cbda9e900d98b87eb0f6a03cfcfa481a Author: Mark Thomas AuthorDate: Thu Sep 26 16:45:37 2024 +0100 Code clean-up - no fucntional change --- java/org/apache/el/parser/AstAbstractEmpty.java | 3 +++ java/org/apache/el/parser/AstEmpty.java | 1 + java/org/apache/el/parser/AstNotEmpty.java | 1 + 3 files changed, 5 insertions(+) diff --git a/java/org/apache/el/parser/AstAbstractEmpty.java b/java/org/apache/el/parser/AstAbstractEmpty.java index 58577fe267..03945daa6f 100644 --- a/java/org/apache/el/parser/AstAbstractEmpty.java +++ b/java/org/apache/el/parser/AstAbstractEmpty.java @@ -27,6 +27,7 @@ import org.apache.el.lang.EvaluationContext; public abstract class AstAbstractEmpty extends SimpleNode { private final Boolean RETURN_EMPTY; + private final Boolean RETURN_NOT_EMPTY; @@ -41,11 +42,13 @@ public abstract class AstAbstractEmpty extends SimpleNode { } } + @Override public Class getType(EvaluationContext ctx) throws ELException { return Boolean.class; } + @Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj = this.children[0].getValue(ctx); diff --git a/java/org/apache/el/parser/AstEmpty.java b/java/org/apache/el/parser/AstEmpty.java index 0517091b9c..43289cb638 100644 --- a/java/org/apache/el/parser/AstEmpty.java +++ b/java/org/apache/el/parser/AstEmpty.java @@ -18,6 +18,7 @@ package org.apache.el.parser; public final class AstEmpty extends AstAbstractEmpty { + public AstEmpty(int id) { super(id, false); } diff --git a/java/org/apache/el/parser/AstNotEmpty.java b/java/org/apache/el/parser/AstNotEmpty.java index 0066c07afb..54f47a88a0 100644 --- a/java/org/apache/el/parser/AstNotEmpty.java +++ b/java/org/apache/el/parser/AstNotEmpty.java @@ -18,6 +18,7 @@ package org.apache.el.parser; public final class AstNotEmpty extends AstAbstractEmpty { + public AstNotEmpty(int id) { super(id, true); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 03/05: Complete fix for BZ 69338. Optimise "not empty"
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit f9a0336be9edd10d3387055b198ee4c36454c6dc Author: Mark Thomas AuthorDate: Thu Sep 26 16:33:02 2024 +0100 Complete fix for BZ 69338. Optimise "not empty" --- .../{AstEmpty.java => AstAbstractEmpty.java} | 37 ++-- java/org/apache/el/parser/AstEmpty.java| 39 ++ java/org/apache/el/parser/AstNotEmpty.java | 24 + java/org/apache/el/parser/ELParser.jjt | 3 ++ webapps/docs/changelog.xml | 3 +- 5 files changed, 50 insertions(+), 56 deletions(-) diff --git a/java/org/apache/el/parser/AstEmpty.java b/java/org/apache/el/parser/AstAbstractEmpty.java similarity index 62% copy from java/org/apache/el/parser/AstEmpty.java copy to java/org/apache/el/parser/AstAbstractEmpty.java index 4c54e600b9..58577fe267 100644 --- a/java/org/apache/el/parser/AstEmpty.java +++ b/java/org/apache/el/parser/AstAbstractEmpty.java @@ -24,36 +24,37 @@ import jakarta.el.ELException; import org.apache.el.lang.EvaluationContext; -/** - * @author Jacob Hookom [ja...@hookom.net] - */ -public final class AstEmpty extends SimpleNode { +public abstract class AstAbstractEmpty extends SimpleNode { + +private final Boolean RETURN_EMPTY; +private final Boolean RETURN_NOT_EMPTY; + -public AstEmpty(int id) { +public AstAbstractEmpty(int id, boolean invert) { super(id); +if (invert) { +RETURN_EMPTY = Boolean.FALSE; +RETURN_NOT_EMPTY = Boolean.TRUE; +} else { +RETURN_EMPTY = Boolean.TRUE; +RETURN_NOT_EMPTY = Boolean.FALSE; +} } - @Override public Class getType(EvaluationContext ctx) throws ELException { return Boolean.class; } - @Override public Object getValue(EvaluationContext ctx) throws ELException { Object obj = this.children[0].getValue(ctx); -if (obj == null) { -return Boolean.TRUE; -} else if (obj instanceof String) { -return Boolean.valueOf(((String) obj).length() == 0); -} else if (obj instanceof Object[]) { -return Boolean.valueOf(((Object[]) obj).length == 0); -} else if (obj instanceof Collection) { -return Boolean.valueOf(((Collection) obj).isEmpty()); -} else if (obj instanceof Map) { -return Boolean.valueOf(((Map) obj).isEmpty()); +if (obj == null || obj instanceof String && ((String) obj).length() == 0 || +obj instanceof Object[] && ((Object[]) obj).length == 0 || +obj instanceof Collection && ((Collection) obj).isEmpty() || +obj instanceof Map && ((Map) obj).isEmpty()) { +return RETURN_EMPTY; } -return Boolean.FALSE; +return RETURN_NOT_EMPTY; } } diff --git a/java/org/apache/el/parser/AstEmpty.java b/java/org/apache/el/parser/AstEmpty.java index 4c54e600b9..0517091b9c 100644 --- a/java/org/apache/el/parser/AstEmpty.java +++ b/java/org/apache/el/parser/AstEmpty.java @@ -17,43 +17,8 @@ /* Generated By:JJTree: Do not edit this line. AstEmpty.java */ package org.apache.el.parser; -import java.util.Collection; -import java.util.Map; - -import jakarta.el.ELException; - -import org.apache.el.lang.EvaluationContext; - -/** - * @author Jacob Hookom [ja...@hookom.net] - */ -public final class AstEmpty extends SimpleNode { - +public final class AstEmpty extends AstAbstractEmpty { public AstEmpty(int id) { -super(id); -} - - -@Override -public Class getType(EvaluationContext ctx) throws ELException { -return Boolean.class; -} - - -@Override -public Object getValue(EvaluationContext ctx) throws ELException { -Object obj = this.children[0].getValue(ctx); -if (obj == null) { -return Boolean.TRUE; -} else if (obj instanceof String) { -return Boolean.valueOf(((String) obj).length() == 0); -} else if (obj instanceof Object[]) { -return Boolean.valueOf(((Object[]) obj).length == 0); -} else if (obj instanceof Collection) { -return Boolean.valueOf(((Collection) obj).isEmpty()); -} else if (obj instanceof Map) { -return Boolean.valueOf(((Map) obj).isEmpty()); -} -return Boolean.FALSE; +super(id, false); } } diff --git a/java/org/apache/el/parser/AstNotEmpty.java b/java/org/apache/el/parser/AstNotEmpty.java new file mode 100644 index 00..0066c07afb --- /dev/null +++ b/java/org/apache/el/parser/AstNotEmpty.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding
(tomcat) 02/05: Add tests for empty
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit d8a2effa682a56773b091283ec19e48bd4e0e677 Author: Mark Thomas AuthorDate: Thu Sep 26 16:32:03 2024 +0100 Add tests for empty --- test/org/apache/el/parser/TestAstEmpty.java| 40 ++ test/org/apache/el/parser/TestAstNotEmpty.java | 40 ++ 2 files changed, 80 insertions(+) diff --git a/test/org/apache/el/parser/TestAstEmpty.java b/test/org/apache/el/parser/TestAstEmpty.java new file mode 100644 index 00..1523967189 --- /dev/null +++ b/test/org/apache/el/parser/TestAstEmpty.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.el.parser; + +import jakarta.el.ELProcessor; + +import org.junit.Assert; +import org.junit.Test; + +public class TestAstEmpty { + +@Test +public void test01() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("empty 'abc'"); +Assert.assertEquals(Boolean.FALSE, result); +} + + +@Test +public void test02() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("empty ''"); +Assert.assertEquals(Boolean.TRUE, result); +} +} diff --git a/test/org/apache/el/parser/TestAstNotEmpty.java b/test/org/apache/el/parser/TestAstNotEmpty.java new file mode 100644 index 00..dceca6bb1c --- /dev/null +++ b/test/org/apache/el/parser/TestAstNotEmpty.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.el.parser; + +import jakarta.el.ELProcessor; + +import org.junit.Assert; +import org.junit.Test; + +public class TestAstNotEmpty { + +@Test +public void test01() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("not empty 'abc'"); +Assert.assertEquals(Boolean.TRUE, result); +} + + +@Test +public void test02() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("not empty ''"); +Assert.assertEquals(Boolean.FALSE, result); +} +} - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/04: Add tests for empty
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 5f63ba1590d2135fd3b1063f4561324cd35e3cb3 Author: Mark Thomas AuthorDate: Thu Sep 26 16:32:03 2024 +0100 Add tests for empty --- test/org/apache/el/parser/TestAstEmpty.java| 40 ++ test/org/apache/el/parser/TestAstNotEmpty.java | 40 ++ 2 files changed, 80 insertions(+) diff --git a/test/org/apache/el/parser/TestAstEmpty.java b/test/org/apache/el/parser/TestAstEmpty.java new file mode 100644 index 00..1523967189 --- /dev/null +++ b/test/org/apache/el/parser/TestAstEmpty.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.el.parser; + +import jakarta.el.ELProcessor; + +import org.junit.Assert; +import org.junit.Test; + +public class TestAstEmpty { + +@Test +public void test01() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("empty 'abc'"); +Assert.assertEquals(Boolean.FALSE, result); +} + + +@Test +public void test02() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("empty ''"); +Assert.assertEquals(Boolean.TRUE, result); +} +} diff --git a/test/org/apache/el/parser/TestAstNotEmpty.java b/test/org/apache/el/parser/TestAstNotEmpty.java new file mode 100644 index 00..dceca6bb1c --- /dev/null +++ b/test/org/apache/el/parser/TestAstNotEmpty.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.el.parser; + +import jakarta.el.ELProcessor; + +import org.junit.Assert; +import org.junit.Test; + +public class TestAstNotEmpty { + +@Test +public void test01() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("not empty 'abc'"); +Assert.assertEquals(Boolean.TRUE, result); +} + + +@Test +public void test02() { +ELProcessor processor = new ELProcessor(); +Boolean result = processor.eval("not empty ''"); +Assert.assertEquals(Boolean.FALSE, result); +} +} - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 01/04: Fix typo
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 3f78232a9aacf66459b148a157b7f2f654628380 Author: Mark Thomas AuthorDate: Thu Sep 26 17:04:19 2024 +0100 Fix typo --- java/jakarta/servlet/http/HttpServletResponse.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/jakarta/servlet/http/HttpServletResponse.java b/java/jakarta/servlet/http/HttpServletResponse.java index 85c79c1a8f..b6256a4d0c 100644 --- a/java/jakarta/servlet/http/HttpServletResponse.java +++ b/java/jakarta/servlet/http/HttpServletResponse.java @@ -213,9 +213,9 @@ public interface HttpServletResponse extends ServletResponse { void sendRedirect(String location, int sc, boolean clearBuffer) throws IOException; /** - * Sends a 103 response to the client using the current response headers. This method does not commit the response and - * may be called multiple times before the response is committed. The current response headers may include some headers - * that have been added automatcially by the container. + * Sends a 103 response to the client using the current response headers. This method does not commit the response + * and may be called multiple times before the response is committed. The current response headers may include some + * headers that have been added automatically by the container. * * This method has no effect if called after the response has been committed. * - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/04: Alphabetical order so diffs are easier to follow
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 203efaa8103d5a00e22ece5a7c758a6aef1ecd10 Author: Mark Thomas AuthorDate: Thu Sep 26 17:15:21 2024 +0100 Alphabetical order so diffs are easier to follow I copied setting elements to a spreadsheet, ordered them and copied them back. --- res/ide-support/eclipse/clean-up-asf-tomcat.xml | 238 1 file changed, 119 insertions(+), 119 deletions(-) diff --git a/res/ide-support/eclipse/clean-up-asf-tomcat.xml b/res/ide-support/eclipse/clean-up-asf-tomcat.xml index 8f57829edb..a6e90487f2 100644 --- a/res/ide-support/eclipse/clean-up-asf-tomcat.xml +++ b/res/ide-support/eclipse/clean-up-asf-tomcat.xml @@ -17,144 +17,144 @@ --> - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - + + + + + + + - - - - - - - - + + + + - + + + + + + + + + + + - + + + + - - - - - - - - - + + + + + - - + + + + - - - - - + - - - - + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 04/04: Always use code blocks
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 472173a8e7f7f9f2616022c77bcfd9fb8408bf53 Author: Mark Thomas AuthorDate: Thu Sep 26 17:18:11 2024 +0100 Always use code blocks --- res/ide-support/eclipse/clean-up-asf-tomcat.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/ide-support/eclipse/clean-up-asf-tomcat.xml b/res/ide-support/eclipse/clean-up-asf-tomcat.xml index 2e492cb87d..bea61cada7 100644 --- a/res/ide-support/eclipse/clean-up-asf-tomcat.xml +++ b/res/ide-support/eclipse/clean-up-asf-tomcat.xml @@ -145,7 +145,7 @@ - + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 11.0.x updated (5ba377b5a4 -> b5d8092cd8)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git from 5ba377b5a4 Update generated code for 'not empty' optimisation new 9a749bfdb6 Alphabetical order so diffs are easier to follow new c43bb04200 Update to include Eclipse 2024-06 settings new b5d8092cd8 Always use code blocks The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: res/ide-support/eclipse/clean-up-asf-tomcat.xml | 241 1 file changed, 122 insertions(+), 119 deletions(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 03/03: Always use code blocks
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit b5d8092cd835f0e11b5798ff72d260d83d92 Author: Mark Thomas AuthorDate: Thu Sep 26 17:18:11 2024 +0100 Always use code blocks --- res/ide-support/eclipse/clean-up-asf-tomcat.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/ide-support/eclipse/clean-up-asf-tomcat.xml b/res/ide-support/eclipse/clean-up-asf-tomcat.xml index 2e492cb87d..bea61cada7 100644 --- a/res/ide-support/eclipse/clean-up-asf-tomcat.xml +++ b/res/ide-support/eclipse/clean-up-asf-tomcat.xml @@ -145,7 +145,7 @@ - + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 01/03: Alphabetical order so diffs are easier to follow
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 1ee5a7dcbb3f467f4dc435597802329d0e368b02 Author: Mark Thomas AuthorDate: Thu Sep 26 17:15:21 2024 +0100 Alphabetical order so diffs are easier to follow I copied setting elements to a spreadsheet, ordered them and copied them back. --- res/ide-support/eclipse/clean-up-asf-tomcat.xml | 238 1 file changed, 119 insertions(+), 119 deletions(-) diff --git a/res/ide-support/eclipse/clean-up-asf-tomcat.xml b/res/ide-support/eclipse/clean-up-asf-tomcat.xml index b250c8798a..a6e90487f2 100644 --- a/res/ide-support/eclipse/clean-up-asf-tomcat.xml +++ b/res/ide-support/eclipse/clean-up-asf-tomcat.xml @@ -17,144 +17,144 @@ --> - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - + + + + + + + - - - - - - - - + + + + - + + + + + + + + + + + - + + + + - - - - - - - - - + + + + + - - + + + + - - - - - + - - - - + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/03: Update to include Eclipse 2024-06 settings
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 94b2af3399ef269d9b63a0074d160e1be068adf8 Author: Mark Thomas AuthorDate: Thu Sep 26 17:17:47 2024 +0100 Update to include Eclipse 2024-06 settings --- res/ide-support/eclipse/clean-up-asf-tomcat.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/res/ide-support/eclipse/clean-up-asf-tomcat.xml b/res/ide-support/eclipse/clean-up-asf-tomcat.xml index a6e90487f2..2e492cb87d 100644 --- a/res/ide-support/eclipse/clean-up-asf-tomcat.xml +++ b/res/ide-support/eclipse/clean-up-asf-tomcat.xml @@ -27,6 +27,7 @@ + @@ -115,6 +116,7 @@ + @@ -126,6 +128,7 @@ + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 01/03: Alphabetical order so diffs are easier to follow
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 78dfd20459e72011edf46fea5860588e53fe5ea8 Author: Mark Thomas AuthorDate: Thu Sep 26 17:15:21 2024 +0100 Alphabetical order so diffs are easier to follow I copied setting elements to a spreadsheet, ordered them and copied them back. --- res/ide-support/eclipse/clean-up-asf-tomcat.xml | 238 1 file changed, 119 insertions(+), 119 deletions(-) diff --git a/res/ide-support/eclipse/clean-up-asf-tomcat.xml b/res/ide-support/eclipse/clean-up-asf-tomcat.xml index b250c8798a..a6e90487f2 100644 --- a/res/ide-support/eclipse/clean-up-asf-tomcat.xml +++ b/res/ide-support/eclipse/clean-up-asf-tomcat.xml @@ -17,144 +17,144 @@ --> - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - + + + + + + + - - - - - - - - + + + + - + + + + + + + + + + + - + + + + - - - - - - - - - + + + + + - - + + + + - - - - - + - - - - + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/03: Update to include Eclipse 2024-06 settings
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit c43bb042003b06fbd1c593475230f2a106010f61 Author: Mark Thomas AuthorDate: Thu Sep 26 17:17:47 2024 +0100 Update to include Eclipse 2024-06 settings --- res/ide-support/eclipse/clean-up-asf-tomcat.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/res/ide-support/eclipse/clean-up-asf-tomcat.xml b/res/ide-support/eclipse/clean-up-asf-tomcat.xml index a6e90487f2..2e492cb87d 100644 --- a/res/ide-support/eclipse/clean-up-asf-tomcat.xml +++ b/res/ide-support/eclipse/clean-up-asf-tomcat.xml @@ -27,6 +27,7 @@ + @@ -115,6 +116,7 @@ + @@ -126,6 +128,7 @@ + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 10.1.x updated (0067cdc9ba -> 9b439fcc72)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git from 0067cdc9ba Update generated code after 'not empty' optimisations new 1ee5a7dcbb Alphabetical order so diffs are easier to follow new 94b2af3399 Update to include Eclipse 2024-06 settings new 9b439fcc72 Always use code blocks The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: res/ide-support/eclipse/clean-up-asf-tomcat.xml | 241 1 file changed, 122 insertions(+), 119 deletions(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 03/03: Always use code blocks
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 9b439fcc7235088a4fe936eed81bd5dc51b19e1a Author: Mark Thomas AuthorDate: Thu Sep 26 17:18:11 2024 +0100 Always use code blocks --- res/ide-support/eclipse/clean-up-asf-tomcat.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/ide-support/eclipse/clean-up-asf-tomcat.xml b/res/ide-support/eclipse/clean-up-asf-tomcat.xml index 2e492cb87d..bea61cada7 100644 --- a/res/ide-support/eclipse/clean-up-asf-tomcat.xml +++ b/res/ide-support/eclipse/clean-up-asf-tomcat.xml @@ -145,7 +145,7 @@ - + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 01/03: Alphabetical order so diffs are easier to follow
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 9a749bfdb60f1244c2b69ee78b8277278115a24f Author: Mark Thomas AuthorDate: Thu Sep 26 17:15:21 2024 +0100 Alphabetical order so diffs are easier to follow I copied setting elements to a spreadsheet, ordered them and copied them back. --- res/ide-support/eclipse/clean-up-asf-tomcat.xml | 238 1 file changed, 119 insertions(+), 119 deletions(-) diff --git a/res/ide-support/eclipse/clean-up-asf-tomcat.xml b/res/ide-support/eclipse/clean-up-asf-tomcat.xml index 8f57829edb..a6e90487f2 100644 --- a/res/ide-support/eclipse/clean-up-asf-tomcat.xml +++ b/res/ide-support/eclipse/clean-up-asf-tomcat.xml @@ -17,144 +17,144 @@ --> - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - + + + + + + + - - - - - - - - + + + + - + + + + + + + + + + + - + + + + - - - - - - - - - + + + + + - - + + + + - - - - - + - - - - + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/03: Update to include Eclipse 2024-06 settings
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 3aac5a1ecab97989d4956bbc9d3bc29a3ab114b5 Author: Mark Thomas AuthorDate: Thu Sep 26 17:17:47 2024 +0100 Update to include Eclipse 2024-06 settings --- res/ide-support/eclipse/clean-up-asf-tomcat.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/res/ide-support/eclipse/clean-up-asf-tomcat.xml b/res/ide-support/eclipse/clean-up-asf-tomcat.xml index a6e90487f2..2e492cb87d 100644 --- a/res/ide-support/eclipse/clean-up-asf-tomcat.xml +++ b/res/ide-support/eclipse/clean-up-asf-tomcat.xml @@ -27,6 +27,7 @@ + @@ -115,6 +116,7 @@ + @@ -126,6 +128,7 @@ + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 9.0.x updated (53f49059fb -> c9293e2ab4)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git from 53f49059fb Update generated code after 'not empty' optimisations new 78dfd20459 Alphabetical order so diffs are easier to follow new 3aac5a1eca Update to include Eclipse 2024-06 settings new c9293e2ab4 Always use code blocks The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: res/ide-support/eclipse/clean-up-asf-tomcat.xml | 241 1 file changed, 122 insertions(+), 119 deletions(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 03/03: Always use code blocks
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit c9293e2ab477e15c199234c8a6f37016c75084e2 Author: Mark Thomas AuthorDate: Thu Sep 26 17:18:11 2024 +0100 Always use code blocks --- res/ide-support/eclipse/clean-up-asf-tomcat.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/ide-support/eclipse/clean-up-asf-tomcat.xml b/res/ide-support/eclipse/clean-up-asf-tomcat.xml index 2e492cb87d..bea61cada7 100644 --- a/res/ide-support/eclipse/clean-up-asf-tomcat.xml +++ b/res/ide-support/eclipse/clean-up-asf-tomcat.xml @@ -145,7 +145,7 @@ - + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 03/04: Update to include Eclipse 2024-06 settings
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 57f00736041b572ba1405413510387fd82557cd4 Author: Mark Thomas AuthorDate: Thu Sep 26 17:17:47 2024 +0100 Update to include Eclipse 2024-06 settings --- res/ide-support/eclipse/clean-up-asf-tomcat.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/res/ide-support/eclipse/clean-up-asf-tomcat.xml b/res/ide-support/eclipse/clean-up-asf-tomcat.xml index a6e90487f2..2e492cb87d 100644 --- a/res/ide-support/eclipse/clean-up-asf-tomcat.xml +++ b/res/ide-support/eclipse/clean-up-asf-tomcat.xml @@ -27,6 +27,7 @@ + @@ -115,6 +116,7 @@ + @@ -126,6 +128,7 @@ + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch main updated (8bd408fe69 -> 472173a8e7)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git from 8bd408fe69 Update generated code for optimised "not empty" support new 3f78232a9a Fix typo new 203efaa810 Alphabetical order so diffs are easier to follow new 57f0073604 Update to include Eclipse 2024-06 settings new 472173a8e7 Always use code blocks The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: java/jakarta/servlet/http/HttpServletResponse.java | 6 +- res/ide-support/eclipse/clean-up-asf-tomcat.xml| 241 +++-- 2 files changed, 125 insertions(+), 122 deletions(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Buildbot failure in on tomcat-12.0.x
On Thu, Sep 26, 2024 at 11:50 AM Rémy Maucherat wrote: > > On Thu, Sep 26, 2024 at 11:18 AM wrote: > > > > Build status: BUILD FAILED: failed compile (failure) > > Worker used: bb_worker2_ubuntu > > URL: https://ci2.apache.org/#builders/120/builds/81 > > Blamelist: remm > > Build Text: failed compile (failure) > > Status Detected: new failure > > Build Source Stamp: [branch main] 36c226f2141573a841b6cd4d7ad8e8b582080510 > > Certificate reloading, plus the use of the FFM version of the > implementation in parallel, causes a reliable crash on shutdown for > tomcat-native/JNI. I haven't been able to find out yet what is wrong > (certainly this kind of use is inappropriate, you would use either > tomcat-native or FFM, not both). The crash scenario seems to be like this: - The OpenSSL/JNI test runs, everything is good. - During the test, a certificate reload is done, leaving a dangling SSL_CTX from OpenSSL, associated with an OpenSSL context object. SSL_CTX_free is run whenever GC occurs through a cleaner. - Library.terminate() is called since Tomcat is destroyed at the end of the test. - GC is independent from that and the JVM is still running, so the OpenSSL context object is still there. No crash (yet), but the JVM crash is now unavoidable. - *In the same JVM*, the OpenSSL/FFM test now starts. - The test runs fine, does its own certificate reloading, leaving another OpenSSL unrefed context object. - JVM sees some objects to GC, GC finally runs in parallel with everything (it would not be fun otherwise). - GC cleans up the OpenSSL context from the OpenSSL/JNI test run. However, since APR has been released in terminateAPR, this crashes the JVM in some random location (OpenSSL, APR, etc) but always while running the org.apache.tomcat.jni.SSLContext.free method. It seems to be fixed if I add a System.gc() in AprLifecycleListener.terminateAPR(), which would cause the unreferenced OpenSSL contexts to go through their SSL_CTX_free immediately. Fingers crossed ... This seems to be an acceptable compromise to be able to run the testsuite efficiently. Rémy > Rémy > > > > > Steps: > > > > worker_preparation: 0 > > > > git: 0 > > > > shell: 0 > > > > shell_1: 0 > > > > shell_2: 0 > > > > shell_3: 0 > > > > shell_4: 0 > > > > shell_5: 0 > > > > shell_6: 0 > > > > compile: 1 > > > > shell_7: 0 > > > > shell_8: 0 > > > > shell_9: 0 > > > > shell_10: 0 > > > > Rsync docs to nightlies.apache.org: 0 > > > > shell_11: 0 > > > > Rsync RAT to nightlies.apache.org: 0 > > > > compile_1: 2 > > > > shell_12: 0 > > > > Rsync Logs to nightlies.apache.org: 0 > > > > > > -- ASF Buildbot > > > > > > - > > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > > For additional commands, e-mail: dev-h...@tomcat.apache.org > > - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 11.0.x updated: Drop the cheat for experimenting
This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/11.0.x by this push: new c6ac581742 Drop the cheat for experimenting c6ac581742 is described below commit c6ac581742410da3a89b5c01d976e78eed96bf55 Author: remm AuthorDate: Thu Sep 26 10:31:06 2024 +0200 Drop the cheat for experimenting Some crashes may occur ... --- test/org/apache/catalina/manager/TestManagerWebappSsl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/org/apache/catalina/manager/TestManagerWebappSsl.java b/test/org/apache/catalina/manager/TestManagerWebappSsl.java index 19d19c619c..fe8aed4fe5 100644 --- a/test/org/apache/catalina/manager/TestManagerWebappSsl.java +++ b/test/org/apache/catalina/manager/TestManagerWebappSsl.java @@ -54,10 +54,10 @@ public class TestManagerWebappSsl extends TomcatBaseTest { List parameterSets = new ArrayList<>(); parameterSets.add(new Object[] { "JSSE", Boolean.FALSE, "org.apache.tomcat.util.net.jsse.JSSEImplementation"}); -parameterSets.add(new Object[] { -"OpenSSL-FFM", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation"}); parameterSets.add(new Object[] { "OpenSSL", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.OpenSSLImplementation"}); +parameterSets.add(new Object[] { +"OpenSSL-FFM", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation"}); return parameterSets; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 9.0.x updated: Drop the cheat for experimenting
This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/9.0.x by this push: new c31292af32 Drop the cheat for experimenting c31292af32 is described below commit c31292af32fae4dab4c2d0d28414d26e99e0dcb4 Author: remm AuthorDate: Thu Sep 26 10:31:06 2024 +0200 Drop the cheat for experimenting Some crashes may occur ... --- test/org/apache/catalina/manager/TestManagerWebappSsl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/org/apache/catalina/manager/TestManagerWebappSsl.java b/test/org/apache/catalina/manager/TestManagerWebappSsl.java index 0eb49ce181..bfe028a8c8 100644 --- a/test/org/apache/catalina/manager/TestManagerWebappSsl.java +++ b/test/org/apache/catalina/manager/TestManagerWebappSsl.java @@ -54,10 +54,10 @@ public class TestManagerWebappSsl extends TomcatBaseTest { List parameterSets = new ArrayList<>(); parameterSets.add(new Object[] { "JSSE", Boolean.FALSE, "org.apache.tomcat.util.net.jsse.JSSEImplementation"}); -parameterSets.add(new Object[] { -"OpenSSL-FFM", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation"}); parameterSets.add(new Object[] { "OpenSSL", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.OpenSSLImplementation"}); +parameterSets.add(new Object[] { +"OpenSSL-FFM", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation"}); return parameterSets; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 10.1.x updated: Drop the cheat for experimenting
This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/10.1.x by this push: new 87443ce4dc Drop the cheat for experimenting 87443ce4dc is described below commit 87443ce4dcf254d4fdfb72285bc0b68bf0af1b05 Author: remm AuthorDate: Thu Sep 26 10:31:06 2024 +0200 Drop the cheat for experimenting Some crashes may occur ... --- test/org/apache/catalina/manager/TestManagerWebappSsl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/org/apache/catalina/manager/TestManagerWebappSsl.java b/test/org/apache/catalina/manager/TestManagerWebappSsl.java index 19d19c619c..fe8aed4fe5 100644 --- a/test/org/apache/catalina/manager/TestManagerWebappSsl.java +++ b/test/org/apache/catalina/manager/TestManagerWebappSsl.java @@ -54,10 +54,10 @@ public class TestManagerWebappSsl extends TomcatBaseTest { List parameterSets = new ArrayList<>(); parameterSets.add(new Object[] { "JSSE", Boolean.FALSE, "org.apache.tomcat.util.net.jsse.JSSEImplementation"}); -parameterSets.add(new Object[] { -"OpenSSL-FFM", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation"}); parameterSets.add(new Object[] { "OpenSSL", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.OpenSSLImplementation"}); +parameterSets.add(new Object[] { +"OpenSSL-FFM", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation"}); return parameterSets; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch main updated: Avoid possible crashes with OpenSSL
This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/main by this push: new 405672312b Avoid possible crashes with OpenSSL 405672312b is described below commit 405672312b6d2e1efb906fb60bd47306be53ccf2 Author: remm AuthorDate: Thu Sep 26 16:53:03 2024 +0200 Avoid possible crashes with OpenSSL Some SSL_CTX might be lying around and still tied to GC. GC might occur after Library.terminate. This should mostly occur with the Tomcat testsuite. --- java/org/apache/catalina/core/AprLifecycleListener.java| 2 ++ java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/java/org/apache/catalina/core/AprLifecycleListener.java b/java/org/apache/catalina/core/AprLifecycleListener.java index e7f65cfb02..2502e1132b 100644 --- a/java/org/apache/catalina/core/AprLifecycleListener.java +++ b/java/org/apache/catalina/core/AprLifecycleListener.java @@ -193,6 +193,8 @@ public class AprLifecycleListener implements LifecycleListener { AprStatus.setAprAvailable(false); fipsModeActive = false; sslInitialized = false; // terminate() will clean the pool +// There could be unreferenced SSL_CTX still waiting for GC +System.gc(); Library.terminate(); } diff --git a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java index df90d84bcf..17204fd274 100644 --- a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java +++ b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java @@ -350,6 +350,8 @@ public class OpenSSLLibrary { try { if (OpenSSL_version_num() < 0x300fL) { +// There could be unreferenced SSL_CTX still waiting for GC +System.gc(); freeDHParameters(); if (!MemorySegment.NULL.equals(enginePointer)) { ENGINE_free(enginePointer); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 9.0.x updated: Avoid possible crashes with OpenSSL
This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/9.0.x by this push: new bb4a5a0860 Avoid possible crashes with OpenSSL bb4a5a0860 is described below commit bb4a5a08603d8e1d67b4249fe8c634571a6ec852 Author: remm AuthorDate: Thu Sep 26 16:53:03 2024 +0200 Avoid possible crashes with OpenSSL Some SSL_CTX might be lying around and still tied to GC. GC might occur after Library.terminate. This should mostly occur with the Tomcat testsuite. --- java/org/apache/catalina/core/AprLifecycleListener.java| 2 ++ java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java | 2 ++ webapps/docs/changelog.xml | 7 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/core/AprLifecycleListener.java b/java/org/apache/catalina/core/AprLifecycleListener.java index d3fbfbdfb1..4a60d53ff8 100644 --- a/java/org/apache/catalina/core/AprLifecycleListener.java +++ b/java/org/apache/catalina/core/AprLifecycleListener.java @@ -193,6 +193,8 @@ public class AprLifecycleListener implements LifecycleListener { AprStatus.setAprAvailable(false); fipsModeActive = false; sslInitialized = false; // Well we cleaned the pool in terminate. +// There could be unreferenced SSL_CTX still waiting for GC +System.gc(); Library.threadSafeTerminate(); } diff --git a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java index df90d84bcf..17204fd274 100644 --- a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java +++ b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java @@ -350,6 +350,8 @@ public class OpenSSLLibrary { try { if (OpenSSL_version_num() < 0x300fL) { +// There could be unreferenced SSL_CTX still waiting for GC +System.gc(); freeDHParameters(); if (!MemorySegment.NULL.equals(enginePointer)) { ENGINE_free(enginePointer); diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 68af6d696a..61001544a9 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -151,8 +151,13 @@ Add server and serverRemoveAppProvidedValues to the list of attributes the HTTP/2 protocol will inherit from the -HTTP/1.1 connector it is nested within. +HTTP/1.1 connector it is nested within. (markt) + +Avoid possible crashes when using Apache Tomcat Native, caused by +destroying SSLContext objects through GC after APR has been terminated. +(remm) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/02: Changelog update
This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit daeee9c38a3cd319109c098305a8a016bb51c616 Author: remm AuthorDate: Thu Sep 26 17:02:31 2024 +0200 Changelog update --- webapps/docs/changelog.xml | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index f8290bb500..423f58381d 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -160,8 +160,13 @@ Add server and serverRemoveAppProvidedValues to the list of attributes the HTTP/2 protocol will inherit from the -HTTP/1.1 connector it is nested within. +HTTP/1.1 connector it is nested within. (markt) + +Avoid possible crashes when using Apache Tomcat Native, caused by +destroying SSLContext objects through GC after APR has been terminated. +(remm) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 01/02: Avoid possible crashes with OpenSSL
This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 5a69632ad5b5859254f3be0714481e5f57265791 Author: remm AuthorDate: Thu Sep 26 16:53:03 2024 +0200 Avoid possible crashes with OpenSSL Some SSL_CTX might be lying around and still tied to GC. GC might occur after Library.terminate. This should mostly occur with the Tomcat testsuite. --- java/org/apache/catalina/core/AprLifecycleListener.java| 2 ++ java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/java/org/apache/catalina/core/AprLifecycleListener.java b/java/org/apache/catalina/core/AprLifecycleListener.java index e7f65cfb02..2502e1132b 100644 --- a/java/org/apache/catalina/core/AprLifecycleListener.java +++ b/java/org/apache/catalina/core/AprLifecycleListener.java @@ -193,6 +193,8 @@ public class AprLifecycleListener implements LifecycleListener { AprStatus.setAprAvailable(false); fipsModeActive = false; sslInitialized = false; // terminate() will clean the pool +// There could be unreferenced SSL_CTX still waiting for GC +System.gc(); Library.terminate(); } diff --git a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java index df90d84bcf..17204fd274 100644 --- a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java +++ b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java @@ -350,6 +350,8 @@ public class OpenSSLLibrary { try { if (OpenSSL_version_num() < 0x300fL) { +// There could be unreferenced SSL_CTX still waiting for GC +System.gc(); freeDHParameters(); if (!MemorySegment.NULL.equals(enginePointer)) { ENGINE_free(enginePointer); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 10.1.x updated (87443ce4dc -> daeee9c38a)
This is an automated email from the ASF dual-hosted git repository. remm pushed a change to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git from 87443ce4dc Drop the cheat for experimenting new 5a69632ad5 Avoid possible crashes with OpenSSL new daeee9c38a Changelog update The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: java/org/apache/catalina/core/AprLifecycleListener.java| 2 ++ java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java | 2 ++ webapps/docs/changelog.xml | 7 ++- 3 files changed, 10 insertions(+), 1 deletion(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 11.0.x updated (c6ac581742 -> 43fb4594fe)
This is an automated email from the ASF dual-hosted git repository. remm pushed a change to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git from c6ac581742 Drop the cheat for experimenting new ab671fc699 Avoid possible crashes with OpenSSL new 43fb4594fe Changelog update The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: java/org/apache/catalina/core/AprLifecycleListener.java| 2 ++ java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java | 2 ++ webapps/docs/changelog.xml | 7 ++- 3 files changed, 10 insertions(+), 1 deletion(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 01/02: Avoid possible crashes with OpenSSL
This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit ab671fc699a64eb37b2a2dcac7096d680085c8a1 Author: remm AuthorDate: Thu Sep 26 16:53:03 2024 +0200 Avoid possible crashes with OpenSSL Some SSL_CTX might be lying around and still tied to GC. GC might occur after Library.terminate. This should mostly occur with the Tomcat testsuite. --- java/org/apache/catalina/core/AprLifecycleListener.java| 2 ++ java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/java/org/apache/catalina/core/AprLifecycleListener.java b/java/org/apache/catalina/core/AprLifecycleListener.java index e7f65cfb02..2502e1132b 100644 --- a/java/org/apache/catalina/core/AprLifecycleListener.java +++ b/java/org/apache/catalina/core/AprLifecycleListener.java @@ -193,6 +193,8 @@ public class AprLifecycleListener implements LifecycleListener { AprStatus.setAprAvailable(false); fipsModeActive = false; sslInitialized = false; // terminate() will clean the pool +// There could be unreferenced SSL_CTX still waiting for GC +System.gc(); Library.terminate(); } diff --git a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java index df90d84bcf..17204fd274 100644 --- a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java +++ b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLLibrary.java @@ -350,6 +350,8 @@ public class OpenSSLLibrary { try { if (OpenSSL_version_num() < 0x300fL) { +// There could be unreferenced SSL_CTX still waiting for GC +System.gc(); freeDHParameters(); if (!MemorySegment.NULL.equals(enginePointer)) { ENGINE_free(enginePointer); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) 02/02: Changelog update
This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 43fb4594fe9c34292ebe1c6fc0c1ade2cfcded74 Author: remm AuthorDate: Thu Sep 26 17:04:40 2024 +0200 Changelog update --- webapps/docs/changelog.xml | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index ef38a12290..b22cf7c6e6 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -160,8 +160,13 @@ Add server and serverRemoveAppProvidedValues to the list of attributes the HTTP/2 protocol will inherit from the -HTTP/1.1 connector it is nested within. +HTTP/1.1 connector it is nested within. (markt) + +Avoid possible crashes when using Apache Tomcat Native, caused by +destroying SSLContext objects through GC after APR has been terminated. +(remm) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Buildbot failure in on tomcat-12.0.x
On 26/09/2024 15:46, Rémy Maucherat wrote: On Thu, Sep 26, 2024 at 11:50 AM Rémy Maucherat wrote: On Thu, Sep 26, 2024 at 11:18 AM wrote: Build status: BUILD FAILED: failed compile (failure) Worker used: bb_worker2_ubuntu URL: https://ci2.apache.org/#builders/120/builds/81 Blamelist: remm Build Text: failed compile (failure) Status Detected: new failure Build Source Stamp: [branch main] 36c226f2141573a841b6cd4d7ad8e8b582080510 Certificate reloading, plus the use of the FFM version of the implementation in parallel, causes a reliable crash on shutdown for tomcat-native/JNI. I haven't been able to find out yet what is wrong (certainly this kind of use is inappropriate, you would use either tomcat-native or FFM, not both). The crash scenario seems to be like this: - The OpenSSL/JNI test runs, everything is good. - During the test, a certificate reload is done, leaving a dangling SSL_CTX from OpenSSL, associated with an OpenSSL context object. SSL_CTX_free is run whenever GC occurs through a cleaner. - Library.terminate() is called since Tomcat is destroyed at the end of the test. - GC is independent from that and the JVM is still running, so the OpenSSL context object is still there. No crash (yet), but the JVM crash is now unavoidable. - *In the same JVM*, the OpenSSL/FFM test now starts. - The test runs fine, does its own certificate reloading, leaving another OpenSSL unrefed context object. - JVM sees some objects to GC, GC finally runs in parallel with everything (it would not be fun otherwise). - GC cleans up the OpenSSL context from the OpenSSL/JNI test run. However, since APR has been released in terminateAPR, this crashes the JVM in some random location (OpenSSL, APR, etc) but always while running the org.apache.tomcat.jni.SSLContext.free method. It seems to be fixed if I add a System.gc() in AprLifecycleListener.terminateAPR(), which would cause the unreferenced OpenSSL contexts to go through their SSL_CTX_free immediately. Fingers crossed ... This seems to be an acceptable compromise to be able to run the testsuite efficiently. That seems reasonable to me. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Buildbot failure in on tomcat-10.1.x
Build status: BUILD FAILED: failed compile (failure) Worker used: bb_worker2_ubuntu URL: https://ci2.apache.org/#builders/44/builds/1415 Blamelist: Mark Thomas , remm Build Text: failed compile (failure) Status Detected: new failure Build Source Stamp: [branch 10.1.x] 9b439fcc7235088a4fe936eed81bd5dc51b19e1a Steps: worker_preparation: 0 git: 0 shell: 0 shell_1: 0 shell_2: 0 shell_3: 0 shell_4: 0 shell_5: 0 compile: 1 shell_6: 0 shell_7: 0 shell_8: 0 shell_9: 0 Rsync docs to nightlies.apache.org: 0 shell_10: 0 Rsync RAT to nightlies.apache.org: 0 compile_1: 2 shell_11: 0 Rsync Logs to nightlies.apache.org: 0 -- ASF Buildbot - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Buildbot success in on tomcat-11.0.x
Build status: Build succeeded! Worker used: bb_worker2_ubuntu URL: https://ci2.apache.org/#builders/112/builds/1298 Blamelist: Mark Thomas , remm Build Text: build successful Status Detected: restored build Build Source Stamp: [branch 11.0.x] b5d8092cd835f0e11b5798ff72d260d83d92 Steps: worker_preparation: 0 git: 0 shell: 0 shell_1: 0 shell_2: 0 shell_3: 0 shell_4: 0 shell_5: 0 shell_6: 0 compile: 1 shell_7: 0 shell_8: 0 shell_9: 0 shell_10: 0 Rsync docs to nightlies.apache.org: 0 shell_11: 0 Rsync RAT to nightlies.apache.org: 0 compile_1: 1 shell_12: 0 Rsync Logs to nightlies.apache.org: 0 -- ASF Buildbot - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Buildbot failure in on tomcat-9.0.x
Build status: BUILD FAILED: compile (failure) Logs copied. (failure) Worker used: bb_worker2_ubuntu URL: https://ci2.apache.org/#builders/37/builds/1097 Blamelist: Mark Thomas , remm Build Text: compile (failure) Logs copied. (failure) Status Detected: new failure Build Source Stamp: [branch 9.0.x] c9293e2ab477e15c199234c8a6f37016c75084e2 Steps: worker_preparation: 0 git: 0 shell: 0 shell_1: 0 shell_2: 0 shell_3: 0 shell_4: 0 shell_5: 0 compile: 1 shell_6: 0 shell_7: 0 shell_8: 0 shell_9: 0 Rsync docs to nightlies.apache.org: 0 shell_10: 0 Rsync RAT to nightlies.apache.org: 0 compile_1: 2 shell_11: 2 -- ASF Buildbot - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org