Reminder: Community Over Code Asia 2024 CFP closes on Apr 22nd
Hi All, The CFP for Community Over Code Asia, including the Web server and Tomcat track, is closing very soon - at 4:00 PM on 22 Apr 2024 Beijing time. Details: https://sessionize.com/communityovercode-asia-2024 Please do not wait until the last minute. We hope to see you in Hangzhou! -- Best Regards! Huxing - 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: Add openssl ffm testing
This is an automated email from the ASF dual-hosted git repository. rjung 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 1ffc62afa7 Add openssl ffm testing 1ffc62afa7 is described below commit 1ffc62afa7e61d6570a18abbb94a238fa995d767 Author: Rainer Jung AuthorDate: Thu Apr 18 23:11:48 2024 +0200 Add openssl ffm testing --- .../catalina/valves/rewrite/TestResolverSSL.java | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java index 2bebd2cbf5..978ab23c25 100644 --- a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java +++ b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java @@ -35,6 +35,7 @@ import org.apache.catalina.Container; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.apache.catalina.core.AprLifecycleListener; +import org.apache.catalina.core.OpenSSLLifecycleListener; import org.apache.catalina.core.StandardServer; import org.apache.catalina.startup.Tomcat; import org.apache.catalina.startup.TomcatBaseTest; @@ -42,6 +43,7 @@ import org.apache.catalina.valves.ValveBase; import org.apache.tomcat.util.buf.ByteChunk; import org.apache.tomcat.util.net.SSLHostConfig; import org.apache.tomcat.util.net.TesterSupport; +import org.apache.tomcat.util.net.openssl.OpenSSLImplementation; @RunWith(Parameterized.class) public class TestResolverSSL extends TomcatBaseTest { @@ -52,6 +54,8 @@ public class TestResolverSSL extends TomcatBaseTest { parameterSets.add(new Object[] { "JSSE", Boolean.FALSE, "org.apache.tomcat.util.net.jsse.JSSEImplementation" }); parameterSets.add( new Object[] { "OpenSSL", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.OpenSSLImplementation" }); +parameterSets.add( +new Object[] { "OpenSSL", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation" }); return parameterSets; } @@ -173,10 +177,17 @@ public class TestResolverSSL extends TomcatBaseTest { Assert.assertTrue(tomcat.getConnector().setProperty("sslImplementationName", sslImplementationName)); if (useOpenSSL) { -AprLifecycleListener listener = new AprLifecycleListener(); -Assume.assumeTrue(AprLifecycleListener.isAprAvailable()); -StandardServer server = (StandardServer) tomcat.getServer(); -server.addLifecycleListener(listener); +if (OpenSSLImplementation.class.getName().equals(sslImplementationName)) { +AprLifecycleListener listener = new AprLifecycleListener(); +Assume.assumeTrue(AprLifecycleListener.isAprAvailable()); +StandardServer server = (StandardServer) tomcat.getServer(); +server.addLifecycleListener(listener); +} else if ("org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation".equals(sslImplementationName)) { +OpenSSLLifecycleListener listener = new OpenSSLLifecycleListener(); +Assume.assumeTrue(OpenSSLLifecycleListener.isAvailable()); +StandardServer server = (StandardServer) tomcat.getServer(); +server.addLifecycleListener(listener); +} } } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch main updated: Add openssl ffm testing
This is an automated email from the ASF dual-hosted git repository. rjung 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 17f779bf7b Add openssl ffm testing new 899e06a7ba Merge branch 'main' of https://github.com/apache/tomcat 17f779bf7b is described below commit 17f779bf7bb48e30e77146cee10a0d52194eaa7a Author: Rainer Jung AuthorDate: Thu Apr 18 23:11:48 2024 +0200 Add openssl ffm testing --- .../catalina/valves/rewrite/TestResolverSSL.java | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java index 2bebd2cbf5..978ab23c25 100644 --- a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java +++ b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java @@ -35,6 +35,7 @@ import org.apache.catalina.Container; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.apache.catalina.core.AprLifecycleListener; +import org.apache.catalina.core.OpenSSLLifecycleListener; import org.apache.catalina.core.StandardServer; import org.apache.catalina.startup.Tomcat; import org.apache.catalina.startup.TomcatBaseTest; @@ -42,6 +43,7 @@ import org.apache.catalina.valves.ValveBase; import org.apache.tomcat.util.buf.ByteChunk; import org.apache.tomcat.util.net.SSLHostConfig; import org.apache.tomcat.util.net.TesterSupport; +import org.apache.tomcat.util.net.openssl.OpenSSLImplementation; @RunWith(Parameterized.class) public class TestResolverSSL extends TomcatBaseTest { @@ -52,6 +54,8 @@ public class TestResolverSSL extends TomcatBaseTest { parameterSets.add(new Object[] { "JSSE", Boolean.FALSE, "org.apache.tomcat.util.net.jsse.JSSEImplementation" }); parameterSets.add( new Object[] { "OpenSSL", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.OpenSSLImplementation" }); +parameterSets.add( +new Object[] { "OpenSSL", Boolean.TRUE, "org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation" }); return parameterSets; } @@ -173,10 +177,17 @@ public class TestResolverSSL extends TomcatBaseTest { Assert.assertTrue(tomcat.getConnector().setProperty("sslImplementationName", sslImplementationName)); if (useOpenSSL) { -AprLifecycleListener listener = new AprLifecycleListener(); -Assume.assumeTrue(AprLifecycleListener.isAprAvailable()); -StandardServer server = (StandardServer) tomcat.getServer(); -server.addLifecycleListener(listener); +if (OpenSSLImplementation.class.getName().equals(sslImplementationName)) { +AprLifecycleListener listener = new AprLifecycleListener(); +Assume.assumeTrue(AprLifecycleListener.isAprAvailable()); +StandardServer server = (StandardServer) tomcat.getServer(); +server.addLifecycleListener(listener); +} else if ("org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation".equals(sslImplementationName)) { +OpenSSLLifecycleListener listener = new OpenSSLLifecycleListener(); +Assume.assumeTrue(OpenSSLLifecycleListener.isAvailable()); +StandardServer server = (StandardServer) tomcat.getServer(); +server.addLifecycleListener(listener); +} } } } - 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: Dispatch after AsyncListener.onError() should actually dispatch
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 31fc71858f Dispatch after AsyncListener.onError() should actually dispatch 31fc71858f is described below commit 31fc71858f9212fb8c1c508d3cafb852d40a6ede Author: Mark Thomas AuthorDate: Thu Apr 18 21:09:12 2024 +0100 Dispatch after AsyncListener.onError() should actually dispatch The dispatch is now performed rather than completing the request using the error page mechanism. --- .../org/apache/catalina/core/AsyncContextImpl.java | 6 + .../TestAsyncContextImplListenerOnComplete.java| 13 +- .../catalina/core/TestAsyncContextIoError.java | 213 + webapps/docs/changelog.xml | 6 + 4 files changed, 235 insertions(+), 3 deletions(-) diff --git a/java/org/apache/catalina/core/AsyncContextImpl.java b/java/org/apache/catalina/core/AsyncContextImpl.java index 52bddba3b9..908832a5b4 100644 --- a/java/org/apache/catalina/core/AsyncContextImpl.java +++ b/java/org/apache/catalina/core/AsyncContextImpl.java @@ -437,6 +437,12 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback { // complete() or dispatch(). Complete the async processing. complete(); } +} else if (request.isAsyncDispatching()) { +/* + * AsyncListener.onError() called dispatch. Clear the error state on the response else the dispatch will + * trigger error page handling. + */ +request.getResponse().resetError(); } } diff --git a/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java b/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java index 05e68cd0d3..950ace2dc8 100644 --- a/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java +++ b/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java @@ -30,6 +30,7 @@ import java.util.concurrent.TimeUnit; import javax.servlet.AsyncContext; import javax.servlet.AsyncEvent; import javax.servlet.AsyncListener; +import javax.servlet.DispatcherType; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -107,9 +108,15 @@ public class TestAsyncContextImplListenerOnComplete extends TomcatBaseTest { resp.setContentType("text/event-stream"); resp.setCharacterEncoding("UTF-8"); resp.setStatus(200); -AsyncContext context = req.startAsync(); -context.addListener(new ReproAsyncListener()); -eventSource.add(context); +/* + * AsyncListener dispatches back to this servlet in onError(). We do not want to restart async processing in + * this case or we will enter a loop. + */ +if (req.getDispatcherType() == DispatcherType.REQUEST) { +AsyncContext context = req.startAsync(); +context.addListener(new ReproAsyncListener()); +eventSource.add(context); +} } private class ReproAsyncListener implements AsyncListener { diff --git a/test/org/apache/catalina/core/TestAsyncContextIoError.java b/test/org/apache/catalina/core/TestAsyncContextIoError.java new file mode 100644 index 00..a4c73e0982 --- /dev/null +++ b/test/org/apache/catalina/core/TestAsyncContextIoError.java @@ -0,0 +1,213 @@ +/* + * 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.catalina.core; + +import java.io.IOException; +import java.util.concurrent.atomic.AtomicInteger; + +import javax.servlet.AsyncContext; +import javax.servlet.AsyncEvent; +import javax.servlet.AsyncListener; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.junit.Assert; +import org.junit.Test; + +import org.apache.catalina.Cont
(tomcat) branch 10.1.x updated: Dispatch after AsyncListener.onError() should actually dispatch
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 534ade1782 Dispatch after AsyncListener.onError() should actually dispatch 534ade1782 is described below commit 534ade17826d8f3e78118df3751b6391f0ec92ca Author: Mark Thomas AuthorDate: Thu Apr 18 21:09:12 2024 +0100 Dispatch after AsyncListener.onError() should actually dispatch The dispatch is now performed rather than completing the request using the error page mechanism. --- .../org/apache/catalina/core/AsyncContextImpl.java | 6 + .../TestAsyncContextImplListenerOnComplete.java| 13 +- .../catalina/core/TestAsyncContextIoError.java | 213 + webapps/docs/changelog.xml | 6 + 4 files changed, 235 insertions(+), 3 deletions(-) diff --git a/java/org/apache/catalina/core/AsyncContextImpl.java b/java/org/apache/catalina/core/AsyncContextImpl.java index 210d29a356..2cb3958120 100644 --- a/java/org/apache/catalina/core/AsyncContextImpl.java +++ b/java/org/apache/catalina/core/AsyncContextImpl.java @@ -438,6 +438,12 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback { // complete() or dispatch(). Complete the async processing. complete(); } +} else if (request.isAsyncDispatching()) { +/* + * AsyncListener.onError() called dispatch. Clear the error state on the response else the dispatch will + * trigger error page handling. + */ +request.getResponse().resetError(); } } diff --git a/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java b/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java index dfdc33b9d0..a316e95c25 100644 --- a/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java +++ b/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java @@ -29,6 +29,7 @@ import java.util.concurrent.TimeUnit; import jakarta.servlet.AsyncContext; import jakarta.servlet.AsyncEvent; import jakarta.servlet.AsyncListener; +import jakarta.servlet.DispatcherType; import jakarta.servlet.http.HttpServlet; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; @@ -106,9 +107,15 @@ public class TestAsyncContextImplListenerOnComplete extends TomcatBaseTest { resp.setContentType("text/event-stream"); resp.setCharacterEncoding("UTF-8"); resp.setStatus(200); -AsyncContext context = req.startAsync(); -context.addListener(new ReproAsyncListener()); -eventSource.add(context); +/* + * AsyncListener dispatches back to this servlet in onError(). We do not want to restart async processing in + * this case or we will enter a loop. + */ +if (req.getDispatcherType() == DispatcherType.REQUEST) { +AsyncContext context = req.startAsync(); +context.addListener(new ReproAsyncListener()); +eventSource.add(context); +} } private class ReproAsyncListener implements AsyncListener { diff --git a/test/org/apache/catalina/core/TestAsyncContextIoError.java b/test/org/apache/catalina/core/TestAsyncContextIoError.java new file mode 100644 index 00..f8052d60b9 --- /dev/null +++ b/test/org/apache/catalina/core/TestAsyncContextIoError.java @@ -0,0 +1,213 @@ +/* + * 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.catalina.core; + +import java.io.IOException; +import java.util.concurrent.atomic.AtomicInteger; + +import jakarta.servlet.AsyncContext; +import jakarta.servlet.AsyncEvent; +import jakarta.servlet.AsyncListener; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import org.junit.Assert; +import org.junit.Test; + +i
(tomcat) branch main updated: Dispatch after AsyncListener.onError() should actually dispatch
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 c96e797c77 Dispatch after AsyncListener.onError() should actually dispatch c96e797c77 is described below commit c96e797c7735bdc60cbc221b685d03c74eb86fbf Author: Mark Thomas AuthorDate: Thu Apr 18 21:09:12 2024 +0100 Dispatch after AsyncListener.onError() should actually dispatch The dispatch is now performed rather than completing the request using the error page mechanism. --- .../org/apache/catalina/core/AsyncContextImpl.java | 6 + .../TestAsyncContextImplListenerOnComplete.java| 13 +- .../catalina/core/TestAsyncContextIoError.java | 213 + webapps/docs/changelog.xml | 6 + 4 files changed, 235 insertions(+), 3 deletions(-) diff --git a/java/org/apache/catalina/core/AsyncContextImpl.java b/java/org/apache/catalina/core/AsyncContextImpl.java index f2a1a3487e..ac0bece148 100644 --- a/java/org/apache/catalina/core/AsyncContextImpl.java +++ b/java/org/apache/catalina/core/AsyncContextImpl.java @@ -437,6 +437,12 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback { // complete() or dispatch(). Complete the async processing. complete(); } +} else if (request.isAsyncDispatching()) { +/* + * AsyncListener.onError() called dispatch. Clear the error state on the response else the dispatch will + * trigger error page handling. + */ +request.getResponse().resetError(); } } diff --git a/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java b/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java index dfdc33b9d0..a316e95c25 100644 --- a/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java +++ b/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java @@ -29,6 +29,7 @@ import java.util.concurrent.TimeUnit; import jakarta.servlet.AsyncContext; import jakarta.servlet.AsyncEvent; import jakarta.servlet.AsyncListener; +import jakarta.servlet.DispatcherType; import jakarta.servlet.http.HttpServlet; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; @@ -106,9 +107,15 @@ public class TestAsyncContextImplListenerOnComplete extends TomcatBaseTest { resp.setContentType("text/event-stream"); resp.setCharacterEncoding("UTF-8"); resp.setStatus(200); -AsyncContext context = req.startAsync(); -context.addListener(new ReproAsyncListener()); -eventSource.add(context); +/* + * AsyncListener dispatches back to this servlet in onError(). We do not want to restart async processing in + * this case or we will enter a loop. + */ +if (req.getDispatcherType() == DispatcherType.REQUEST) { +AsyncContext context = req.startAsync(); +context.addListener(new ReproAsyncListener()); +eventSource.add(context); +} } private class ReproAsyncListener implements AsyncListener { diff --git a/test/org/apache/catalina/core/TestAsyncContextIoError.java b/test/org/apache/catalina/core/TestAsyncContextIoError.java new file mode 100644 index 00..f8052d60b9 --- /dev/null +++ b/test/org/apache/catalina/core/TestAsyncContextIoError.java @@ -0,0 +1,213 @@ +/* + * 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.catalina.core; + +import java.io.IOException; +import java.util.concurrent.atomic.AtomicInteger; + +import jakarta.servlet.AsyncContext; +import jakarta.servlet.AsyncEvent; +import jakarta.servlet.AsyncListener; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import org.junit.Assert; +import org.junit.Test; + +impor
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/1044 Blamelist: Mark Thomas Build Text: build successful Status Detected: restored build Build Source Stamp: [branch main] 21837baca3c764608173f4a5c69e85307cf92b18 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-11.0.x
Build status: BUILD FAILED: failed compile (failure) Worker used: bb_worker2_ubuntu URL: https://ci2.apache.org/#builders/112/builds/1043 Blamelist: Mark Thomas Build Text: failed compile (failure) Status Detected: new failure Build Source Stamp: [branch main] 9328072d1359a31fc7b74a8eda05392bf697854e 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) branch 9.0.x updated: Add API that allows the error status for the response to be reset
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 2a3d9c5c1b Add API that allows the error status for the response to be reset 2a3d9c5c1b is described below commit 2a3d9c5c1ba7f7733171beb82fda254c4e73769c Author: Mark Thomas AuthorDate: Thu Apr 18 19:45:41 2024 +0100 Add API that allows the error status for the response to be reset This is required to fix an issue with async where a dispatch after an error is still flagged as an error which causes the dispatch to be skipped. --- java/org/apache/catalina/connector/Response.java | 5 + java/org/apache/coyote/Response.java | 7 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/connector/Response.java b/java/org/apache/catalina/connector/Response.java index 06b0e4fad7..d751dc231f 100644 --- a/java/org/apache/catalina/connector/Response.java +++ b/java/org/apache/catalina/connector/Response.java @@ -429,6 +429,11 @@ public class Response implements HttpServletResponse { } +public void resetError() { +getCoyoteResponse().resetError(); +} + + /** * Perform whatever actions are required to flush and close the output stream or writer, in a single operation. * diff --git a/java/org/apache/coyote/Response.java b/java/org/apache/coyote/Response.java index 4af1c8a4c7..6ff483b09e 100644 --- a/java/org/apache/coyote/Response.java +++ b/java/org/apache/coyote/Response.java @@ -332,6 +332,11 @@ public final class Response { } +public void resetError() { +errorState.set(0); +} + + // Methods public void reset() throws IllegalStateException { @@ -624,7 +629,7 @@ public final class Response { committed = false; commitTime = -1; errorException = null; -errorState.set(0); +resetError(); headers.recycle(); trailerFieldsSupplier = null; // Servlet 3.1 non-blocking write listener - 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: Add API that allows the error status for the response to be reset
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 f14a31b109 Add API that allows the error status for the response to be reset f14a31b109 is described below commit f14a31b1092310a2ed74669ee63400fa9efb9ecd Author: Mark Thomas AuthorDate: Thu Apr 18 19:45:41 2024 +0100 Add API that allows the error status for the response to be reset This is required to fix an issue with async where a dispatch after an error is still flagged as an error which causes the dispatch to be skipped. --- java/org/apache/catalina/connector/Response.java | 5 + java/org/apache/coyote/Response.java | 7 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/connector/Response.java b/java/org/apache/catalina/connector/Response.java index f1e496e681..b5906ed7f8 100644 --- a/java/org/apache/catalina/connector/Response.java +++ b/java/org/apache/catalina/connector/Response.java @@ -406,6 +406,11 @@ public class Response implements HttpServletResponse { } +public void resetError() { +getCoyoteResponse().resetError(); +} + + /** * Perform whatever actions are required to flush and close the output stream or writer, in a single operation. * diff --git a/java/org/apache/coyote/Response.java b/java/org/apache/coyote/Response.java index b1d88ee267..bc29233776 100644 --- a/java/org/apache/coyote/Response.java +++ b/java/org/apache/coyote/Response.java @@ -342,6 +342,11 @@ public final class Response { } +public void resetError() { +errorState.set(0); +} + + // Methods public void reset() throws IllegalStateException { @@ -634,7 +639,7 @@ public final class Response { committed = false; commitTimeNanos = -1; errorException = null; -errorState.set(0); +resetError(); headers.recycle(); trailerFieldsSupplier = null; // Servlet 3.1 non-blocking write listener - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch main updated: Add API that allows the error status for the response to be reset
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 21837baca3 Add API that allows the error status for the response to be reset 21837baca3 is described below commit 21837baca3c764608173f4a5c69e85307cf92b18 Author: Mark Thomas AuthorDate: Thu Apr 18 19:45:41 2024 +0100 Add API that allows the error status for the response to be reset This is required to fix an issue with async where a dispatch after an error is still flagged as an error which causes the dispatch to be skipped. --- java/org/apache/catalina/connector/Response.java | 5 + java/org/apache/coyote/Response.java | 7 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/connector/Response.java b/java/org/apache/catalina/connector/Response.java index 0effa36218..a0d7c8d932 100644 --- a/java/org/apache/catalina/connector/Response.java +++ b/java/org/apache/catalina/connector/Response.java @@ -373,6 +373,11 @@ public class Response implements HttpServletResponse { } +public void resetError() { +getCoyoteResponse().resetError(); +} + + /** * Perform whatever actions are required to flush and close the output stream or writer, in a single operation. * diff --git a/java/org/apache/coyote/Response.java b/java/org/apache/coyote/Response.java index 8bc89249b7..ae157bfd6b 100644 --- a/java/org/apache/coyote/Response.java +++ b/java/org/apache/coyote/Response.java @@ -333,6 +333,11 @@ public final class Response { } +public void resetError() { +errorState.set(0); +} + + // Methods public void reset() throws IllegalStateException { @@ -656,7 +661,7 @@ public final class Response { committed = false; commitTimeNanos = -1; errorException = null; -errorState.set(0); +resetError(); headers.recycle(); trailerFieldsSupplier = null; // Servlet 3.1 non-blocking write listener - 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: Remove commented out code.
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 01533cff0e Remove commented out code. 01533cff0e is described below commit 01533cff0e01f45a42b74790eab28ef333f73fee Author: Mark Thomas AuthorDate: Thu Apr 18 19:39:54 2024 +0100 Remove commented out code. --- test/javax/servlet/http/TestHttpServletResponseSendError.java | 9 - 1 file changed, 9 deletions(-) diff --git a/test/javax/servlet/http/TestHttpServletResponseSendError.java b/test/javax/servlet/http/TestHttpServletResponseSendError.java index bdd7ca4879..8d99321a70 100644 --- a/test/javax/servlet/http/TestHttpServletResponseSendError.java +++ b/test/javax/servlet/http/TestHttpServletResponseSendError.java @@ -283,15 +283,6 @@ public class TestHttpServletResponseSendError extends TomcatBaseTest { e.printStackTrace(); } -/* -if (errorPoint == AsyncErrorPoint.THREAD_B_AFTER_COMPLETE) { -if (useDispatch) { -ac.complete(); -} else { -ac.dispatch("/dispatch"); -} -} - */ if (throwException) { throw new SendErrorException(); } else { - 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: Remove commented out code.
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 7435b0dd1d Remove commented out code. 7435b0dd1d is described below commit 7435b0dd1d39787ed754647943f4a2dcb70e15fc Author: Mark Thomas AuthorDate: Thu Apr 18 19:39:54 2024 +0100 Remove commented out code. --- test/jakarta/servlet/http/TestHttpServletResponseSendError.java | 9 - 1 file changed, 9 deletions(-) diff --git a/test/jakarta/servlet/http/TestHttpServletResponseSendError.java b/test/jakarta/servlet/http/TestHttpServletResponseSendError.java index 1b777d108f..94cd9dd0c1 100644 --- a/test/jakarta/servlet/http/TestHttpServletResponseSendError.java +++ b/test/jakarta/servlet/http/TestHttpServletResponseSendError.java @@ -283,15 +283,6 @@ public class TestHttpServletResponseSendError extends TomcatBaseTest { e.printStackTrace(); } -/* -if (errorPoint == AsyncErrorPoint.THREAD_B_AFTER_COMPLETE) { -if (useDispatch) { -ac.complete(); -} else { -ac.dispatch("/dispatch"); -} -} - */ if (throwException) { throw new SendErrorException(); } else { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch main updated: Remove commented out code.
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 9328072d13 Remove commented out code. 9328072d13 is described below commit 9328072d1359a31fc7b74a8eda05392bf697854e Author: Mark Thomas AuthorDate: Thu Apr 18 19:39:54 2024 +0100 Remove commented out code. --- test/jakarta/servlet/http/TestHttpServletResponseSendError.java | 9 - 1 file changed, 9 deletions(-) diff --git a/test/jakarta/servlet/http/TestHttpServletResponseSendError.java b/test/jakarta/servlet/http/TestHttpServletResponseSendError.java index 1b777d108f..94cd9dd0c1 100644 --- a/test/jakarta/servlet/http/TestHttpServletResponseSendError.java +++ b/test/jakarta/servlet/http/TestHttpServletResponseSendError.java @@ -283,15 +283,6 @@ public class TestHttpServletResponseSendError extends TomcatBaseTest { e.printStackTrace(); } -/* -if (errorPoint == AsyncErrorPoint.THREAD_B_AFTER_COMPLETE) { -if (useDispatch) { -ac.complete(); -} else { -ac.dispatch("/dispatch"); -} -} - */ if (throwException) { throw new SendErrorException(); } else { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 68910] Improve LibreSSL version check in tcnative.m4
https://bz.apache.org/bugzilla/show_bug.cgi?id=68910 --- Comment #5 from Michael Osipov --- Created attachment 39673 --> https://bz.apache.org/bugzilla/attachment.cgi?id=39673&action=edit Failed tests (In reply to Christopher Schultz from comment #4) > Thanks for doing this work; it IS promising. > > Can you share the details of the failures? Find failed tests attached. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: [PR] Re-adding support for fractional seconds in access log [tomcat]
jose-galvez commented on PR #720: URL: https://github.com/apache/tomcat/pull/720#issuecomment-2064310044 > Are you specifically talking about the ExtendedAccessLogValve's `time-taken` token? If so, you're right, that documentation did not change yet the underlying implementation did change. Yes, sorry I didn't state this better 😞 but the change I made was specifically for the `time-taken` token to go back to the Tomcat 9 behavior and report the seconds with fractions as the documentation states > IMHO, "fractional seconds" isn't worth the computation power to format it in the first place, then parse it later back into milliseconds or whatever. I would recommend changing your tooling to look for an embedded `.` character and changing behavior to be backward- and forward-compatible by simply using milliseconds or microseconds, whichever you prefer. I'll talk to our team to see if they can make these changes. For now we created a patch for our application with this PR's change so we load the modified `ExtendedAccessLogValve` class in our application for Tomcat 10. Of course this is meant to be temporary since it could become a bit of a nightmare to maintain long term > We should update the documentation for `ExtendedAccessLogValve` to make it clear that `time-taken` has changed along with `%T` to be whole-seconds. This would be great, that way we can also send a notice to our customers pointing to it so they can update any tooling they have that relies on the current format > We can continue this conversation to determine what _else_ we might do, such as continuing to support "fractional seconds" as an output format. The problem (for you) with supporting fractional-seconds is that it won't work from 10.1.0 - 10.1.23 at least, so you will have a specific set of Tomcat versions that are supported by your product and tooling. We are fine right now because our current production versions are running Tomcat 9.x and we have the patch for 10.1.x ready for when it goes to production so if there's a new output in the near future to have the fractional seconds we could just move to that and remove our internal patch 🙂 but like I said I'll bring it up with the team to see if we can start moving to using milliseconds instead since it probably would also make calculations faster on our scripts and monitoring systems. Thank you so much for your comments and your insight on this issue 😃 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: (tomcat) branch main updated: Don't create a StringBuilder object until we know we have at least one Cookie value to log.
On 18/04/2024 14:31, schu...@apache.org wrote: This is an automated email from the ASF dual-hosted git repository. schultz 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 23facd507d Don't create a StringBuilder object until we know we have at least one Cookie value to log. 23facd507d is described below commit 23facd507db72d583ed89a13f20ab1cb766f0221 Author: Christopher Schultz AuthorDate: Thu Apr 18 09:30:50 2024 -0400 Don't create a StringBuilder object until we know we have at least one Cookie value to log. -1. veto. Please fix/revert ASAP. Note: This veto applies to this commit and the back-ports. This creates multiple paths where a NPE is possible. This does not work if there are multiple cookies with the same name that need to be logged. Mark --- java/org/apache/catalina/valves/AbstractAccessLogValve.java | 3 ++- webapps/docs/changelog.xml | 4 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java b/java/org/apache/catalina/valves/AbstractAccessLogValve.java index 5502d1c183..e13bb9e5ac 100644 --- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java +++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java @@ -1479,7 +1479,7 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access @Override public void addElement(CharArrayWriter buf, Date date, Request request, Response response, long time) { -StringBuilder value = new StringBuilder(); +StringBuilder value = null; boolean first = true; Cookie[] cookies = request.getCookies(); if (cookies != null) { @@ -1490,6 +1490,7 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access } else { value.append(','); } +value = new StringBuilder(); value.append(cookie.getValue()); } } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 8ef77e52aa..f6c6c62962 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -123,6 +123,10 @@ including the removal of the trimCredentials setting which is now hard-coded to false. (markt) + +Small performance optimization when logging cookies with no values. +(schultz) + - 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 10.1.x updated: Now that we have two native OpenSSL implementation, use a somewhat less misleading variable name in unit tests.
This is an automated email from the ASF dual-hosted git repository. rjung 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 c6a5b445b0 Now that we have two native OpenSSL implementation, use a somewhat less misleading variable name in unit tests. c6a5b445b0 is described below commit c6a5b445b038fcc1975e3491f11817962ab5cb49 Author: Rainer Jung AuthorDate: Thu Apr 18 16:40:41 2024 +0200 Now that we have two native OpenSSL implementation, use a somewhat less misleading variable name in unit tests. --- test/org/apache/catalina/valves/rewrite/TestResolverSSL.java | 4 ++-- test/org/apache/coyote/http2/TestLargeUpload.java | 4 ++-- test/org/apache/tomcat/util/net/TestClientCert.java| 4 ++-- test/org/apache/tomcat/util/net/TestClientCertTls13.java | 6 +++--- test/org/apache/tomcat/util/net/TestCustomSslTrustManager.java | 4 ++-- test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java | 4 ++-- .../apache/tomcat/util/net/TestSSLHostConfigIntegration.java | 4 ++-- test/org/apache/tomcat/util/net/TestSsl.java | 10 +- test/org/apache/tomcat/util/net/TesterSupport.java | 4 ++-- .../apache/tomcat/websocket/TestWebSocketFrameClientSSL.java | 4 ++-- .../apache/tomcat/websocket/TestWsWebSocketContainerSSL.java | 4 ++-- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java index 6b7de8ef2c..2bebd2cbf5 100644 --- a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java +++ b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java @@ -60,7 +60,7 @@ public class TestResolverSSL extends TomcatBaseTest { public String connectorName; @Parameter(1) -public boolean needApr; +public boolean useOpenSSL; @Parameter(2) public String sslImplementationName; @@ -172,7 +172,7 @@ public class TestResolverSSL extends TomcatBaseTest { Assert.assertTrue(tomcat.getConnector().setProperty("sslImplementationName", sslImplementationName)); -if (needApr) { +if (useOpenSSL) { AprLifecycleListener listener = new AprLifecycleListener(); Assume.assumeTrue(AprLifecycleListener.isAprAvailable()); StandardServer server = (StandardServer) tomcat.getServer(); diff --git a/test/org/apache/coyote/http2/TestLargeUpload.java b/test/org/apache/coyote/http2/TestLargeUpload.java index 5904eba8fe..33da9b5879 100644 --- a/test/org/apache/coyote/http2/TestLargeUpload.java +++ b/test/org/apache/coyote/http2/TestLargeUpload.java @@ -66,7 +66,7 @@ public class TestLargeUpload extends Http2TestBase { public String connectorName; @Parameter(3) -public boolean needApr; +public boolean useOpenSSL; @Parameter(4) public String sslImplementationName; @@ -159,6 +159,6 @@ public class TestLargeUpload extends Http2TestBase { Tomcat tomcat = getTomcatInstance(); -TesterSupport.configureSSLImplementation(tomcat, sslImplementationName, needApr); +TesterSupport.configureSSLImplementation(tomcat, sslImplementationName, useOpenSSL); } } diff --git a/test/org/apache/tomcat/util/net/TestClientCert.java b/test/org/apache/tomcat/util/net/TestClientCert.java index 7ebfb4c308..eeabba688c 100644 --- a/test/org/apache/tomcat/util/net/TestClientCert.java +++ b/test/org/apache/tomcat/util/net/TestClientCert.java @@ -57,7 +57,7 @@ public class TestClientCert extends TomcatBaseTest { public String connectorName; @Parameter(1) -public boolean needApr; +public boolean useOpenSSL; @Parameter(2) public String sslImplementationName; @@ -216,6 +216,6 @@ public class TestClientCert extends TomcatBaseTest { TesterSupport.configureClientSsl(); -TesterSupport.configureSSLImplementation(tomcat, sslImplementationName, needApr); +TesterSupport.configureSSLImplementation(tomcat, sslImplementationName, useOpenSSL); } } diff --git a/test/org/apache/tomcat/util/net/TestClientCertTls13.java b/test/org/apache/tomcat/util/net/TestClientCertTls13.java index 742668f062..786d42283f 100644 --- a/test/org/apache/tomcat/util/net/TestClientCertTls13.java +++ b/test/org/apache/tomcat/util/net/TestClientCertTls13.java @@ -64,7 +64,7 @@ public class TestClientCertTls13 extends TomcatBaseTest { public String connectorName; @Parameter(1) -public boolean needApr; +public boolean useOpenSSL; @Parameter(2) public String sslImplementationName; @@ -107,9 +107,9 @@ public class TestClientCertTls13 extends TomcatBaseTest { TesterSupport.configureClientSsl(); Connector connector = tomcat.getConnector(); -TesterSupport.configureSSLImplementation(tomcat, sslIm
(tomcat) branch main updated: Now that we have two native OpenSSL implementation, use a somewhat less misleading variable name in unit tests.
This is an automated email from the ASF dual-hosted git repository. rjung 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 8eea901875 Now that we have two native OpenSSL implementation, use a somewhat less misleading variable name in unit tests. new 60c4a31345 Merge branch 'main' of https://github.com/apache/tomcat 8eea901875 is described below commit 8eea9018754804d5e3fb6d258df1ce08e13bae99 Author: Rainer Jung AuthorDate: Thu Apr 18 16:40:41 2024 +0200 Now that we have two native OpenSSL implementation, use a somewhat less misleading variable name in unit tests. --- test/org/apache/catalina/valves/rewrite/TestResolverSSL.java | 4 ++-- test/org/apache/coyote/http2/TestLargeUpload.java | 4 ++-- test/org/apache/tomcat/util/net/TestClientCert.java| 4 ++-- test/org/apache/tomcat/util/net/TestClientCertTls13.java | 6 +++--- test/org/apache/tomcat/util/net/TestCustomSslTrustManager.java | 4 ++-- test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java | 4 ++-- .../apache/tomcat/util/net/TestSSLHostConfigIntegration.java | 4 ++-- test/org/apache/tomcat/util/net/TestSsl.java | 10 +- test/org/apache/tomcat/util/net/TesterSupport.java | 4 ++-- .../apache/tomcat/websocket/TestWebSocketFrameClientSSL.java | 4 ++-- .../apache/tomcat/websocket/TestWsWebSocketContainerSSL.java | 4 ++-- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java index 6b7de8ef2c..2bebd2cbf5 100644 --- a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java +++ b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java @@ -60,7 +60,7 @@ public class TestResolverSSL extends TomcatBaseTest { public String connectorName; @Parameter(1) -public boolean needApr; +public boolean useOpenSSL; @Parameter(2) public String sslImplementationName; @@ -172,7 +172,7 @@ public class TestResolverSSL extends TomcatBaseTest { Assert.assertTrue(tomcat.getConnector().setProperty("sslImplementationName", sslImplementationName)); -if (needApr) { +if (useOpenSSL) { AprLifecycleListener listener = new AprLifecycleListener(); Assume.assumeTrue(AprLifecycleListener.isAprAvailable()); StandardServer server = (StandardServer) tomcat.getServer(); diff --git a/test/org/apache/coyote/http2/TestLargeUpload.java b/test/org/apache/coyote/http2/TestLargeUpload.java index 5904eba8fe..33da9b5879 100644 --- a/test/org/apache/coyote/http2/TestLargeUpload.java +++ b/test/org/apache/coyote/http2/TestLargeUpload.java @@ -66,7 +66,7 @@ public class TestLargeUpload extends Http2TestBase { public String connectorName; @Parameter(3) -public boolean needApr; +public boolean useOpenSSL; @Parameter(4) public String sslImplementationName; @@ -159,6 +159,6 @@ public class TestLargeUpload extends Http2TestBase { Tomcat tomcat = getTomcatInstance(); -TesterSupport.configureSSLImplementation(tomcat, sslImplementationName, needApr); +TesterSupport.configureSSLImplementation(tomcat, sslImplementationName, useOpenSSL); } } diff --git a/test/org/apache/tomcat/util/net/TestClientCert.java b/test/org/apache/tomcat/util/net/TestClientCert.java index 7ebfb4c308..eeabba688c 100644 --- a/test/org/apache/tomcat/util/net/TestClientCert.java +++ b/test/org/apache/tomcat/util/net/TestClientCert.java @@ -57,7 +57,7 @@ public class TestClientCert extends TomcatBaseTest { public String connectorName; @Parameter(1) -public boolean needApr; +public boolean useOpenSSL; @Parameter(2) public String sslImplementationName; @@ -216,6 +216,6 @@ public class TestClientCert extends TomcatBaseTest { TesterSupport.configureClientSsl(); -TesterSupport.configureSSLImplementation(tomcat, sslImplementationName, needApr); +TesterSupport.configureSSLImplementation(tomcat, sslImplementationName, useOpenSSL); } } diff --git a/test/org/apache/tomcat/util/net/TestClientCertTls13.java b/test/org/apache/tomcat/util/net/TestClientCertTls13.java index 742668f062..786d42283f 100644 --- a/test/org/apache/tomcat/util/net/TestClientCertTls13.java +++ b/test/org/apache/tomcat/util/net/TestClientCertTls13.java @@ -64,7 +64,7 @@ public class TestClientCertTls13 extends TomcatBaseTest { public String connectorName; @Parameter(1) -public boolean needApr; +public boolean useOpenSSL; @Parameter(2) public String sslImplementationName; @@ -107,9 +107,9 @@ public class TestClientCertTls13 extends TomcatBaseTest { TesterSupport.configureClientSsl(); Connector connector = tomcat.getConne
Re: Panama modules: inconsistency between 9.0.x, 10.1.x and main?
On Thu, Apr 18, 2024 at 1:52 PM Rainer Jung wrote: > > Hi all, > > I noticed, that in main and 9.0.x we have a panama module, but not in > 10.1.x. > > More precisely I see: > > main and 10.1.x do have java/org/apache/tomcat/util/net/openssl/panama. > That is probably due to the existence of Java 22 for a release build. Fine. > > main and 9.0.x do have a main/modules/openssl-foreign. > > Only main does have main/modules/openssl-java17 and > main/modules/openssl-java21 These modules in main are for history purposes, maybe they can be moved to an archive somewhere. Only the 9.0 module is useful since FFM can never be backported to that branch (the next Java LTS will most likely not allow a release target to Java 1.8). Rémy > 10.1.x does not have any of these modules. > > Is this already how it should look like? > > Thanks and regards, > > Rainer > > - > 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 9.0.x updated: Don't create a StringBuilder object until we know we have at least one Cookie value to log.
This is an automated email from the ASF dual-hosted git repository. schultz 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 4f109c8699 Don't create a StringBuilder object until we know we have at least one Cookie value to log. 4f109c8699 is described below commit 4f109c86994df4aa54ba31df424c4202a62ed367 Author: Christopher Schultz AuthorDate: Thu Apr 18 09:30:50 2024 -0400 Don't create a StringBuilder object until we know we have at least one Cookie value to log. --- java/org/apache/catalina/valves/AbstractAccessLogValve.java | 3 ++- webapps/docs/changelog.xml | 4 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java b/java/org/apache/catalina/valves/AbstractAccessLogValve.java index 0287eab383..7a9c83d849 100644 --- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java +++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java @@ -1483,7 +1483,7 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access @Override public void addElement(CharArrayWriter buf, Date date, Request request, Response response, long time) { -StringBuilder value = new StringBuilder(); +StringBuilder value = null; boolean first = true; Cookie[] cookies = request.getCookies(); if (cookies != null) { @@ -1494,6 +1494,7 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access } else { value.append(','); } +value = new StringBuilder(); value.append(cookie.getValue()); } } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index de4e1b77a2..325138 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -125,6 +125,10 @@ trimCredentials setting will be removed in Tomcat 11. (markt) + +Small performance optimization when logging cookies with no values. +(schultz) + - 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: Don't create a StringBuilder object until we know we have at least one Cookie value to log.
This is an automated email from the ASF dual-hosted git repository. schultz 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 e2de58c702 Don't create a StringBuilder object until we know we have at least one Cookie value to log. e2de58c702 is described below commit e2de58c70266bb99557f318e86bf846b01cc13e9 Author: Christopher Schultz AuthorDate: Thu Apr 18 09:30:50 2024 -0400 Don't create a StringBuilder object until we know we have at least one Cookie value to log. --- java/org/apache/catalina/valves/AbstractAccessLogValve.java | 3 ++- webapps/docs/changelog.xml | 4 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java b/java/org/apache/catalina/valves/AbstractAccessLogValve.java index b1d77e974b..df942110ab 100644 --- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java +++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java @@ -1481,7 +1481,7 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access @Override public void addElement(CharArrayWriter buf, Date date, Request request, Response response, long time) { -StringBuilder value = new StringBuilder(); +StringBuilder value = null; boolean first = true; Cookie[] cookies = request.getCookies(); if (cookies != null) { @@ -1492,6 +1492,7 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access } else { value.append(','); } +value = new StringBuilder(); value.append(cookie.getValue()); } } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index ff466e8bdd..ffd50ade32 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -125,6 +125,10 @@ trimCredentials setting will be removed in Tomcat 11. (markt) + +Small performance optimization when logging cookies with no values. +(schultz) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch main updated: Don't create a StringBuilder object until we know we have at least one Cookie value to log.
This is an automated email from the ASF dual-hosted git repository. schultz 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 23facd507d Don't create a StringBuilder object until we know we have at least one Cookie value to log. 23facd507d is described below commit 23facd507db72d583ed89a13f20ab1cb766f0221 Author: Christopher Schultz AuthorDate: Thu Apr 18 09:30:50 2024 -0400 Don't create a StringBuilder object until we know we have at least one Cookie value to log. --- java/org/apache/catalina/valves/AbstractAccessLogValve.java | 3 ++- webapps/docs/changelog.xml | 4 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java b/java/org/apache/catalina/valves/AbstractAccessLogValve.java index 5502d1c183..e13bb9e5ac 100644 --- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java +++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java @@ -1479,7 +1479,7 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access @Override public void addElement(CharArrayWriter buf, Date date, Request request, Response response, long time) { -StringBuilder value = new StringBuilder(); +StringBuilder value = null; boolean first = true; Cookie[] cookies = request.getCookies(); if (cookies != null) { @@ -1490,6 +1490,7 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access } else { value.append(','); } +value = new StringBuilder(); value.append(cookie.getValue()); } } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 8ef77e52aa..f6c6c62962 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -123,6 +123,10 @@ including the removal of the trimCredentials setting which is now hard-coded to false. (markt) + +Small performance optimization when logging cookies with no values. +(schultz) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: [PR] Re-adding support for fractional seconds in access log [tomcat]
ChristopherSchultz commented on PR #720: URL: https://github.com/apache/tomcat/pull/720#issuecomment-2063868914 Oh, I'm' sorry I didn't pick-up on the subtleties of your report. Tomcat 10.1 is documented that the value for `%T` is in (presumably _whole_) seconds. Tomcat 9 says it's in fractional seconds and that in Tomcat 10 it will be truncated to whole-seconds. Are you specifically talking about the ExtendedAccessLogValve's `time-taken` token? If so, you're right, that documentation did not change yet the underlying implementation did change. I can see some scope for still supporting all of these. For example, `%T` can be `%{us}T` to get microseconds (now a synonym for `%D` so why not introduce a new flavor e.g. `%{fs}T` for "fractional seconds". IMHO, "fractional seconds" isn't worth the computation power to format it in the first place, then parse it later back into milliseconds or whatever. I would recommend changing your tooling to look for an embedded `.` character and changing behavior to be backward- and forward-compatible by simply using milliseconds or microseconds, whichever you prefer. We should update the documentation for `ExtendedAccessLogValve` to make it clear that `time-taken` has changed along with `%T` to be whole-seconds. We can continue this conversation to determine what _else_ we might do, such as continuing to support "fractional seconds" as an output format. The problem (for you) with supporting fractional-seconds is that it won't work from 10.1.0 - 10.1.23 at least, so you will have a specific set of Tomcat versions that are supported by your product and tooling. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 68909] JSP compilation error due to classpath problems
https://bz.apache.org/bugzilla/show_bug.cgi?id=68909 --- Comment #7 from Chris --- Hi, we have a central utility method to create our own instances of "com.ctc.wstx.stax.WstxInputFactory" that is not the issue. But we use libraries, that in the depth just call "XMLInputFactory.newFactory()". They kept having problems in the context of sub ClassLoaders, not considering the service definition within the woodstox*.jar (/META-INF/services/javax.xml.stream.XMLInputFactory) and than failing with some missing features of the JDKs default implementation. And no, we do not require Tomcat to work with com.ctc.wstx.stax.WstxInputFactory. This was just a side effect that did not matter until now. Tomcat works with WstxInputFactory and with the sun default implementation. Chris -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 68909] JSP compilation error due to classpath problems
https://bz.apache.org/bugzilla/show_bug.cgi?id=68909 --- Comment #6 from Christopher Schultz --- Is it possible for you to use your custom XMLInputFactory directly instead of calling getInstance(), or do you need Tomcat's JSP compiler to use your custom XMLInputFactory? -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 68910] Improve LibreSSL version check in tcnative.m4
https://bz.apache.org/bugzilla/show_bug.cgi?id=68910 --- Comment #4 from Christopher Schultz --- Thanks for doing this work; it IS promising. Can you share the details of the failures? -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: [PR] Re-adding support for fractional seconds in access log [tomcat]
jose-galvez commented on PR #720: URL: https://github.com/apache/tomcat/pull/720#issuecomment-2063746801 It can, but in this case the documentation states that it didn't so I was trying to bring it back to how it behaved before (which as an added bonus helps us not change our scripts). If the answer is that this is the correct behavior and the documentation is the one that should change it's fine, we'll figure out a way to adapt or patch it on our end. I just figured it was worth sharing since maybe this specific change was not intended -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Some remarks on panama libssl loading
Michael, On 4/17/24 16:46, Michael Osipov wrote: On 2024/04/17 14:21:06 Rainer Jung wrote: Am 17.04.24 um 15:34 schrieb Michael Osipov: Rainer, I do not fully understand the problem here. We use libtool to solve exactly this problem with versioned SONAMEs. It will create symlinks to the SONAME. Do you expect anyone even with dlopen() to load libfoo.o.{SOVERSION} unless it is strictly needed? E.g.: lrwxr-xr-x 1 root wheel26 2024-03-22 10:20 /usr/lib/libcrypto.so@ -> ../../lib/libcrypto.so.111 lrwxr-xr-x 1 root wheel 13 2024-03-22 10:20 /usr/lib/libssl.so@ -> libssl.so.111 -r--r--r-- 1 root wheel 608008 2024-03-22 10:20 /usr/lib/libssl.so.111 and so on... Yes, I expect that! anyone is the JVM :( The problem is, that the Java API does not care about these well thought native traditions. You can not open libssl.so.3 using System.loadlibrary(String name), because whatever you give it as "name" parameter it will always try to open libname.so. It always prepends "lib" to name and always suffixes it with plain ".so". Yes, it might exist as the first in your list of symlinks, but on most linux distributions this link is not installed by default, because it is only needed when doing compilations. So it is only installed when you install development packages for libs. Ah, now I see your problem, but it looks like a downstream problem of your distro of choice, no? I wonder how you compile then custom software if .so isn't present and the linker cannot find it with -L? What if you install the devel package to have .so link? That works, but doesn't seem to be a reasonable requirement if you just want to install Ubuntu and Tomcat and run a server. -chris - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: [PR] Re-adding support for fractional seconds in access log [tomcat]
ChristopherSchultz commented on PR #720: URL: https://github.com/apache/tomcat/pull/720#issuecomment-2063733345 So nothing can ever change, then? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 68911] Newly introduced ConfigurationSource doesn't respect environment variables
https://bz.apache.org/bugzilla/show_bug.cgi?id=68911 Christopher Schultz changed: What|Removed |Added Resolution|--- |INVALID Status|NEW |RESOLVED --- Comment #5 from Christopher Schultz --- (In reply to 7element from comment #4) > "The only time "user.dir" is used is if the code initializing Tomcat doesn't > give it any specific information about where to load the configuration files > from." > How do you give specific information about where to load the configuration > files from initially? The only place ConfigurationSource.DEFAULT is used is in (static) ConfigFileLoader.getSource. If you want to override the default, then call (static) ConfigFileLoader.setSource with whatever you want. See o.a.catalina.Catalina.parseServerXml for an example of how to set it to something like what you are expecting. > I didn't find a way to do that on initial start except having 2 server.xml > files, one in user.dir and one in my separate location for configuration, > because CATALINA_BASE environment variable is not respected as in tomcat 8 If you are using Tomcat embedded, then you need to tell Tomcat where to find your configuration files. -- You are receiving this mail because: You are the assignee for the bug. - 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: Improve websocket junit test timing behavior.
This is an automated email from the ASF dual-hosted git repository. rjung 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 e778178657 Improve websocket junit test timing behavior. e778178657 is described below commit e778178657c763df02f9f2475a53bdbd1df7d47c Author: Rainer Jung AuthorDate: Thu Apr 18 13:28:21 2024 +0200 Improve websocket junit test timing behavior. Since 11.0.0-M17 soome tests hit the default session close timeout of 30 seconds at the end of test. Set a session close timeout of 2 seconds for these tests instead. --- test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java | 6 ++ .../tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java | 3 +++ test/org/apache/tomcat/websocket/server/TestSlowClient.java | 3 +++ .../websocket/server/TestWsRemoteEndpointImplServerDeadlock.java| 3 +++ 4 files changed, 15 insertions(+) diff --git a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java index a720dcd6ca..d8d5d672cb 100644 --- a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java +++ b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java @@ -58,6 +58,9 @@ public class TestWebSocketFrameClientSSL extends WebSocketBaseTest { clientEndpointConfig.getUserProperties().put(Constants.SSL_TRUSTSTORE_PROPERTY, TesterSupport.CA_JKS); Session wsSession = wsContainer.connectToServer(TesterProgrammaticEndpoint.class, clientEndpointConfig, new URI("wss://localhost:" + getPort() + TesterFirehoseServer.PATH)); +// Set a short session close timeout (milliseconds) +wsSession.getUserProperties().put( + org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, Long.valueOf(2000)); CountDownLatch latch = new CountDownLatch(TesterFirehoseServer.MESSAGE_COUNT); BasicText handler = new BasicText(latch); wsSession.addMessageHandler(handler); @@ -130,6 +133,9 @@ public class TestWebSocketFrameClientSSL extends WebSocketBaseTest { Assert.fail("There are [" + openConnectionCount + "] connections still open"); } +// Set a short session close timeout (milliseconds) +wsSession.getUserProperties().put( + org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, Long.valueOf(2000)); // Close the client session. wsSession.close(); } diff --git a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java index ba41b82383..8d414fe33d 100644 --- a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java +++ b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java @@ -100,6 +100,9 @@ public class TestWsWebSocketContainerTimeoutServer extends WsWebSocketContainerB loops++; } +// Set a short session close timeout (milliseconds) +wsSession.getUserProperties().put( + org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, Long.valueOf(2000)); // Close the client session, primarily to allow the // BackgroundProcessManager to shut down. wsSession.close(); diff --git a/test/org/apache/tomcat/websocket/server/TestSlowClient.java b/test/org/apache/tomcat/websocket/server/TestSlowClient.java index 3a2afad1df..5460d4fc78 100644 --- a/test/org/apache/tomcat/websocket/server/TestSlowClient.java +++ b/test/org/apache/tomcat/websocket/server/TestSlowClient.java @@ -70,6 +70,9 @@ public class TestSlowClient extends WebSocketBaseTest { count++; } Assert.assertTrue(wsSession.isOpen()); +// Set a short session close timeout (milliseconds) +wsSession.getUserProperties().put( + org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, Long.valueOf(2000)); wsSession.close(); // BZ 64848 (non-container thread variant) diff --git a/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java b/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java index 7af3bcc12a..1f35ec0be3 100644 --- a/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java +++ b/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java @@ -124,6 +124,9 @@ public class TestWsRemoteEndpointImplServerDeadlock extends WebSocketBaseTest { // Server buffers are full. Server cannot send any more messages. // Server is now blocked waiting for the client to read the messages. +// Set a short session close timeout (milliseconds) +session
(tomcat) branch 10.1.x updated: Improve websocket junit test timing behavior.
This is an automated email from the ASF dual-hosted git repository. rjung 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 8ec7ce32e4 Improve websocket junit test timing behavior. 8ec7ce32e4 is described below commit 8ec7ce32e4b51b2c52012bb2e26baec3b842ee59 Author: Rainer Jung AuthorDate: Thu Apr 18 13:28:21 2024 +0200 Improve websocket junit test timing behavior. Since 11.0.0-M17 soome tests hit the default session close timeout of 30 seconds at the end of test. Set a session close timeout of 2 seconds for these tests instead. --- test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java | 6 ++ .../tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java | 3 +++ test/org/apache/tomcat/websocket/server/TestSlowClient.java | 3 +++ .../websocket/server/TestWsRemoteEndpointImplServerDeadlock.java| 3 +++ 4 files changed, 15 insertions(+) diff --git a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java index 0853d1397c..0447e3a549 100644 --- a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java +++ b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java @@ -142,6 +142,9 @@ public class TestWebSocketFrameClientSSL extends WebSocketBaseTest { Session wsSession = wsContainer.connectToServer(TesterProgrammaticEndpoint.class, clientEndpointConfig, new URI("wss://localhost:" + getPort() + TesterFirehoseServer.PATH)); +// Set a short session close timeout (milliseconds) +wsSession.getUserProperties().put( + org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, Long.valueOf(2000)); CountDownLatch latch = new CountDownLatch(TesterFirehoseServer.MESSAGE_COUNT); BasicText handler = new BasicText(latch); wsSession.addMessageHandler(handler); @@ -282,6 +285,9 @@ public class TestWebSocketFrameClientSSL extends WebSocketBaseTest { Assert.fail("There are [" + openConnectionCount + "] connections still open"); } +// Set a short session close timeout (milliseconds) +wsSession.getUserProperties().put( + org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, Long.valueOf(2000)); // Close the client session. wsSession.close(); } diff --git a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java index b3b31b699c..613fadde8c 100644 --- a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java +++ b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java @@ -100,6 +100,9 @@ public class TestWsWebSocketContainerTimeoutServer extends WsWebSocketContainerB loops++; } +// Set a short session close timeout (milliseconds) +wsSession.getUserProperties().put( + org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, Long.valueOf(2000)); // Close the client session, primarily to allow the // BackgroundProcessManager to shut down. wsSession.close(); diff --git a/test/org/apache/tomcat/websocket/server/TestSlowClient.java b/test/org/apache/tomcat/websocket/server/TestSlowClient.java index 411c395045..a9203609f5 100644 --- a/test/org/apache/tomcat/websocket/server/TestSlowClient.java +++ b/test/org/apache/tomcat/websocket/server/TestSlowClient.java @@ -70,6 +70,9 @@ public class TestSlowClient extends WebSocketBaseTest { count++; } Assert.assertTrue(wsSession.isOpen()); +// Set a short session close timeout (milliseconds) +wsSession.getUserProperties().put( + org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, Long.valueOf(2000)); wsSession.close(); // BZ 64848 (non-container thread variant) diff --git a/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java b/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java index 7959daa38c..86adf1ac1d 100644 --- a/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java +++ b/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java @@ -124,6 +124,9 @@ public class TestWsRemoteEndpointImplServerDeadlock extends WebSocketBaseTest { // Server buffers are full. Server cannot send any more messages. // Server is now blocked waiting for the client to read the messages. +// Set a short session close timeout (milliseconds) +session.getUserProperties().put( + org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY
(tomcat) branch main updated: Improve websocket junit test timing behavior.
This is an automated email from the ASF dual-hosted git repository. rjung 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 9c8c87eba5 Improve websocket junit test timing behavior. 9c8c87eba5 is described below commit 9c8c87eba5001bb6e220fabf68a6b9edae03ee91 Author: Rainer Jung AuthorDate: Thu Apr 18 13:28:21 2024 +0200 Improve websocket junit test timing behavior. Since 11.0.0-M17 soome tests hit the default session close timeout of 30 seconds at the end of test. Set a session close timeout of 2 seconds for these tests instead. --- test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java | 6 ++ .../tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java | 3 +++ test/org/apache/tomcat/websocket/server/TestSlowClient.java | 3 +++ .../websocket/server/TestWsRemoteEndpointImplServerDeadlock.java| 3 +++ 4 files changed, 15 insertions(+) diff --git a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java index b8b661bed7..5abcb73a2a 100644 --- a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java +++ b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java @@ -105,6 +105,9 @@ public class TestWebSocketFrameClientSSL extends WebSocketBaseTest { Session wsSession = wsContainer.connectToServer(TesterProgrammaticEndpoint.class, clientEndpointConfig, new URI("wss://localhost:" + getPort() + TesterFirehoseServer.PATH)); +// Set a short session close timeout (milliseconds) +wsSession.getUserProperties().put( + org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, Long.valueOf(2000)); CountDownLatch latch = new CountDownLatch(TesterFirehoseServer.MESSAGE_COUNT); BasicText handler = new BasicText(latch); wsSession.addMessageHandler(handler); @@ -188,6 +191,9 @@ public class TestWebSocketFrameClientSSL extends WebSocketBaseTest { Assert.fail("There are [" + openConnectionCount + "] connections still open"); } +// Set a short session close timeout (milliseconds) +wsSession.getUserProperties().put( + org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, Long.valueOf(2000)); // Close the client session. wsSession.close(); } diff --git a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java index b3b31b699c..613fadde8c 100644 --- a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java +++ b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java @@ -100,6 +100,9 @@ public class TestWsWebSocketContainerTimeoutServer extends WsWebSocketContainerB loops++; } +// Set a short session close timeout (milliseconds) +wsSession.getUserProperties().put( + org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, Long.valueOf(2000)); // Close the client session, primarily to allow the // BackgroundProcessManager to shut down. wsSession.close(); diff --git a/test/org/apache/tomcat/websocket/server/TestSlowClient.java b/test/org/apache/tomcat/websocket/server/TestSlowClient.java index 411c395045..a9203609f5 100644 --- a/test/org/apache/tomcat/websocket/server/TestSlowClient.java +++ b/test/org/apache/tomcat/websocket/server/TestSlowClient.java @@ -70,6 +70,9 @@ public class TestSlowClient extends WebSocketBaseTest { count++; } Assert.assertTrue(wsSession.isOpen()); +// Set a short session close timeout (milliseconds) +wsSession.getUserProperties().put( + org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, Long.valueOf(2000)); wsSession.close(); // BZ 64848 (non-container thread variant) diff --git a/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java b/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java index 7959daa38c..86adf1ac1d 100644 --- a/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java +++ b/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java @@ -124,6 +124,9 @@ public class TestWsRemoteEndpointImplServerDeadlock extends WebSocketBaseTest { // Server buffers are full. Server cannot send any more messages. // Server is now blocked waiting for the client to read the messages. +// Set a short session close timeout (milliseconds) +session.getUserProperties().put( + org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, L
Unit tests using tcnative/panama [Was: [Bug 68910] Improve LibreSSL version check in tcnative.m4]
Am 18.04.24 um 09:08 schrieb bugzi...@apache.org: https://bz.apache.org/bugzilla/show_bug.cgi?id=68910 --- Comment #3 from Michael Osipov --- (In reply to Christopher Schultz from comment #1) (In reply to Michael Osipov from comment #0) since we also do support LibreSSL [...] Note: Support for LibreSSL is more of an aspiration and less of a requirement. We don't technically advertise support for LibreSSL, but I would like to be able to support it. FYI. Just ran 10.1.x with LibreSSL 3.5.2: [concat] TEST-org.apache.catalina.valves.rewrite.TestResolverSSL.NIO.txt [concat] TEST-org.apache.catalina.valves.rewrite.TestResolverSSL.NIO2.txt [concat] TEST-org.apache.tomcat.util.net.TestClientCert.NIO.txt [concat] TEST-org.apache.tomcat.util.net.TestClientCert.NIO2.txt [concat] TEST-org.apache.tomcat.util.net.TestCustomSslTrustManager.NIO.txt [concat] TEST-org.apache.tomcat.util.net.TestCustomSslTrustManager.NIO2.txt [concat] TEST-org.apache.tomcat.util.net.openssl.TestOpenSSLConf.NIO.txt [concat] TEST-org.apache.tomcat.util.net.openssl.TestOpenSSLConf.NIO2.txt The rest is passing. These are failing for renegotiation or protocol mismatch. That looks very promising. Probably not relevant for this specific topic but maybe of general interest: For other reasons I tried to identify, which unit tests actually load and execute with tcnative and/or panama, and those are very few. Most tests do not use these. Apart from the ones you mentioned as failing: org.apache.catalina.valves.rewrite.TestResolverSSL org.apache.tomcat.util.net.TestClientCert org.apache.tomcat.util.net.TestCustomSslTrustManager org.apache.tomcat.util.net.openssl.TestOpenSSLConf the only other tests I found using tcnative and/or openssl connectors are: org.apache.coyote.http2.TestLargeUpload org.apache.tomcat.util.net.TestClientCertTls13 org.apache.tomcat.util.net.TestSSLHostConfigCompat org.apache.tomcat.util.net.TestSSLHostConfigIntegration org.apache.tomcat.util.net.TestSsl org.apache.tomcat.websocket.TestWebSocketFrameClientSSL org.apache.tomcat.websocket.TestWsWebSocketContainerSSL So almost all of the tests actually using a connector to run servlets etc. only use plain http connectors (or fixed JSSE, but I think such do not exist). A few more might only use the commandline openssl binary. Those are not included in the above lists. Best regards, Rainer - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 68911] Newly introduced ConfigurationSource doesn't respect environment variables
https://bz.apache.org/bugzilla/show_bug.cgi?id=68911 --- Comment #4 from 7elem...@mail.bg --- "The only time "user.dir" is used is if the code initializing Tomcat doesn't give it any specific information about where to load the configuration files from." How do you give specific information about where to load the configuration files from initially? I didn't find a way to do that on initial start except having 2 server.xml files, one in user.dir and one in my separate location for configuration, because CATALINA_BASE environment variable is not respected as in tomcat 8 -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 68911] Newly introduced ConfigurationSource doesn't respect environment variables
https://bz.apache.org/bugzilla/show_bug.cgi?id=68911 7elem...@mail.bg changed: What|Removed |Added Status|NEEDINFO|NEW --- Comment #3 from 7elem...@mail.bg --- If you want to separate the binaries of tomcat from it's configuration folder, then user.dir complicates the matter immensely as initial read of server.xml where you can configure listener to register a source depends on DEFAULT ConfigurationSource. Maybe ConfigurationSource is 5 years old, but behavior changed with tomcat 9. It was not used as default for tomcat 8 -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 68910] Improve LibreSSL version check in tcnative.m4
https://bz.apache.org/bugzilla/show_bug.cgi?id=68910 --- Comment #3 from Michael Osipov --- (In reply to Christopher Schultz from comment #1) > (In reply to Michael Osipov from comment #0) > > since we also do support LibreSSL [...] > > Note: Support for LibreSSL is more of an aspiration and less of a > requirement. We don't technically advertise support for LibreSSL, but I > would like to be able to support it. FYI. Just ran 10.1.x with LibreSSL 3.5.2: [concat] TEST-org.apache.catalina.valves.rewrite.TestResolverSSL.NIO.txt [concat] TEST-org.apache.catalina.valves.rewrite.TestResolverSSL.NIO2.txt [concat] TEST-org.apache.tomcat.util.net.TestClientCert.NIO.txt [concat] TEST-org.apache.tomcat.util.net.TestClientCert.NIO2.txt [concat] TEST-org.apache.tomcat.util.net.TestCustomSslTrustManager.NIO.txt [concat] TEST-org.apache.tomcat.util.net.TestCustomSslTrustManager.NIO2.txt [concat] TEST-org.apache.tomcat.util.net.openssl.TestOpenSSLConf.NIO.txt [concat] TEST-org.apache.tomcat.util.net.openssl.TestOpenSSLConf.NIO2.txt The rest is passing. These are failing for renegotiation or protocol mismatch. That looks very promising. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org