Re: Test stability and tagging delayed

2024-02-12 Thread koteswara Rao Gundapaneni
On Tue, 13 Feb 2024, 10:19 koteswara Rao Gundapaneni, <
koti.gundapan...@gmail.com> wrote:

> Happy-go-lucky
>


   What I think happens is

Tomcat starts shutdown
Endpoint is destroyed
AprLifecycleListener shuts down native library


I would say the above points are fundamental to agree

>
>
>
> Regards
> Koti
>
>
> On Thu, 8 Feb 2024, 22:37 Mark Thomas,  wrote:
>
>> Hi all,
>>
>> TL;DR tagging likely delayed while APR/native stability issue is addressed
>>
>> We have had a couple of issues with test stability in the last few days.
>>
>> The issues with 11.0.x and 10.1.x were caused by the incomplete
>> convenience binary for Tomcat Native 2.0.7. That should be resolved now.
>> The 11.0.x tests are already green and I am expecting 10.1.x to be green
>> for the next run.
>>
>> 9.0.x and 8.5.x are a little more interesting. The instability was
>> triggered by the change to allow users to provide an SSLContext directly
>> to SSLHostConfigCertificate. This changed the timing of endpoint
>> destruction enough to make the intermittent APR crashes much more
>> frequent - almost on every run.
>>
>> The good news is that the more frequent crashes made it easier to
>> investigate. My current theory is related to the cleanup of
>> OpenSSLContext. In 9.0.x and 8.5.x clean-up of this object is performed
>> by a finalizer. This is to support runtime replacement of the
>> SSLHostContext.
>>
>> What I think happens is:
>> - Tomcat starts shutdown
>> - Endpoint is destroyed
>> - AprLifecycleListener shuts down Native library
>> - finalizer runs and tries to reference native code leading to a crash
>>
>> I have some initial ideas on how we might handle this better. The quick
>> and dirty fix was to force GC and add a delay in
>> AprLifecycleListener.terminateAPR() but that was just a hack to test the
>> theory.
>>
>> Back to working out a more robust fix...
>>
>> Mark
>>
>>
>> -
>> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: dev-h...@tomcat.apache.org
>>
>>


Re: Test stability and tagging delayed

2024-02-12 Thread koteswara Rao Gundapaneni
Happy-go-lucky



Regards
Koti


On Thu, 8 Feb 2024, 22:37 Mark Thomas,  wrote:

> Hi all,
>
> TL;DR tagging likely delayed while APR/native stability issue is addressed
>
> We have had a couple of issues with test stability in the last few days.
>
> The issues with 11.0.x and 10.1.x were caused by the incomplete
> convenience binary for Tomcat Native 2.0.7. That should be resolved now.
> The 11.0.x tests are already green and I am expecting 10.1.x to be green
> for the next run.
>
> 9.0.x and 8.5.x are a little more interesting. The instability was
> triggered by the change to allow users to provide an SSLContext directly
> to SSLHostConfigCertificate. This changed the timing of endpoint
> destruction enough to make the intermittent APR crashes much more
> frequent - almost on every run.
>
> The good news is that the more frequent crashes made it easier to
> investigate. My current theory is related to the cleanup of
> OpenSSLContext. In 9.0.x and 8.5.x clean-up of this object is performed
> by a finalizer. This is to support runtime replacement of the
> SSLHostContext.
>
> What I think happens is:
> - Tomcat starts shutdown
> - Endpoint is destroyed
> - AprLifecycleListener shuts down Native library
> - finalizer runs and tries to reference native code leading to a crash
>
> I have some initial ideas on how we might handle this better. The quick
> and dirty fix was to force GC and add a delay in
> AprLifecycleListener.terminateAPR() but that was just a hack to test the
> theory.
>
> Back to working out a more robust fix...
>
> 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-11.0.x

2024-02-12 Thread buildbot
Build status: BUILD FAILED: failed compile (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/112/builds/928
Blamelist: Mark Thomas 
Build Text: failed compile (failure)
Status Detected: new failure
Build Source Stamp: [branch main] 46737c5008f21b9612e51510472ddf7ab1b6cc7c


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



[Bug 68348] Support for Partitioned cookie attribute

2024-02-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68348

notify.bhar...@gmail.com changed:

   What|Removed |Added

 Resolution|FIXED   |---
 CC||notify.bhar...@gmail.com
 Status|RESOLVED|REOPENED

--- Comment #4 from notify.bhar...@gmail.com ---
I tested in both tomcat 8 and 9 latest versions, but still the cookies are not
coming as partitioned even though I have provided the below setting in
conf/context.xml. anything I am missing here ?



-- 
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 8.5.x updated: Fix IDE warnings

2024-02-12 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 8f17f57585 Fix IDE warnings
8f17f57585 is described below

commit 8f17f57585be4422cc5575b5e187befe739459c1
Author: Mark Thomas 
AuthorDate: Tue Feb 13 00:07:49 2024 +

Fix IDE warnings
---
 webapps/examples/WEB-INF/classes/RequestHeaderExample.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java 
b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
index 0cff06402f..df2d2d51f7 100644
--- a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
+++ b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
@@ -89,7 +89,7 @@ public class RequestHeaderExample extends HttpServlet {
 
 protected void renderHTML(HttpServletRequest request,
   HttpServletResponse response)
-throws IOException, ServletException
+throws IOException
 {
 ResourceBundle rb = 
ResourceBundle.getBundle("LocalStrings",request.getLocale());
 
@@ -144,7 +144,7 @@ public class RequestHeaderExample extends HttpServlet {
 }
 
 protected void renderJSON(HttpServletRequest request, HttpServletResponse 
response)
-throws IOException, ServletException
+throws IOException
 {
 response.setContentType("application/json");
 response.setCharacterEncoding("UTF-8");


-
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: Fix IDE warnings

2024-02-12 Thread markt
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 fda3901a54 Fix IDE warnings
fda3901a54 is described below

commit fda3901a5461e2582cd65a39408d9b0068eb3c07
Author: Mark Thomas 
AuthorDate: Tue Feb 13 00:07:49 2024 +

Fix IDE warnings
---
 webapps/examples/WEB-INF/classes/RequestHeaderExample.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java 
b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
index 0cff06402f..df2d2d51f7 100644
--- a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
+++ b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
@@ -89,7 +89,7 @@ public class RequestHeaderExample extends HttpServlet {
 
 protected void renderHTML(HttpServletRequest request,
   HttpServletResponse response)
-throws IOException, ServletException
+throws IOException
 {
 ResourceBundle rb = 
ResourceBundle.getBundle("LocalStrings",request.getLocale());
 
@@ -144,7 +144,7 @@ public class RequestHeaderExample extends HttpServlet {
 }
 
 protected void renderJSON(HttpServletRequest request, HttpServletResponse 
response)
-throws IOException, ServletException
+throws IOException
 {
 response.setContentType("application/json");
 response.setCharacterEncoding("UTF-8");


-
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: Fix IDE warnings

2024-02-12 Thread markt
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 b09409adf9 Fix IDE warnings
b09409adf9 is described below

commit b09409adf95f9745550b5c2d496af5f9a2283d87
Author: Mark Thomas 
AuthorDate: Tue Feb 13 00:07:49 2024 +

Fix IDE warnings
---
 webapps/examples/WEB-INF/classes/RequestHeaderExample.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java 
b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
index 451a7a1ad1..eaa2f1af53 100644
--- a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
+++ b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
@@ -89,7 +89,7 @@ public class RequestHeaderExample extends HttpServlet {
 
 protected void renderHTML(HttpServletRequest request,
   HttpServletResponse response)
-throws IOException, ServletException
+throws IOException
 {
 ResourceBundle rb = 
ResourceBundle.getBundle("LocalStrings",request.getLocale());
 
@@ -144,7 +144,7 @@ public class RequestHeaderExample extends HttpServlet {
 }
 
 protected void renderJSON(HttpServletRequest request, HttpServletResponse 
response)
-throws IOException, ServletException
+throws IOException
 {
 response.setContentType("application/json");
 response.setCharacterEncoding("UTF-8");


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch main updated: Fix IDE warnings

2024-02-12 Thread markt
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 46737c5008 Fix IDE warnings
46737c5008 is described below

commit 46737c5008f21b9612e51510472ddf7ab1b6cc7c
Author: Mark Thomas 
AuthorDate: Tue Feb 13 00:07:49 2024 +

Fix IDE warnings
---
 webapps/examples/WEB-INF/classes/RequestHeaderExample.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java 
b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
index 451a7a1ad1..eaa2f1af53 100644
--- a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
+++ b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
@@ -89,7 +89,7 @@ public class RequestHeaderExample extends HttpServlet {
 
 protected void renderHTML(HttpServletRequest request,
   HttpServletResponse response)
-throws IOException, ServletException
+throws IOException
 {
 ResourceBundle rb = 
ResourceBundle.getBundle("LocalStrings",request.getLocale());
 
@@ -144,7 +144,7 @@ public class RequestHeaderExample extends HttpServlet {
 }
 
 protected void renderJSON(HttpServletRequest request, HttpServletResponse 
response)
-throws IOException, ServletException
+throws IOException
 {
 response.setContentType("application/json");
 response.setCharacterEncoding("UTF-8");


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 02/03: Make recycled streams eligible for GC immediately. Improves scalability.

2024-02-12 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 63ae2b5c0becc9a49ecf7f16daa3e24161a1c6a9
Author: Mark Thomas 
AuthorDate: Thu Jan 25 12:20:14 2024 +

Make recycled streams eligible for GC immediately. Improves scalability.
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 2 +-
 java/org/apache/coyote/http2/Stream.java  | 2 +-
 webapps/docs/changelog.xml| 5 +
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index fbeda40486..7686ae057b 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -88,7 +88,7 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 
 private static final String HTTP2_SETTINGS_HEADER = "HTTP2-Settings";
 
-private static final HeaderSink HEADER_SINK = new HeaderSink();
+protected static final HeaderSink HEADER_SINK = new HeaderSink();
 
 protected final String connectionId;
 
diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index eb548119f6..d09506dcc4 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -517,7 +517,7 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
 if (headerException == null) {
 return;
 }
-
+
handler.getHpackDecoder().setHeaderEmitter(Http2UpgradeHandler.HEADER_SINK);
 throw headerException;
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index beebcf6765..26a7cbd71b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -170,6 +170,11 @@
 by reporting problems at the end of the frame where the error was
 detected rather than at the end of the headers. (markt)
   
+  
+   Remove the remaining reference to a stream once the stream has been
+   recycled. This makes the stream eligible for garbage collection earlier
+   and thereby improves scalability. (markt)
+  
 
   
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 01/03: Report HTTP/2 header parsing errors earlier

2024-02-12 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 0cac540a882220231ba7a82330483cbd5f6b1f96
Author: Mark Thomas 
AuthorDate: Thu Jan 25 12:13:55 2024 +

Report HTTP/2 header parsing errors earlier
---
 java/org/apache/coyote/http2/Http2Parser.java | 11 ++-
 webapps/docs/changelog.xml|  5 +
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2Parser.java 
b/java/org/apache/coyote/http2/Http2Parser.java
index 306e8a3831..2e2f4138c9 100644
--- a/java/org/apache/coyote/http2/Http2Parser.java
+++ b/java/org/apache/coyote/http2/Http2Parser.java
@@ -265,6 +265,9 @@ class Http2Parser {
 
 swallowPayload(streamId, FrameType.HEADERS.getId(), padLength, true);
 
+// Validate the headers so far
+hpackDecoder.getHeaderEmitter().validateHeaders();
+
 if (Flags.isEndOfHeaders(flags)) {
 onHeadersComplete(streamId);
 } else {
@@ -405,6 +408,9 @@ class Http2Parser {
 
 readHeaderPayload(streamId, payloadSize);
 
+// Validate the headers so far
+hpackDecoder.getHeaderEmitter().validateHeaders();
+
 if (endOfHeaders) {
 headersCurrentStream = -1;
 onHeadersComplete(streamId);
@@ -576,11 +582,6 @@ class Http2Parser {
 Http2Error.COMPRESSION_ERROR);
 }
 
-// Delay validation (and triggering any exception) until this point
-// since all the headers still have to be read if a StreamException is
-// going to be thrown.
-hpackDecoder.getHeaderEmitter().validateHeaders();
-
 output.headersEnd(streamId, headersEndStream);
 
 if (headersEndStream) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2fd2c8b664..beebcf6765 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -165,6 +165,11 @@
 Content-Type value to improve performance by reducing
 repeated byte[] to String conversions. 
(markt)
   
+  
+Improve error reporting to HTTP/2 clients for header processing errors
+by reporting problems at the end of the frame where the error was
+detected rather than at the end of the headers. (markt)
+  
 
   
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 03/03: Update tests after HTTP/2 improvements

2024-02-12 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 0be993676482b00af8edc1cb7f12f0ab292bfea6
Author: Mark Thomas 
AuthorDate: Thu Jan 25 14:48:30 2024 +

Update tests after HTTP/2 improvements
---
 test/org/apache/coyote/http2/TestHttp2Limits.java | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/coyote/http2/TestHttp2Limits.java 
b/test/org/apache/coyote/http2/TestHttp2Limits.java
index 056d928dbd..5e916528f7 100644
--- a/test/org/apache/coyote/http2/TestHttp2Limits.java
+++ b/test/org/apache/coyote/http2/TestHttp2Limits.java
@@ -164,7 +164,7 @@ public class TestHttp2Limits extends Http2TestBase {
 // 500ms per frame write delay to give server a chance to process the
 // stream reset and the connection reset before the request is fully
 // sent.
-doTestHeaderLimits(1, 32 * 1024, 1024, 500, 
FailureMode.CONNECTION_RESET);
+doTestHeaderLimits(1, 32 * 1024, 1024, 500, 
FailureMode.STREAM_RESET_THEN_CONNECTION_RESET);
 }
 
 
@@ -278,6 +278,13 @@ public class TestHttp2Limits extends Http2TestBase {
 Assert.assertNull(e);
 break;
 }
+case STREAM_RESET_THEN_CONNECTION_RESET: {
+// Expect a stream reset
+parser.readFrame();
+Assert.assertEquals("3-RST-[11]\n", output.getTrace());
+output.clearTrace();
+}
+//$FALL-THROUGH$
 case CONNECTION_RESET: {
 // This message uses i18n and needs to be used in a regular
 // expression (since we don't know the connection ID). 
Generate the
@@ -522,6 +529,10 @@ public class TestHttp2Limits extends Http2TestBase {
 Assert.assertEquals("3-RST-[11]\n", output.getTrace());
 break;
 }
+case STREAM_RESET_THEN_CONNECTION_RESET: {
+Assert.fail("Not used");
+break;
+}
 case CONNECTION_RESET: {
 // NIO2 can sometimes send window updates depending timing
 skipWindowSizeFrames();
@@ -544,7 +555,7 @@ public class TestHttp2Limits extends Http2TestBase {
 NONE,
 STREAM_RESET,
 CONNECTION_RESET,
-
+STREAM_RESET_THEN_CONNECTION_RESET,
 }
 
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 8.5.x updated (b5ab2fbf63 -> 0be9936764)

2024-02-12 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


from b5ab2fbf63 Additional performance tweak for BZ 68558
 new 0cac540a88 Report HTTP/2 header parsing errors earlier
 new 63ae2b5c0b Make recycled streams eligible for GC immediately. Improves 
scalability.
 new 0be9936764 Update tests after HTTP/2 improvements

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:
 java/org/apache/coyote/http2/Http2Parser.java | 11 ++-
 java/org/apache/coyote/http2/Http2UpgradeHandler.java |  2 +-
 java/org/apache/coyote/http2/Stream.java  |  2 +-
 test/org/apache/coyote/http2/TestHttp2Limits.java | 15 +--
 webapps/docs/changelog.xml| 10 ++
 5 files changed, 31 insertions(+), 9 deletions(-)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 02/03: Make recycled streams eligible for GC immediately. Improves scalability.

2024-02-12 Thread markt
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 96f00fa41b6582a3ece5c5bac7b1e2afbb28354b
Author: Mark Thomas 
AuthorDate: Thu Jan 25 12:20:14 2024 +

Make recycled streams eligible for GC immediately. Improves scalability.
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 2 +-
 java/org/apache/coyote/http2/Stream.java  | 2 +-
 webapps/docs/changelog.xml| 5 +
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 34abacc99a..64796a75fb 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -87,7 +87,7 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 
 private static final String HTTP2_SETTINGS_HEADER = "HTTP2-Settings";
 
-private static final HeaderSink HEADER_SINK = new HeaderSink();
+protected static final HeaderSink HEADER_SINK = new HeaderSink();
 
 protected final String connectionId;
 
diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index 65a874f81e..c363082159 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -526,7 +526,7 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
 if (headerException == null) {
 return;
 }
-
+
handler.getHpackDecoder().setHeaderEmitter(Http2UpgradeHandler.HEADER_SINK);
 throw headerException;
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f6cf372b9a..877ff40204 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -176,6 +176,11 @@
 by reporting problems at the end of the frame where the error was
 detected rather than at the end of the headers. (markt)
   
+  
+   Remove the remaining reference to a stream once the stream has been
+   recycled. This makes the stream eligible for garbage collection earlier
+   and thereby improves scalability. (markt)
+  
 
   
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 01/03: Report HTTP/2 header parsing errors earlier

2024-02-12 Thread markt
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 8e03be9f2698f2da9027d40b9e9c0c9429b74dc0
Author: Mark Thomas 
AuthorDate: Thu Jan 25 12:13:55 2024 +

Report HTTP/2 header parsing errors earlier
---
 java/org/apache/coyote/http2/Http2Parser.java | 11 ++-
 webapps/docs/changelog.xml|  5 +
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2Parser.java 
b/java/org/apache/coyote/http2/Http2Parser.java
index 5053a219be..c1f8542227 100644
--- a/java/org/apache/coyote/http2/Http2Parser.java
+++ b/java/org/apache/coyote/http2/Http2Parser.java
@@ -283,6 +283,9 @@ class Http2Parser {
 
 swallowPayload(streamId, FrameType.HEADERS.getId(), padLength, true, 
buffer);
 
+// Validate the headers so far
+hpackDecoder.getHeaderEmitter().validateHeaders();
+
 if (Flags.isEndOfHeaders(flags)) {
 onHeadersComplete(streamId);
 } else {
@@ -446,6 +449,9 @@ class Http2Parser {
 
 readHeaderPayload(streamId, payloadSize, buffer);
 
+// Validate the headers so far
+hpackDecoder.getHeaderEmitter().validateHeaders();
+
 if (endOfHeaders) {
 headersCurrentStream = -1;
 onHeadersComplete(streamId);
@@ -637,11 +643,6 @@ class Http2Parser {
 Http2Error.COMPRESSION_ERROR);
 }
 
-// Delay validation (and triggering any exception) until this point
-// since all the headers still have to be read if a StreamException is
-// going to be thrown.
-hpackDecoder.getHeaderEmitter().validateHeaders();
-
 synchronized (output) {
 output.headersEnd(streamId, headersEndStream);
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 0aa6868e70..f6cf372b9a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -171,6 +171,11 @@
 Content-Type value to improve performance by reducing
 repeated byte[] to String conversions. 
(markt)
   
+  
+Improve error reporting to HTTP/2 clients for header processing errors
+by reporting problems at the end of the frame where the error was
+detected rather than at the end of the headers. (markt)
+  
 
   
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 03/03: Update tests after HTTP/2 improvements

2024-02-12 Thread markt
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 7be21696bf31a19828168de3db94767030d69ec6
Author: Mark Thomas 
AuthorDate: Thu Jan 25 14:48:30 2024 +

Update tests after HTTP/2 improvements
---
 test/org/apache/coyote/http2/TestHttp2Limits.java | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/coyote/http2/TestHttp2Limits.java 
b/test/org/apache/coyote/http2/TestHttp2Limits.java
index b3214eb012..7b891fbfff 100644
--- a/test/org/apache/coyote/http2/TestHttp2Limits.java
+++ b/test/org/apache/coyote/http2/TestHttp2Limits.java
@@ -165,7 +165,7 @@ public class TestHttp2Limits extends Http2TestBase {
 // 500ms per frame write delay to give server a chance to process the
 // stream reset and the connection reset before the request is fully
 // sent.
-doTestHeaderLimits(1, 32 * 1024, 1024, 500, 
FailureMode.CONNECTION_RESET);
+doTestHeaderLimits(1, 32 * 1024, 1024, 500, 
FailureMode.STREAM_RESET_THEN_CONNECTION_RESET);
 }
 
 
@@ -279,6 +279,13 @@ public class TestHttp2Limits extends Http2TestBase {
 Assert.assertNull(e);
 break;
 }
+case STREAM_RESET_THEN_CONNECTION_RESET: {
+// Expect a stream reset
+parser.readFrame();
+Assert.assertEquals("3-RST-[11]\n", output.getTrace());
+output.clearTrace();
+}
+//$FALL-THROUGH$
 case CONNECTION_RESET: {
 // This message uses i18n and needs to be used in a regular
 // expression (since we don't know the connection ID). 
Generate the
@@ -523,6 +530,10 @@ public class TestHttp2Limits extends Http2TestBase {
 Assert.assertEquals("3-RST-[11]\n", output.getTrace());
 break;
 }
+case STREAM_RESET_THEN_CONNECTION_RESET: {
+Assert.fail("Not used");
+break;
+}
 case CONNECTION_RESET: {
 // NIO2 can sometimes send window updates depending timing
 skipWindowSizeFrames();
@@ -545,7 +556,7 @@ public class TestHttp2Limits extends Http2TestBase {
 NONE,
 STREAM_RESET,
 CONNECTION_RESET,
-
+STREAM_RESET_THEN_CONNECTION_RESET,
 }
 
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 03/03: Update tests after HTTP/2 improvements

2024-02-12 Thread markt
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 df1114c74fb2a95c074a3dc05f251867f58ddf97
Author: Mark Thomas 
AuthorDate: Thu Jan 25 14:48:30 2024 +

Update tests after HTTP/2 improvements
---
 test/org/apache/coyote/http2/TestHttp2Limits.java | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/coyote/http2/TestHttp2Limits.java 
b/test/org/apache/coyote/http2/TestHttp2Limits.java
index 056d928dbd..5e916528f7 100644
--- a/test/org/apache/coyote/http2/TestHttp2Limits.java
+++ b/test/org/apache/coyote/http2/TestHttp2Limits.java
@@ -164,7 +164,7 @@ public class TestHttp2Limits extends Http2TestBase {
 // 500ms per frame write delay to give server a chance to process the
 // stream reset and the connection reset before the request is fully
 // sent.
-doTestHeaderLimits(1, 32 * 1024, 1024, 500, 
FailureMode.CONNECTION_RESET);
+doTestHeaderLimits(1, 32 * 1024, 1024, 500, 
FailureMode.STREAM_RESET_THEN_CONNECTION_RESET);
 }
 
 
@@ -278,6 +278,13 @@ public class TestHttp2Limits extends Http2TestBase {
 Assert.assertNull(e);
 break;
 }
+case STREAM_RESET_THEN_CONNECTION_RESET: {
+// Expect a stream reset
+parser.readFrame();
+Assert.assertEquals("3-RST-[11]\n", output.getTrace());
+output.clearTrace();
+}
+//$FALL-THROUGH$
 case CONNECTION_RESET: {
 // This message uses i18n and needs to be used in a regular
 // expression (since we don't know the connection ID). 
Generate the
@@ -522,6 +529,10 @@ public class TestHttp2Limits extends Http2TestBase {
 Assert.assertEquals("3-RST-[11]\n", output.getTrace());
 break;
 }
+case STREAM_RESET_THEN_CONNECTION_RESET: {
+Assert.fail("Not used");
+break;
+}
 case CONNECTION_RESET: {
 // NIO2 can sometimes send window updates depending timing
 skipWindowSizeFrames();
@@ -544,7 +555,7 @@ public class TestHttp2Limits extends Http2TestBase {
 NONE,
 STREAM_RESET,
 CONNECTION_RESET,
-
+STREAM_RESET_THEN_CONNECTION_RESET,
 }
 
 


-
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 (ad5a1b5f2c -> 7be21696bf)

2024-02-12 Thread markt
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 ad5a1b5f2c Additional performance tweak for BZ 68558
 new d07c82194e Report HTTP/2 header parsing errors earlier
 new 73c6837563 Make recycled streams eligible for GC immediately. Improves 
scalability.
 new 7be21696bf Update tests after HTTP/2 improvements

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:
 java/org/apache/coyote/http2/Http2Parser.java | 11 ++-
 java/org/apache/coyote/http2/Http2UpgradeHandler.java |  2 +-
 java/org/apache/coyote/http2/Stream.java  |  2 +-
 test/org/apache/coyote/http2/TestHttp2Limits.java | 15 +--
 webapps/docs/changelog.xml| 10 ++
 5 files changed, 31 insertions(+), 9 deletions(-)


-
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 (2178bf6a0e -> df1114c74f)

2024-02-12 Thread markt
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 2178bf6a0e Additional performance tweak for BZ 68558
 new 8e03be9f26 Report HTTP/2 header parsing errors earlier
 new 96f00fa41b Make recycled streams eligible for GC immediately. Improves 
scalability.
 new df1114c74f Update tests after HTTP/2 improvements

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:
 java/org/apache/coyote/http2/Http2Parser.java | 11 ++-
 java/org/apache/coyote/http2/Http2UpgradeHandler.java |  2 +-
 java/org/apache/coyote/http2/Stream.java  |  2 +-
 test/org/apache/coyote/http2/TestHttp2Limits.java | 15 +--
 webapps/docs/changelog.xml| 10 ++
 5 files changed, 31 insertions(+), 9 deletions(-)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 01/03: Report HTTP/2 header parsing errors earlier

2024-02-12 Thread markt
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 d07c82194edb69d99b438828fe2cbfadbb207843
Author: Mark Thomas 
AuthorDate: Thu Jan 25 12:13:55 2024 +

Report HTTP/2 header parsing errors earlier
---
 java/org/apache/coyote/http2/Http2Parser.java | 11 ++-
 webapps/docs/changelog.xml|  5 +
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2Parser.java 
b/java/org/apache/coyote/http2/Http2Parser.java
index 614ebbaaf9..b9f95e3cd7 100644
--- a/java/org/apache/coyote/http2/Http2Parser.java
+++ b/java/org/apache/coyote/http2/Http2Parser.java
@@ -283,6 +283,9 @@ class Http2Parser {
 
 swallowPayload(streamId, FrameType.HEADERS.getId(), padLength, true, 
buffer);
 
+// Validate the headers so far
+hpackDecoder.getHeaderEmitter().validateHeaders();
+
 if (Flags.isEndOfHeaders(flags)) {
 onHeadersComplete(streamId);
 } else {
@@ -446,6 +449,9 @@ class Http2Parser {
 
 readHeaderPayload(streamId, payloadSize, buffer);
 
+// Validate the headers so far
+hpackDecoder.getHeaderEmitter().validateHeaders();
+
 if (endOfHeaders) {
 headersCurrentStream = -1;
 onHeadersComplete(streamId);
@@ -637,11 +643,6 @@ class Http2Parser {
 Http2Error.COMPRESSION_ERROR);
 }
 
-// Delay validation (and triggering any exception) until this point
-// since all the headers still have to be read if a StreamException is
-// going to be thrown.
-hpackDecoder.getHeaderEmitter().validateHeaders();
-
 synchronized (output) {
 output.headersEnd(streamId, headersEndStream);
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 10faaf173f..e7840832d4 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -171,6 +171,11 @@
 Content-Type value to improve performance by reducing
 repeated byte[] to String conversions. 
(markt)
   
+  
+Improve error reporting to HTTP/2 clients for header processing errors
+by reporting problems at the end of the frame where the error was
+detected rather than at the end of the headers. (markt)
+  
 
   
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 02/03: Make recycled streams eligible for GC immediately. Improves scalability.

2024-02-12 Thread markt
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 73c68375634a178b625b0f108336fb73438d3e90
Author: Mark Thomas 
AuthorDate: Thu Jan 25 12:20:14 2024 +

Make recycled streams eligible for GC immediately. Improves scalability.
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 2 +-
 java/org/apache/coyote/http2/Stream.java  | 2 +-
 webapps/docs/changelog.xml| 5 +
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index e12fe09a15..d075df3ae9 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -87,7 +87,7 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 
 private static final String HTTP2_SETTINGS_HEADER = "HTTP2-Settings";
 
-private static final HeaderSink HEADER_SINK = new HeaderSink();
+protected static final HeaderSink HEADER_SINK = new HeaderSink();
 
 protected final String connectionId;
 
diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index b1c42489a7..400e9a6bbe 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -528,7 +528,7 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
 if (headerException == null) {
 return;
 }
-
+
handler.getHpackDecoder().setHeaderEmitter(Http2UpgradeHandler.HEADER_SINK);
 throw headerException;
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e7840832d4..ef6129d957 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -176,6 +176,11 @@
 by reporting problems at the end of the frame where the error was
 detected rather than at the end of the headers. (markt)
   
+  
+   Remove the remaining reference to a stream once the stream has been
+   recycled. This makes the stream eligible for garbage collection earlier
+   and thereby improves scalability. (markt)
+  
 
   
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 02/03: Make recycled streams eligible for GC immediately. Improves scalability.

2024-02-12 Thread markt
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 f7937bdea2987455f05bdee21b0f86b85aa93f34
Author: Mark Thomas 
AuthorDate: Thu Jan 25 12:20:14 2024 +

Make recycled streams eligible for GC immediately. Improves scalability.
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 2 +-
 java/org/apache/coyote/http2/Stream.java  | 2 +-
 webapps/docs/changelog.xml| 5 +
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 533dc500b5..3e4768cf63 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -87,7 +87,7 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 
 private static final String HTTP2_SETTINGS_HEADER = "HTTP2-Settings";
 
-private static final HeaderSink HEADER_SINK = new HeaderSink();
+protected static final HeaderSink HEADER_SINK = new HeaderSink();
 
 protected final String connectionId;
 
diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index 5fff907a41..d83e98f0bf 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -522,7 +522,7 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
 if (headerException == null) {
 return;
 }
-
+
handler.getHpackDecoder().setHeaderEmitter(Http2UpgradeHandler.HEADER_SINK);
 throw headerException;
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index aa9d561731..dca3b91032 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -187,6 +187,11 @@
 by reporting problems at the end of the frame where the error was
 detected rather than at the end of the headers. (markt)
   
+  
+   Remove the remaining reference to a stream once the stream has been
+   recycled. This makes the stream eligible for garbage collection earlier
+   and thereby improves scalability. (markt)
+  
 
   
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 03/03: Update tests after HTTP/2 improvements

2024-02-12 Thread markt
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 4bacb383665bb3cdd0cec1293ac275999123a9dc
Author: Mark Thomas 
AuthorDate: Thu Jan 25 14:48:30 2024 +

Update tests after HTTP/2 improvements
---
 test/org/apache/coyote/http2/TestHttp2Limits.java | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/coyote/http2/TestHttp2Limits.java 
b/test/org/apache/coyote/http2/TestHttp2Limits.java
index b3214eb012..7b891fbfff 100644
--- a/test/org/apache/coyote/http2/TestHttp2Limits.java
+++ b/test/org/apache/coyote/http2/TestHttp2Limits.java
@@ -165,7 +165,7 @@ public class TestHttp2Limits extends Http2TestBase {
 // 500ms per frame write delay to give server a chance to process the
 // stream reset and the connection reset before the request is fully
 // sent.
-doTestHeaderLimits(1, 32 * 1024, 1024, 500, 
FailureMode.CONNECTION_RESET);
+doTestHeaderLimits(1, 32 * 1024, 1024, 500, 
FailureMode.STREAM_RESET_THEN_CONNECTION_RESET);
 }
 
 
@@ -279,6 +279,13 @@ public class TestHttp2Limits extends Http2TestBase {
 Assert.assertNull(e);
 break;
 }
+case STREAM_RESET_THEN_CONNECTION_RESET: {
+// Expect a stream reset
+parser.readFrame();
+Assert.assertEquals("3-RST-[11]\n", output.getTrace());
+output.clearTrace();
+}
+//$FALL-THROUGH$
 case CONNECTION_RESET: {
 // This message uses i18n and needs to be used in a regular
 // expression (since we don't know the connection ID). 
Generate the
@@ -523,6 +530,10 @@ public class TestHttp2Limits extends Http2TestBase {
 Assert.assertEquals("3-RST-[11]\n", output.getTrace());
 break;
 }
+case STREAM_RESET_THEN_CONNECTION_RESET: {
+Assert.fail("Not used");
+break;
+}
 case CONNECTION_RESET: {
 // NIO2 can sometimes send window updates depending timing
 skipWindowSizeFrames();
@@ -545,7 +556,7 @@ public class TestHttp2Limits extends Http2TestBase {
 NONE,
 STREAM_RESET,
 CONNECTION_RESET,
-
+STREAM_RESET_THEN_CONNECTION_RESET,
 }
 
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 01/03: Report HTTP/2 header parsing errors earlier

2024-02-12 Thread markt
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 810f49d5ff6d64b704af85d5b8d0aab9ec3c83f5
Author: Mark Thomas 
AuthorDate: Thu Jan 25 12:13:55 2024 +

Report HTTP/2 header parsing errors earlier
---
 java/org/apache/coyote/http2/Http2Parser.java | 11 ++-
 webapps/docs/changelog.xml|  5 +
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2Parser.java 
b/java/org/apache/coyote/http2/Http2Parser.java
index 10b86a2bc8..ec26909761 100644
--- a/java/org/apache/coyote/http2/Http2Parser.java
+++ b/java/org/apache/coyote/http2/Http2Parser.java
@@ -266,6 +266,9 @@ class Http2Parser {
 
 swallowPayload(streamId, FrameType.HEADERS.getId(), padLength, true, 
buffer);
 
+// Validate the headers so far
+hpackDecoder.getHeaderEmitter().validateHeaders();
+
 if (Flags.isEndOfHeaders(flags)) {
 onHeadersComplete(streamId);
 } else {
@@ -429,6 +432,9 @@ class Http2Parser {
 
 readHeaderPayload(streamId, payloadSize, buffer);
 
+// Validate the headers so far
+hpackDecoder.getHeaderEmitter().validateHeaders();
+
 if (endOfHeaders) {
 headersCurrentStream = -1;
 onHeadersComplete(streamId);
@@ -620,11 +626,6 @@ class Http2Parser {
 Http2Error.COMPRESSION_ERROR);
 }
 
-// Delay validation (and triggering any exception) until this point
-// since all the headers still have to be read if a StreamException is
-// going to be thrown.
-hpackDecoder.getHeaderEmitter().validateHeaders();
-
 synchronized (output) {
 output.headersEnd(streamId, headersEndStream);
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 446d2d7ea9..aa9d561731 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -182,6 +182,11 @@
 Content-Type value to improve performance by reducing
 repeated byte[] to String conversions. 
(markt)
   
+  
+Improve error reporting to HTTP/2 clients for header processing errors
+by reporting problems at the end of the frame where the error was
+detected rather than at the end of the headers. (markt)
+  
 
   
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch main updated (6281c57d2f -> 4bacb38366)

2024-02-12 Thread markt
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 6281c57d2f Additional performance tweak for BZ 68558
 new 810f49d5ff Report HTTP/2 header parsing errors earlier
 new f7937bdea2 Make recycled streams eligible for GC immediately. Improves 
scalability.
 new 4bacb38366 Update tests after HTTP/2 improvements

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:
 java/org/apache/coyote/http2/Http2Parser.java | 11 ++-
 java/org/apache/coyote/http2/Http2UpgradeHandler.java |  2 +-
 java/org/apache/coyote/http2/Stream.java  |  2 +-
 test/org/apache/coyote/http2/TestHttp2Limits.java | 15 +--
 webapps/docs/changelog.xml| 10 ++
 5 files changed, 31 insertions(+), 9 deletions(-)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r67315 - in /release/tomcat: tomcat-9/v9.0.83/ tomcat-9/v9.0.84/ tomcat-connectors/native/2.0.6/

2024-02-12 Thread markt
Author: markt
Date: Mon Feb 12 23:36:56 2024
New Revision: 67315

Log:
Drop older releases from CDN

Removed:
release/tomcat/tomcat-9/v9.0.83/
release/tomcat/tomcat-9/v9.0.84/
release/tomcat/tomcat-connectors/native/2.0.6/


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r67314 - /dev/tomcat/tomcat-connectors/native/1.3.0/ /release/tomcat/tomcat-connectors/native/1.3.0/

2024-02-12 Thread markt
Author: markt
Date: Mon Feb 12 23:35:57 2024
New Revision: 67314

Log:
Release Apache Tomcat Native 1.3.0

Added:
release/tomcat/tomcat-connectors/native/1.3.0/
  - copied from r67313, dev/tomcat/tomcat-connectors/native/1.3.0/
Removed:
dev/tomcat/tomcat-connectors/native/1.3.0/


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[VOTE][RESULT] Release Apache Tomcat Native 1.3.0

2024-02-12 Thread Mark Thomas

The following votes were cast:

Binding:
+1: markt, schultz, remm

No other votes were cast. The vote therefore passes.

Thanks to everyone who helped with this release.

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 68558] Redundant calls to ByteChunk.toString()

2024-02-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68558

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

--- Comment #8 from Mark Thomas  ---
The caching for getMethod() isn't present in 9.0.81. It is present from 9.0.83
onwards.

I've added caching of the header values as well as the names.

-- 
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 8.5.x updated: Additional performance tweak for BZ 68558

2024-02-12 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new b5ab2fbf63 Additional performance tweak for BZ 68558
b5ab2fbf63 is described below

commit b5ab2fbf63a3f3310b0ba65f7fe72cb3ea911db7
Author: Mark Thomas 
AuthorDate: Mon Feb 12 23:32:06 2024 +

Additional performance tweak for BZ 68558

https://bz.apache.org/bugzilla/show_bug.cgi?id=68558
---
 java/org/apache/tomcat/util/http/MimeHeaders.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/http/MimeHeaders.java 
b/java/org/apache/tomcat/util/http/MimeHeaders.java
index fd4394c882..070a709e82 100644
--- a/java/org/apache/tomcat/util/http/MimeHeaders.java
+++ b/java/org/apache/tomcat/util/http/MimeHeaders.java
@@ -488,7 +488,7 @@ class ValuesEnumerator implements Enumeration {
 public String nextElement() {
 MessageBytes current = next;
 findNext();
-return current.toString();
+return current.toStringType();
 }
 }
 


-
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: Additional performance tweak for BZ 68558

2024-02-12 Thread markt
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 2178bf6a0e Additional performance tweak for BZ 68558
2178bf6a0e is described below

commit 2178bf6a0ee1beceb3b461a9b2b5ea6a5c994e7c
Author: Mark Thomas 
AuthorDate: Mon Feb 12 23:32:06 2024 +

Additional performance tweak for BZ 68558

https://bz.apache.org/bugzilla/show_bug.cgi?id=68558
---
 java/org/apache/tomcat/util/http/MimeHeaders.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/http/MimeHeaders.java 
b/java/org/apache/tomcat/util/http/MimeHeaders.java
index fd4394c882..070a709e82 100644
--- a/java/org/apache/tomcat/util/http/MimeHeaders.java
+++ b/java/org/apache/tomcat/util/http/MimeHeaders.java
@@ -488,7 +488,7 @@ class ValuesEnumerator implements Enumeration {
 public String nextElement() {
 MessageBytes current = next;
 findNext();
-return current.toString();
+return current.toStringType();
 }
 }
 


-
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: Additional performance tweak for BZ 68558

2024-02-12 Thread markt
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 ad5a1b5f2c Additional performance tweak for BZ 68558
ad5a1b5f2c is described below

commit ad5a1b5f2cd374f9315425a2b147b3a10e5800a0
Author: Mark Thomas 
AuthorDate: Mon Feb 12 23:32:06 2024 +

Additional performance tweak for BZ 68558

https://bz.apache.org/bugzilla/show_bug.cgi?id=68558
---
 java/org/apache/tomcat/util/http/MimeHeaders.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/http/MimeHeaders.java 
b/java/org/apache/tomcat/util/http/MimeHeaders.java
index fd4394c882..070a709e82 100644
--- a/java/org/apache/tomcat/util/http/MimeHeaders.java
+++ b/java/org/apache/tomcat/util/http/MimeHeaders.java
@@ -488,7 +488,7 @@ class ValuesEnumerator implements Enumeration {
 public String nextElement() {
 MessageBytes current = next;
 findNext();
-return current.toString();
+return current.toStringType();
 }
 }
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch main updated: Additional performance tweak for BZ 68558

2024-02-12 Thread markt
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 6281c57d2f Additional performance tweak for BZ 68558
6281c57d2f is described below

commit 6281c57d2f379244fbe7b691d5e0f96d88440d89
Author: Mark Thomas 
AuthorDate: Mon Feb 12 23:32:06 2024 +

Additional performance tweak for BZ 68558

https://bz.apache.org/bugzilla/show_bug.cgi?id=68558
---
 java/org/apache/tomcat/util/http/MimeHeaders.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/http/MimeHeaders.java 
b/java/org/apache/tomcat/util/http/MimeHeaders.java
index 065a19a223..56f4ba298b 100644
--- a/java/org/apache/tomcat/util/http/MimeHeaders.java
+++ b/java/org/apache/tomcat/util/http/MimeHeaders.java
@@ -483,7 +483,7 @@ class ValuesEnumerator implements Enumeration {
 public String nextElement() {
 MessageBytes current = next;
 findNext();
-return current.toString();
+return current.toStringType();
 }
 }
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: Required build version(s)

2024-02-12 Thread Michael Osipov
I have complained about this many times...

On 2024/02/12 20:58:14 Christopher Schultz wrote:
> All,
> 
> The release managers have bumped-up their tool chains to Java 17 or 
> later for all supported releases. Tomcat 11 requires Java 21. Tomcat 
> 8.5.x only requires Java 11.
> 
> But the documented Java versions for each release are actually:
> 
> Tomcat 11 - Java 21
> Tomcat 10 - Java 11
> Tomcat  9 - Java 8
> Tomcat  8 - Java 7
> 
> Theoretically, anyone ought to be able to build Tomcat with the 
> minimum-required Java version for that branch. There are some practical 
> reasons why you can't build Tomcat 8.5.x with Java 7 but those have more 
> to do with supporting versions of Java *after* 7 than anything else.
> 
> I'd like to be able to allow anyone to build their Tomcat from source 
> using our tooling (e.g. ant-based build) and the minimum Java version 
> (with one exception: No support for Java 7 for builds).
> 
> Take Tomcat 9.0.x for example. The ant-based build will complain if you 
> are using Java 11 to build, because the build tools demand the use of 
> Java 17. If you simply change the "required version" from 17 to 11, the 
> build works perfectly fine.

No, it won't. I have written exactly this last week. BND is now at version 7.0 
which requires Java 17at runtime. I have downgraded manually to 6.4.0 to test 
on HP-UX with Tomcat Native 1.3.x.
For the sake of latest BND I don't see a strong reason to force Java 17, 
especially for those who want to test...

My overall opinion is to impose the oldest required version to build and test 
it. (not talking about release).

Michael

PS: Thank for raising, Chris!

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 68558] Redundant calls to ByteChunk.toString()

2024-02-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68558

John Engebretson  changed:

   What|Removed |Added

 Status|NEEDINFO|NEW

--- Comment #7 from John Engebretson  ---
Updating status

-- 
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 68558] Redundant calls to ByteChunk.toString()

2024-02-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68558

--- Comment #6 from John Engebretson  ---
Thank you for the quick turnaround!  Additional data:

Referring to #1:
> getMethod() is already effectively cached due to use of 
> MessageBytes.toStringType()

Our data is clear that this is re-parsing each time.  The call occurs at the
beginning of each JSP at the very beginning of the generated _jspService()
method:

final java.lang.String _jspx_method = request.getMethod();


Referring to #2: the code triggering this is below.  I can't clearly determine
whether the slow enum comes from request.getHeaders() or
request.getHeaderNames().

HttpServletRequest request = context.getRequest();
Enumeration nameEnum = request.getHeaderNames();
while (nameEnum.hasMoreElements()) {
  String name = nameEnum.nextElement();
  List headerValues = new LinkedList();

  Enumeration valueEnum = request.getHeaders(name);
  while (valueEnum.hasMoreElements()) {
headerValues.add(valueEnum.nextElement());
  }

  headerMap.put(name, Collections.unmodifiableList(headerValues));
}

Referring to #3:
> Cannot reproduce.
I don't immediately see another trigger for this case, but will keep looking. 
The behavior occurs throughout our app but I'll also compare with some others.

-- 
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



Required build version(s)

2024-02-12 Thread Christopher Schultz

All,

The release managers have bumped-up their tool chains to Java 17 or 
later for all supported releases. Tomcat 11 requires Java 21. Tomcat 
8.5.x only requires Java 11.


But the documented Java versions for each release are actually:

Tomcat 11 - Java 21
Tomcat 10 - Java 11
Tomcat  9 - Java 8
Tomcat  8 - Java 7

Theoretically, anyone ought to be able to build Tomcat with the 
minimum-required Java version for that branch. There are some practical 
reasons why you can't build Tomcat 8.5.x with Java 7 but those have more 
to do with supporting versions of Java *after* 7 than anything else.


I'd like to be able to allow anyone to build their Tomcat from source 
using our tooling (e.g. ant-based build) and the minimum Java version 
(with one exception: No support for Java 7 for builds).


Take Tomcat 9.0.x for example. The ant-based build will complain if you 
are using Java 11 to build, because the build tools demand the use of 
Java 17. If you simply change the "required version" from 17 to 11, the 
build works perfectly fine.


I honestly can't remember why we switched everything from Java 11 to 
Java 17 for Tomcat 9.0.x, but the point is that it works. We may still 
want to do official releases using Java 17 or 21 or whatever, but 
*regular users* ought to be able to build from source without too much 
trouble.


I'm wondering if we could do something like the following:

1. Change build.java.version to be the *actual* minimum supported JDK 
for the build. This would be the lowest version of Java known to 
successfully compile the package. I would argue this should be set to 
the "Minimum Java Version" for that release.


2. Introduce a new release.java.version to be set to the minimum 
supported JDK for a *release* build. This can be set to whatever the 
release managers deem appropriate.


3. During "ant pre-release", we take the release.java.version setting 
and copy it into the build.properties.release file like this:


build.java.version=${release.java.version}

Then, when a release-build is performed, it will require the (likely) 
later version of Java. But that will still allow non-release-managers to 
build locally using potentially older versions of Java.


WDYT?

-chris

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 8.5.x updated: Add support for JSON responses to request header example.

2024-02-12 Thread schultz
This is an automated email from the ASF dual-hosted git repository.

schultz pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new ddd340766f Add support for JSON responses to request header example.
ddd340766f is described below

commit ddd340766f19443210537bc244ecd7ba13a7c692
Author: Christopher Schultz 
AuthorDate: Mon Feb 12 15:18:22 2024 -0500

Add support for JSON responses to request header example.
---
 webapps/docs/changelog.xml |  8 +++
 .../WEB-INF/classes/RequestHeaderExample.java  | 77 +-
 2 files changed, 84 insertions(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 5900a72199..2fd2c8b664 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -191,6 +191,14 @@
   
 
   
+  
+
+  
+Add support for responses in JSON format from the examples application
+RequestHeaderExample. (schultz)
+  
+
+  
   
 
   
diff --git a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java 
b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
index a80076c697..0cff06402f 100644
--- a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
+++ b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
@@ -27,6 +27,8 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import org.apache.tomcat.util.json.JSONFilter;
+
 import util.CookieFilter;
 import util.HTMLFilter;
 
@@ -35,7 +37,6 @@ import util.HTMLFilter;
  *
  * @author James Duncan Davidson dun...@eng.sun.com>
  */
-
 public class RequestHeaderExample extends HttpServlet {
 
 private static final long serialVersionUID = 1L;
@@ -44,6 +45,51 @@ public class RequestHeaderExample extends HttpServlet {
 public void doGet(HttpServletRequest request,
   HttpServletResponse response)
 throws IOException, ServletException
+{
+if (prefersJSON(request.getHeader("Accept"))) {
+renderJSON(request, response);
+} else {
+renderHTML(request, response);
+}
+}
+
+/**
+ * Returns true if the client appears to prefer a JSON response,
+ * false otherwise.
+ *
+ * Note that this method is not very pedantic and uses only a very lazy
+ * algorithm for checking whether JSON is "preferred".
+ *
+ * @param acceptHeader The value of the HTTP "Accept" header from the 
client.
+ *
+ * @return true if the client appears to prefer a JSON response,
+ *  false otherwise.
+ */
+protected boolean prefersJSON(String acceptHeader) {
+if (null == acceptHeader) {
+return false;
+}
+// mime/type, mime/type;q=n, ...
+
+// Don't bother with the q-factor.
+// This is not expected to be 100% accurate or spec-compliant
+String[] accepts = acceptHeader.split(",");
+for (String accept : accepts) {
+if (accept.contains("application/json")) {
+return true;
+}
+
+// text/html, application/html, etc.
+if (accept.contains("html")) {
+return false;
+}
+}
+return false;
+}
+
+protected void renderHTML(HttpServletRequest request,
+  HttpServletResponse response)
+throws IOException, ServletException
 {
 ResourceBundle rb = 
ResourceBundle.getBundle("LocalStrings",request.getLocale());
 
@@ -97,6 +143,35 @@ public class RequestHeaderExample extends HttpServlet {
 out.println("");
 }
 
+protected void renderJSON(HttpServletRequest request, HttpServletResponse 
response)
+throws IOException, ServletException
+{
+response.setContentType("application/json");
+response.setCharacterEncoding("UTF-8");
+
+PrintWriter out = response.getWriter();
+
+out.append('[');
+Enumeration e = request.getHeaderNames();
+while (e.hasMoreElements()) {
+String headerName = e.nextElement();
+String headerValue = request.getHeader(headerName);
+
+out.append("{\"")
+.append(JSONFilter.escape(headerName))
+.append("\":\"")
+.append(JSONFilter.escape(headerValue))
+.append("\"}")
+;
+
+if(e.hasMoreElements()) {
+out.append(',');
+}
+}
+
+out.print("]");
+}
+
 @Override
 public void doPost(HttpServletRequest request,
   HttpServletResponse response)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: 

(tomcat) branch 9.0.x updated: Add support for JSON responses to request header example.

2024-02-12 Thread schultz
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 2b6287521b Add support for JSON responses to request header example.
2b6287521b is described below

commit 2b6287521bac2eab66a0b21bf0250a3d8facb407
Author: Christopher Schultz 
AuthorDate: Mon Feb 12 15:18:22 2024 -0500

Add support for JSON responses to request header example.
---
 webapps/docs/changelog.xml |  8 +++
 .../WEB-INF/classes/RequestHeaderExample.java  | 77 +-
 2 files changed, 84 insertions(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index bd7d48f99a..0aa6868e70 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -197,6 +197,14 @@
   
 
   
+  
+
+  
+Add support for responses in JSON format from the examples application
+RequestHeaderExample. (schultz)
+  
+
+  
   
 
   
diff --git a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java 
b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
index a80076c697..0cff06402f 100644
--- a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
+++ b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
@@ -27,6 +27,8 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import org.apache.tomcat.util.json.JSONFilter;
+
 import util.CookieFilter;
 import util.HTMLFilter;
 
@@ -35,7 +37,6 @@ import util.HTMLFilter;
  *
  * @author James Duncan Davidson dun...@eng.sun.com>
  */
-
 public class RequestHeaderExample extends HttpServlet {
 
 private static final long serialVersionUID = 1L;
@@ -44,6 +45,51 @@ public class RequestHeaderExample extends HttpServlet {
 public void doGet(HttpServletRequest request,
   HttpServletResponse response)
 throws IOException, ServletException
+{
+if (prefersJSON(request.getHeader("Accept"))) {
+renderJSON(request, response);
+} else {
+renderHTML(request, response);
+}
+}
+
+/**
+ * Returns true if the client appears to prefer a JSON response,
+ * false otherwise.
+ *
+ * Note that this method is not very pedantic and uses only a very lazy
+ * algorithm for checking whether JSON is "preferred".
+ *
+ * @param acceptHeader The value of the HTTP "Accept" header from the 
client.
+ *
+ * @return true if the client appears to prefer a JSON response,
+ *  false otherwise.
+ */
+protected boolean prefersJSON(String acceptHeader) {
+if (null == acceptHeader) {
+return false;
+}
+// mime/type, mime/type;q=n, ...
+
+// Don't bother with the q-factor.
+// This is not expected to be 100% accurate or spec-compliant
+String[] accepts = acceptHeader.split(",");
+for (String accept : accepts) {
+if (accept.contains("application/json")) {
+return true;
+}
+
+// text/html, application/html, etc.
+if (accept.contains("html")) {
+return false;
+}
+}
+return false;
+}
+
+protected void renderHTML(HttpServletRequest request,
+  HttpServletResponse response)
+throws IOException, ServletException
 {
 ResourceBundle rb = 
ResourceBundle.getBundle("LocalStrings",request.getLocale());
 
@@ -97,6 +143,35 @@ public class RequestHeaderExample extends HttpServlet {
 out.println("");
 }
 
+protected void renderJSON(HttpServletRequest request, HttpServletResponse 
response)
+throws IOException, ServletException
+{
+response.setContentType("application/json");
+response.setCharacterEncoding("UTF-8");
+
+PrintWriter out = response.getWriter();
+
+out.append('[');
+Enumeration e = request.getHeaderNames();
+while (e.hasMoreElements()) {
+String headerName = e.nextElement();
+String headerValue = request.getHeader(headerName);
+
+out.append("{\"")
+.append(JSONFilter.escape(headerName))
+.append("\":\"")
+.append(JSONFilter.escape(headerValue))
+.append("\"}")
+;
+
+if(e.hasMoreElements()) {
+out.append(',');
+}
+}
+
+out.print("]");
+}
+
 @Override
 public void doPost(HttpServletRequest request,
   HttpServletResponse response)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: 

(tomcat) branch 10.1.x updated: Add support for JSON responses to request header example.

2024-02-12 Thread schultz
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 0ba6e6d236 Add support for JSON responses to request header example.
0ba6e6d236 is described below

commit 0ba6e6d2362f731a5bc7bc813de1cac37914525a
Author: Christopher Schultz 
AuthorDate: Mon Feb 12 15:18:22 2024 -0500

Add support for JSON responses to request header example.
---
 webapps/docs/changelog.xml |  8 +++
 .../WEB-INF/classes/RequestHeaderExample.java  | 77 +-
 2 files changed, 84 insertions(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index cfb66cdf99..10faaf173f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -197,6 +197,14 @@
   
 
   
+  
+
+  
+Add support for responses in JSON format from the examples application
+RequestHeaderExample. (schultz)
+  
+
+  
   
 
   
diff --git a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java 
b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
index 180525dd14..451a7a1ad1 100644
--- a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
+++ b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
@@ -27,6 +27,8 @@ import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.servlet.http.HttpSession;
 
+import org.apache.tomcat.util.json.JSONFilter;
+
 import util.CookieFilter;
 import util.HTMLFilter;
 
@@ -35,7 +37,6 @@ import util.HTMLFilter;
  *
  * @author James Duncan Davidson dun...@eng.sun.com>
  */
-
 public class RequestHeaderExample extends HttpServlet {
 
 private static final long serialVersionUID = 1L;
@@ -44,6 +45,51 @@ public class RequestHeaderExample extends HttpServlet {
 public void doGet(HttpServletRequest request,
   HttpServletResponse response)
 throws IOException, ServletException
+{
+if (prefersJSON(request.getHeader("Accept"))) {
+renderJSON(request, response);
+} else {
+renderHTML(request, response);
+}
+}
+
+/**
+ * Returns true if the client appears to prefer a JSON response,
+ * false otherwise.
+ *
+ * Note that this method is not very pedantic and uses only a very lazy
+ * algorithm for checking whether JSON is "preferred".
+ *
+ * @param acceptHeader The value of the HTTP "Accept" header from the 
client.
+ *
+ * @return true if the client appears to prefer a JSON response,
+ *  false otherwise.
+ */
+protected boolean prefersJSON(String acceptHeader) {
+if (null == acceptHeader) {
+return false;
+}
+// mime/type, mime/type;q=n, ...
+
+// Don't bother with the q-factor.
+// This is not expected to be 100% accurate or spec-compliant
+String[] accepts = acceptHeader.split(",");
+for (String accept : accepts) {
+if (accept.contains("application/json")) {
+return true;
+}
+
+// text/html, application/html, etc.
+if (accept.contains("html")) {
+return false;
+}
+}
+return false;
+}
+
+protected void renderHTML(HttpServletRequest request,
+  HttpServletResponse response)
+throws IOException, ServletException
 {
 ResourceBundle rb = 
ResourceBundle.getBundle("LocalStrings",request.getLocale());
 
@@ -97,6 +143,35 @@ public class RequestHeaderExample extends HttpServlet {
 out.println("");
 }
 
+protected void renderJSON(HttpServletRequest request, HttpServletResponse 
response)
+throws IOException, ServletException
+{
+response.setContentType("application/json");
+response.setCharacterEncoding("UTF-8");
+
+PrintWriter out = response.getWriter();
+
+out.append('[');
+Enumeration e = request.getHeaderNames();
+while (e.hasMoreElements()) {
+String headerName = e.nextElement();
+String headerValue = request.getHeader(headerName);
+
+out.append("{\"")
+.append(JSONFilter.escape(headerName))
+.append("\":\"")
+.append(JSONFilter.escape(headerValue))
+.append("\"}")
+;
+
+if(e.hasMoreElements()) {
+out.append(',');
+}
+}
+
+out.print("]");
+}
+
 @Override
 public void doPost(HttpServletRequest request,
   HttpServletResponse response)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: 

[Bug 68558] Redundant calls to ByteChunk.toString()

2024-02-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68558

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

--- Comment #5 from Mark Thomas  ---
Simple things fixed in:
- 11.0.x for 11.0.0-M17 onwards
- 10.1.x for 10.1.19 onwards
-  9.0.x for  9.0.86 onwards
-  8.5.x for  8.5.99 onwards

Switching to NEEDINFO for the remaining issues.

-- 
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: Partial fix for BZ-68558. Improve performance by caching byte[]->String

2024-02-12 Thread markt
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 5ac96bf47b Partial fix for BZ-68558. Improve performance by caching 
byte[]->String
5ac96bf47b is described below

commit 5ac96bf47bafe20f59f6c4e22fd39ff35f1f466a
Author: Mark Thomas 
AuthorDate: Mon Feb 12 20:30:35 2024 +

Partial fix for BZ-68558. Improve performance by caching byte[]->String

https://bz.apache.org/bugzilla/show_bug.cgi?id=68558
---
 java/org/apache/catalina/connector/Request.java   | 2 +-
 java/org/apache/coyote/Request.java   | 2 +-
 java/org/apache/tomcat/util/http/MimeHeaders.java | 2 +-
 webapps/docs/changelog.xml| 6 ++
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 2f799d62c1..e429bd00cf 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -2381,7 +2381,7 @@ public class Request implements HttpServletRequest {
  */
 @Override
 public String getRequestURI() {
-return coyoteRequest.requestURI().toString();
+return coyoteRequest.requestURI().toStringType();
 }
 
 
diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index f5b1c12960..e6f1ea8ce2 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -442,7 +442,7 @@ public final class Request {
 if (contentTypeMB == null || contentTypeMB.isNull()) {
 return null;
 }
-return contentTypeMB.toString();
+return contentTypeMB.toStringType();
 }
 
 
diff --git a/java/org/apache/tomcat/util/http/MimeHeaders.java 
b/java/org/apache/tomcat/util/http/MimeHeaders.java
index dbe0cee272..fd4394c882 100644
--- a/java/org/apache/tomcat/util/http/MimeHeaders.java
+++ b/java/org/apache/tomcat/util/http/MimeHeaders.java
@@ -418,7 +418,7 @@ class NamesEnumerator implements Enumeration {
 private void findNext() {
 next = null;
 for (; pos < size; pos++) {
-next = headers.getName(pos).toString();
+next = headers.getName(pos).toStringType();
 for (int j = 0; j < pos; j++) {
 if (headers.getName(j).equalsIgnoreCase(next)) {
 // duplicate.
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index b92d0b824e..bd7d48f99a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -165,6 +165,12 @@
 Improve the Tomcat Native shutdown process to reduce the likelihood of 
a
 JVM crash during Tomcat shutdown. (markt)
   
+  
+Partial fix for 68558: Cache the result of converting to
+String for request URI, HTTP header names and the request
+Content-Type value to improve performance by reducing
+repeated byte[] to String conversions. 
(markt)
+  
 
   
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 8.5.x updated: Partial fix for BZ-68558. Improve performance by caching byte[]->String

2024-02-12 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 185506 Partial fix for BZ-68558. Improve performance by caching 
byte[]->String
185506 is described below

commit 1855062a97a43cccdba38648254d43158549
Author: Mark Thomas 
AuthorDate: Mon Feb 12 20:30:35 2024 +

Partial fix for BZ-68558. Improve performance by caching byte[]->String

https://bz.apache.org/bugzilla/show_bug.cgi?id=68558
---
 java/org/apache/catalina/connector/Request.java   | 2 +-
 java/org/apache/coyote/Request.java   | 2 +-
 java/org/apache/tomcat/util/http/MimeHeaders.java | 2 +-
 webapps/docs/changelog.xml| 6 ++
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 4955e49fa7..2103b93226 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -2372,7 +2372,7 @@ public class Request implements HttpServletRequest {
  */
 @Override
 public String getRequestURI() {
-return coyoteRequest.requestURI().toString();
+return coyoteRequest.requestURI().toStringType();
 }
 
 
diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index 201d8e54d8..9f4ef030fa 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -443,7 +443,7 @@ public final class Request {
 if (contentTypeMB == null || contentTypeMB.isNull()) {
 return null;
 }
-return contentTypeMB.toString();
+return contentTypeMB.toStringType();
 }
 
 
diff --git a/java/org/apache/tomcat/util/http/MimeHeaders.java 
b/java/org/apache/tomcat/util/http/MimeHeaders.java
index dbe0cee272..fd4394c882 100644
--- a/java/org/apache/tomcat/util/http/MimeHeaders.java
+++ b/java/org/apache/tomcat/util/http/MimeHeaders.java
@@ -418,7 +418,7 @@ class NamesEnumerator implements Enumeration {
 private void findNext() {
 next = null;
 for (; pos < size; pos++) {
-next = headers.getName(pos).toString();
+next = headers.getName(pos).toStringType();
 for (int j = 0; j < pos; j++) {
 if (headers.getName(j).equalsIgnoreCase(next)) {
 // duplicate.
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index a5a63eadef..5900a72199 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -159,6 +159,12 @@
 Improve the Tomcat Native shutdown process to reduce the likelihood of 
a
 JVM crash during Tomcat shutdown. (markt)
   
+  
+Partial fix for 68558: Cache the result of converting to
+String for request URI, HTTP header names and the request
+Content-Type value to improve performance by reducing
+repeated byte[] to String conversions. 
(markt)
+  
 
   
   


-
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: Partial fix for BZ-68558. Improve performance by caching byte[]->String

2024-02-12 Thread markt
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 89af83580c Partial fix for BZ-68558. Improve performance by caching 
byte[]->String
89af83580c is described below

commit 89af83580c103d15fa828bc4047223c4664ea3a1
Author: Mark Thomas 
AuthorDate: Mon Feb 12 20:30:35 2024 +

Partial fix for BZ-68558. Improve performance by caching byte[]->String

https://bz.apache.org/bugzilla/show_bug.cgi?id=68558
---
 java/org/apache/catalina/connector/Request.java   | 2 +-
 java/org/apache/coyote/Request.java   | 2 +-
 java/org/apache/tomcat/util/http/MimeHeaders.java | 2 +-
 webapps/docs/changelog.xml| 6 ++
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 935a38d932..a013f88bca 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -2343,7 +2343,7 @@ public class Request implements HttpServletRequest {
  */
 @Override
 public String getRequestURI() {
-return coyoteRequest.requestURI().toString();
+return coyoteRequest.requestURI().toStringType();
 }
 
 
diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index e148e4e244..5059b875b4 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -458,7 +458,7 @@ public final class Request {
 if (contentTypeMB == null || contentTypeMB.isNull()) {
 return null;
 }
-return contentTypeMB.toString();
+return contentTypeMB.toStringType();
 }
 
 
diff --git a/java/org/apache/tomcat/util/http/MimeHeaders.java 
b/java/org/apache/tomcat/util/http/MimeHeaders.java
index dbe0cee272..fd4394c882 100644
--- a/java/org/apache/tomcat/util/http/MimeHeaders.java
+++ b/java/org/apache/tomcat/util/http/MimeHeaders.java
@@ -418,7 +418,7 @@ class NamesEnumerator implements Enumeration {
 private void findNext() {
 next = null;
 for (; pos < size; pos++) {
-next = headers.getName(pos).toString();
+next = headers.getName(pos).toStringType();
 for (int j = 0; j < pos; j++) {
 if (headers.getName(j).equalsIgnoreCase(next)) {
 // duplicate.
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2a9316ad75..cfb66cdf99 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -165,6 +165,12 @@
 configured on SSLHostConfigCertificate instances. Based on
 pull request 673 provided by Hakan Altındağ. (markt)
   
+  
+Partial fix for 68558: Cache the result of converting to
+String for request URI, HTTP header names and the request
+Content-Type value to improve performance by reducing
+repeated byte[] to String conversions. 
(markt)
+  
 
   
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch main updated: Partial fix for BZ-68558. Improve performance by caching byte[]->String

2024-02-12 Thread markt
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 983975085d Partial fix for BZ-68558. Improve performance by caching 
byte[]->String
983975085d is described below

commit 983975085def5144ca5db9b695b822d787ded51e
Author: Mark Thomas 
AuthorDate: Mon Feb 12 20:30:35 2024 +

Partial fix for BZ-68558. Improve performance by caching byte[]->String

https://bz.apache.org/bugzilla/show_bug.cgi?id=68558
---
 java/org/apache/catalina/connector/Request.java   | 2 +-
 java/org/apache/coyote/Request.java   | 2 +-
 java/org/apache/tomcat/util/http/MimeHeaders.java | 2 +-
 webapps/docs/changelog.xml| 6 ++
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 508b279edf..d78887ce3a 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -2250,7 +2250,7 @@ public class Request implements HttpServletRequest {
  */
 @Override
 public String getRequestURI() {
-return coyoteRequest.requestURI().toString();
+return coyoteRequest.requestURI().toStringType();
 }
 
 
diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index 2cbf500b46..6d2ab8b640 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -479,7 +479,7 @@ public final class Request {
 if (contentTypeMB == null || contentTypeMB.isNull()) {
 return null;
 }
-return contentTypeMB.toString();
+return contentTypeMB.toStringType();
 }
 
 
diff --git a/java/org/apache/tomcat/util/http/MimeHeaders.java 
b/java/org/apache/tomcat/util/http/MimeHeaders.java
index 1106be7ad6..065a19a223 100644
--- a/java/org/apache/tomcat/util/http/MimeHeaders.java
+++ b/java/org/apache/tomcat/util/http/MimeHeaders.java
@@ -413,7 +413,7 @@ class NamesEnumerator implements Enumeration {
 private void findNext() {
 next = null;
 for (; pos < size; pos++) {
-next = headers.getName(pos).toString();
+next = headers.getName(pos).toStringType();
 for (int j = 0; j < pos; j++) {
 if (headers.getName(j).equalsIgnoreCase(next)) {
 // duplicate.
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e4ddfbd30c..446d2d7ea9 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -176,6 +176,12 @@
 configured on SSLHostConfigCertificate instances. Based on
 pull request 673 provided by Hakan Altındağ. (markt)
   
+  
+Partial fix for 68558: Cache the result of converting to
+String for request URI, HTTP header names and the request
+Content-Type value to improve performance by reducing
+repeated byte[] to String conversions. 
(markt)
+  
 
   
   


-
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 JSON responses to request header example.

2024-02-12 Thread schultz
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 861b593d7b Add support for JSON responses to request header example.
861b593d7b is described below

commit 861b593d7b2a236fbdf9c8a9fe6ef1c8edc39a38
Author: Christopher Schultz 
AuthorDate: Mon Feb 12 15:18:22 2024 -0500

Add support for JSON responses to request header example.
---
 webapps/docs/changelog.xml |  8 +++
 .../WEB-INF/classes/RequestHeaderExample.java  | 77 +-
 2 files changed, 84 insertions(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 1d8f6317a8..e4ddfbd30c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -206,6 +206,14 @@
   
 
   
+  
+
+  
+Add support for responses in JSON format from the examples application
+RequestHeaderExample. (schultz)
+  
+
+  
   
 
   
diff --git a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java 
b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
index 180525dd14..451a7a1ad1 100644
--- a/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
+++ b/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
@@ -27,6 +27,8 @@ import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.servlet.http.HttpSession;
 
+import org.apache.tomcat.util.json.JSONFilter;
+
 import util.CookieFilter;
 import util.HTMLFilter;
 
@@ -35,7 +37,6 @@ import util.HTMLFilter;
  *
  * @author James Duncan Davidson dun...@eng.sun.com>
  */
-
 public class RequestHeaderExample extends HttpServlet {
 
 private static final long serialVersionUID = 1L;
@@ -44,6 +45,51 @@ public class RequestHeaderExample extends HttpServlet {
 public void doGet(HttpServletRequest request,
   HttpServletResponse response)
 throws IOException, ServletException
+{
+if (prefersJSON(request.getHeader("Accept"))) {
+renderJSON(request, response);
+} else {
+renderHTML(request, response);
+}
+}
+
+/**
+ * Returns true if the client appears to prefer a JSON response,
+ * false otherwise.
+ *
+ * Note that this method is not very pedantic and uses only a very lazy
+ * algorithm for checking whether JSON is "preferred".
+ *
+ * @param acceptHeader The value of the HTTP "Accept" header from the 
client.
+ *
+ * @return true if the client appears to prefer a JSON response,
+ *  false otherwise.
+ */
+protected boolean prefersJSON(String acceptHeader) {
+if (null == acceptHeader) {
+return false;
+}
+// mime/type, mime/type;q=n, ...
+
+// Don't bother with the q-factor.
+// This is not expected to be 100% accurate or spec-compliant
+String[] accepts = acceptHeader.split(",");
+for (String accept : accepts) {
+if (accept.contains("application/json")) {
+return true;
+}
+
+// text/html, application/html, etc.
+if (accept.contains("html")) {
+return false;
+}
+}
+return false;
+}
+
+protected void renderHTML(HttpServletRequest request,
+  HttpServletResponse response)
+throws IOException, ServletException
 {
 ResourceBundle rb = 
ResourceBundle.getBundle("LocalStrings",request.getLocale());
 
@@ -97,6 +143,35 @@ public class RequestHeaderExample extends HttpServlet {
 out.println("");
 }
 
+protected void renderJSON(HttpServletRequest request, HttpServletResponse 
response)
+throws IOException, ServletException
+{
+response.setContentType("application/json");
+response.setCharacterEncoding("UTF-8");
+
+PrintWriter out = response.getWriter();
+
+out.append('[');
+Enumeration e = request.getHeaderNames();
+while (e.hasMoreElements()) {
+String headerName = e.nextElement();
+String headerValue = request.getHeader(headerName);
+
+out.append("{\"")
+.append(JSONFilter.escape(headerName))
+.append("\":\"")
+.append(JSONFilter.escape(headerValue))
+.append("\"}")
+;
+
+if(e.hasMoreElements()) {
+out.append(',');
+}
+}
+
+out.print("]");
+}
+
 @Override
 public void doPost(HttpServletRequest request,
   HttpServletResponse response)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: 

[Bug 68558] Redundant calls to ByteChunk.toString()

2024-02-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68558

--- Comment #4 from Mark Thomas  ---
A quick update:

1.
getMethod() is already effectively cached due to use of
MessageBytes.toStringType()

getQueryString() could be cached but there is a potential performance issue. If
applications parse the query string manually or use getParameter() and friends
all is well. If an application uses both, using MessageBytes.toStringType()
could trigger bytes -> String -> bytes if getQueryString() is called before
getParameter() and friends. I'm minded to leave this one alone for now.

requestURI(), contentType() and headerNames can all switch to
MessageBytes.toStringType(). I'll do that shortly.

2. Waiting for examples.

3. Cannot reproduce. I've reviewed the code and manually debugged an included
JSP. The original query string is parsed once and the additional query string
is parsed once.

-- 
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



Buildbot success in on tomcat-9.0.x

2024-02-12 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/37/builds/855
Blamelist: Mark Thomas , remm 
Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch 9.0.x] afe0375210597e208747befcea80b72ed317d101


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: 1

  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



Re: Test stability and tagging delayed

2024-02-12 Thread Mark Thomas

On 12/02/2024 15:14, Christopher Schultz wrote:

Mark,

On 2/9/24 08:30, Mark Thomas wrote:

On 09/02/2024 12:14, Rémy Maucherat wrote:

On Fri, Feb 9, 2024 at 12:46 PM Mark Thomas  wrote:

On 08/02/2024 17:07, Mark Thomas wrote:





Back to working out a more robust fix...


While the fix worked well locally, it hasn't fixed the problem on the
Buildbot CI worker.

I'm going to take another look.


I had a look at the test output, and the issue is exclusively with the
APR connector (the tests are a bit weird so that the APR connector is
also run, basically the test is the same for all connectors), that's
why it would only affect 8.5 and 9.0. Overall it's not even certain
OpenSSL + NIO really needed a fix and the OpenSSLContext cleanup is
most likely good enough (at least in that case). Build 845 for 9.0.x
was crashing when using the APR connector, not NIO.


I am making progress. I have a slightly amended theory as to what is 
going on (and now confirmed via logging).


The clean-up of OpenSSLContext is performed by the finalizer.
In the problematic tests, the Native library is repeatedly loaded and 
unloaded within a single JVM.
The crashes happen when the finalizer attempts to clean an 
OpenSSLContext instance from a previous load of the native library 
after the native library has been reloaded.


I have a fix for this.

I intend to:
- revert (most of) the changes made to 8.5.x through 11.0.x
- apply the new fix to 9.0.x and 8.5.x only

Apologies for the noise while I tracked the root cause of this down. 
The good news is that this should address one of the causes of unit 
test instability.


Apologies for the noise while I caught up to today's messages on this 
topic. You can obviously ignore all my critiques thus far.


Since this appears mostly to be due to the unit-testing environment, 
should we simply create a system property that suppresses the shutdown 
of the native library during unit-tests and let it stay configured the 
whole time? Or do we actually need to de-configure and re-configure it 
during the unit-test run?


I think it is useful in that it has been highlighting an issue with 
APR/native that we have needed to address for a while. In production, it 
typically happens on shutdown so isn't too big an issue - hence why it 
wasn't addressed.


Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: (tomcat) 02/02: Reduce changes of crash on Library shutdown with OpenSSL connections

2024-02-12 Thread Rémy Maucherat
On Mon, Feb 12, 2024 at 4:05 PM Christopher Schultz
 wrote:
>
> Mark,
>
> On 2/8/24 16:10, ma...@apache.org wrote:
> > 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 543e2b56bc8ccbde973366975b211b61408caf8a
> > Author: Mark Thomas 
> > AuthorDate: Thu Feb 8 18:54:45 2024 +
> >
> >  Reduce changes of crash on Library shutdown with OpenSSL connections
> > ---
> >   .../tomcat/util/net/openssl/OpenSSLContext.java   | 19 
> > +++
> >   1 file changed, 11 insertions(+), 8 deletions(-)
> >
> > diff --git a/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java 
> > b/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java
> > index f1d7b092ec..12dc41455b 100644
> > --- a/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java
> > +++ b/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java
> > @@ -46,6 +46,7 @@ import javax.net.ssl.X509TrustManager;
> >   import org.apache.juli.logging.Log;
> >   import org.apache.juli.logging.LogFactory;
> >   import org.apache.tomcat.jni.CertificateVerifier;
> > +import org.apache.tomcat.jni.Library;
> >   import org.apache.tomcat.jni.Pool;
> >   import org.apache.tomcat.jni.SSL;
> >   import org.apache.tomcat.jni.SSLConf;
> > @@ -648,14 +649,16 @@ public class OpenSSLContext implements 
> > org.apache.tomcat.util.net.SSLContext {
> >
> >   @Override
> >   public void run() {
> > -if (ctx != 0) {
> > -SSLContext.free(ctx);
> > -}
> > -if (cctx != 0) {
> > -SSLConf.free(cctx);
> > -}
> > -if (aprPool != 0) {
> > -Pool.destroy(aprPool);
> > +if (Library.isInitialized()) {
> > +if (ctx != 0) {
> > +SSLContext.free(ctx);
> > +}
> > +if (cctx != 0) {
> > +SSLConf.free(cctx);
> > +}
> > +if (aprPool != 0) {
> > +Pool.destroy(aprPool);
> > +}
>
> Should this be in a synchronized block? Probably using Library as the
> monitor?
>
> Also, maybe zero everything out afterward?
>
> Honestly, this looks weird to my (untrained) eye. You are checking the
> state of Library to determine whether or not local resources ought to be
> cleaned up? That smells funny to me...

The crashes in CI were caused by
https://github.com/apache/tomcat/commit/6ce18dc93a054949e529952e809b159040b1d158
and weird interactions with the APR connector. The fix for the CI
crashes is: 
https://github.com/apache/tomcat/commit/4cc023ff17f874ac653d6731106dd4b062686d15
Beyond that, if the plan is to make all of this really much safer,
then FFM is really a big step in that direction.

Rémy

> -chris
>
> -
> 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



Re: Test stability and tagging delayed

2024-02-12 Thread Christopher Schultz

Mark,

On 2/9/24 08:30, Mark Thomas wrote:

On 09/02/2024 12:14, Rémy Maucherat wrote:

On Fri, Feb 9, 2024 at 12:46 PM Mark Thomas  wrote:

On 08/02/2024 17:07, Mark Thomas wrote:





Back to working out a more robust fix...


While the fix worked well locally, it hasn't fixed the problem on the
Buildbot CI worker.

I'm going to take another look.


I had a look at the test output, and the issue is exclusively with the
APR connector (the tests are a bit weird so that the APR connector is
also run, basically the test is the same for all connectors), that's
why it would only affect 8.5 and 9.0. Overall it's not even certain
OpenSSL + NIO really needed a fix and the OpenSSLContext cleanup is
most likely good enough (at least in that case). Build 845 for 9.0.x
was crashing when using the APR connector, not NIO.


I am making progress. I have a slightly amended theory as to what is 
going on (and now confirmed via logging).


The clean-up of OpenSSLContext is performed by the finalizer.
In the problematic tests, the Native library is repeatedly loaded and 
unloaded within a single JVM.
The crashes happen when the finalizer attempts to clean an 
OpenSSLContext instance from a previous load of the native library after 
the native library has been reloaded.


I have a fix for this.

I intend to:
- revert (most of) the changes made to 8.5.x through 11.0.x
- apply the new fix to 9.0.x and 8.5.x only

Apologies for the noise while I tracked the root cause of this down. The 
good news is that this should address one of the causes of unit test 
instability.


Apologies for the noise while I caught up to today's messages on this 
topic. You can obviously ignore all my critiques thus far.


Since this appears mostly to be due to the unit-testing environment, 
should we simply create a system property that suppresses the shutdown 
of the native library during unit-tests and let it stay configured the 
whole time? Or do we actually need to de-configure and re-configure it 
during the unit-test run?


-chris

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: (tomcat) 05/05: Need for force GC to avoid duplicate clean-up (which triggers a crash)

2024-02-12 Thread Christopher Schultz

Mark,

On 2/8/24 16:18, ma...@apache.org wrote:

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 967be0a2d5bb90a5f962359e80fe3e6a78b1ea51
Author: Mark Thomas 
AuthorDate: Thu Feb 8 21:17:24 2024 +

 Need for force GC to avoid duplicate clean-up (which triggers a crash)
---
  java/org/apache/catalina/core/AprLifecycleListener.java | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/java/org/apache/catalina/core/AprLifecycleListener.java 
b/java/org/apache/catalina/core/AprLifecycleListener.java
index da2c0e3862..974af71ba2 100644
--- a/java/org/apache/catalina/core/AprLifecycleListener.java
+++ b/java/org/apache/catalina/core/AprLifecycleListener.java
@@ -170,6 +170,8 @@ public class AprLifecycleListener implements 
LifecycleListener {
  
  private static void terminateAPR() {

  Library.terminatePrepare();
+// Need to force GC here as some components do APR clean-up in 
finalize()
+System.gc();
  AprStatus.setAprInitialized(false);
  AprStatus.setAprAvailable(false);
  fipsModeActive = false;


I'm sure you we thinking "eew gross" when you wrote this.

Is there no other way to do this with volatile flags and 
intentional-cleanup rather than ugly finalizer-based cleanup?


-chris

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 68558] Redundant calls to ByteChunk.toString()

2024-02-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68558

--- Comment #3 from Mark Thomas  ---
Thanks for the additional info. I'll try and address each part in turn.

1. Caching the key fields is low cost as it is just a reference to an existing
String. I think that is a better solution that trying to cache in
MessageBytes/ByteChunk/CharChunk due to the cache invalidation complexities. I
think we can do this quickly.

2. Could you provide examples. If there is any low-hanging fruit similar to1
that should be easy to address.

3. Ah. Got it. That is going to be a little trickier to address. I suspect some
refactoring will be required as we have to take account of the parameter
merging  rules. Not sure how easy that will be.

My plan at this stage is to address the low hanging fruit and then switch this
to an enhancement (strictly this is all an enhancement) for the parameter
refactoring.

-- 
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: (tomcat) 02/02: Reduce changes of crash on Library shutdown with OpenSSL connections

2024-02-12 Thread Christopher Schultz

Mark,

On 2/8/24 16:10, ma...@apache.org wrote:

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 543e2b56bc8ccbde973366975b211b61408caf8a
Author: Mark Thomas 
AuthorDate: Thu Feb 8 18:54:45 2024 +

 Reduce changes of crash on Library shutdown with OpenSSL connections
---
  .../tomcat/util/net/openssl/OpenSSLContext.java   | 19 +++
  1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java 
b/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java
index f1d7b092ec..12dc41455b 100644
--- a/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java
+++ b/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java
@@ -46,6 +46,7 @@ import javax.net.ssl.X509TrustManager;
  import org.apache.juli.logging.Log;
  import org.apache.juli.logging.LogFactory;
  import org.apache.tomcat.jni.CertificateVerifier;
+import org.apache.tomcat.jni.Library;
  import org.apache.tomcat.jni.Pool;
  import org.apache.tomcat.jni.SSL;
  import org.apache.tomcat.jni.SSLConf;
@@ -648,14 +649,16 @@ public class OpenSSLContext implements 
org.apache.tomcat.util.net.SSLContext {
  
  @Override

  public void run() {
-if (ctx != 0) {
-SSLContext.free(ctx);
-}
-if (cctx != 0) {
-SSLConf.free(cctx);
-}
-if (aprPool != 0) {
-Pool.destroy(aprPool);
+if (Library.isInitialized()) {
+if (ctx != 0) {
+SSLContext.free(ctx);
+}
+if (cctx != 0) {
+SSLConf.free(cctx);
+}
+if (aprPool != 0) {
+Pool.destroy(aprPool);
+}


Should this be in a synchronized block? Probably using Library as the 
monitor?


Also, maybe zero everything out afterward?

Honestly, this looks weird to my (untrained) eye. You are checking the 
state of Library to determine whether or not local resources ought to be 
cleaned up? That smells funny to me...


-chris

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: (tomcat) 01/02: Re-order so library isn't reported as running after it is terminated

2024-02-12 Thread Christopher Schultz

Mark,

On 2/8/24 16:10, ma...@apache.org wrote:

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 712f6d8a70e0e89d66cba8a7b9cc81c717ecbe7d
Author: Mark Thomas 
AuthorDate: Thu Feb 8 18:54:18 2024 +

 Re-order so library isn't reported as running after it is terminated
---
  java/org/apache/catalina/core/AprLifecycleListener.java | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/core/AprLifecycleListener.java 
b/java/org/apache/catalina/core/AprLifecycleListener.java
index 4ed37531fa..8fea80148e 100644
--- a/java/org/apache/catalina/core/AprLifecycleListener.java
+++ b/java/org/apache/catalina/core/AprLifecycleListener.java
@@ -170,11 +170,11 @@ public class AprLifecycleListener implements 
LifecycleListener {
  
  private static void terminateAPR() {

  Library.terminatePrepare();
-Library.terminate();
-AprStatus.setAprAvailable(false);
  AprStatus.setAprInitialized(false);
-sslInitialized = false; // Well we cleaned the pool in terminate.
+AprStatus.setAprAvailable(false);
  fipsModeActive = false;
+sslInitialized = false; // Well we cleaned the pool in terminate.
+Library.terminate();


Shouldn't we confirm that the library has successfully shut-down before 
setting sslInitialized = false?


-chris

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 68089] ApplicationHttpRequest.getSpecial() and removeSpecial() use linear scans

2024-02-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68089

--- Comment #12 from John Engebretson  ---
String compaction made charAt() more expensive, thanks to checks on format and
range.  String.length() remains an integer check.

That said, charAt() isn't that bad, so it's an option if functionally required.

-- 
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 68603] Request Context path and Query param gets replaced

2024-02-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68603

--- Comment #4 from Christopher Schultz  ---
(In reply to Naresh from comment #2)
> Take for example before login request URI is "/bill/login" with request body
> of "leacsrf=c8b01130-3e28-4f29-b9e6-f9f54f3f2501".

Is this a query string in the URL, or is this the request body?

> Scenario is after authentication the current request URI(/bill/login) is
> changed with "srf=c8b01130-3e28" and the request query param is changed to
> "4f29-b9e6-f9f54f3f2501"

What is consuming the response? Just Tomcat via a call to
request.getParameter*?

-- 
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 68089] ApplicationHttpRequest.getSpecial() and removeSpecial() use linear scans

2024-02-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68089

--- Comment #11 from Christopher Schultz  ---
(In reply to Mark Thomas from comment #9)
> I did look at using !startsWith("jakarta") but that is ~2x slower than a
> length check.
> 
> I've coded up the length check and am just running some tests locally.

What about charAt(0) == 'j'?

I suppose that's the second thing String.equals() will do after checking the
length, so maybe it won't help at all.

-- 
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



Buildbot failure in on tomcat-9.0.x

2024-02-12 Thread buildbot
Build status: BUILD FAILED: failed compile (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/37/builds/854
Blamelist: remm 
Build Text: failed compile (failure)
Status Detected: new failure
Build Source Stamp: [branch 9.0.x] 6c76c62957281057d19a7b708bf9ef6065fe3b3c


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



Re: Moving to Tomcat Native 1.3.x

2024-02-12 Thread Christopher Schultz

Michael,

On 2/7/24 14:14, Michael Osipov wrote:

On 2024/02/07 18:19:24 Christopher Schultz wrote:

Michael,

On 2/7/24 11:05, Michael Osipov wrote:

On 2024/02/04 19:54:25 Mark Thomas wrote:

Hi all,

AS you have probably noticed I am working on another round of Tomcat
Native releases.

We are overdue on switching to 1.3.x so I would like to propose the
following with this release round:

- create a new 1.3.x branch from the current 1.2.x HEAD
- update minimum OpenSSL to 1.1.1
- update minimum APR to 1.6.3
- remove code supporting OpenSSL < 1.1.1

The next 8.5.x and 9.0.x releases would then ship with Tomcat Native
1.3.0 but minimum required/recommended Tomcat Native versions would not
change.


I have just tested Tomcat 9.0.x from Git repo against:
FreeBSD 13-STABLE:
OpenSSL 1.1.1w-freebsd  11 Sep 2023
Tomcat Native library [1.3.1-dev] using APR version [1.7.3]


HP-UX 11.31:
OpenSSL 1.1.1w  11 Sep 2023
Tomcat Native library [1.3.1-dev] using APR version [1.7.4]

I will try with OpenSSL 3.0.x soon. It is very unfortunate that 9.0.x requires 
Java 17 to build, it is not available on HP-UX and will never be by HPE. I had 
to downgrade BND to 6.4.0 to make it run. I still consider this a wrong move 
for at least Tomcat 9.0.x, Java 11 should have stayed the minimum.


I think it's actually possible to build with Java 11, but the release
builds require Java 17 for  #reasons.

Try just hacking the build files to allow Java 11 and see if you can build.


It does work:
diff --git a/build.properties.default b/build.properties.default
index 2ec1dbfb16..82aec7debb 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -307 +307 @@ 
spotbugs.loc=${base-maven.loc}/com/github/spotbugs/spotbugs/${spotbugs.version}/
-bnd.version=7.0.0
+bnd.version=6.4.0
diff --git a/build.xml b/build.xml
index 94e80620e2..83852a889f 100644
--- a/build.xml
+++ b/build.xml
@@ -110 +110 @@
-  
+  


I will do some thinking about maybe only enforcing Java 17 for 
release-builds and not "normal" builds.


-chris

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 02/02: Fix back-port (no lambda with Java 7)

2024-02-12 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 69b92c479c7e0e079329caf71f63df131b0829e1
Author: Mark Thomas 
AuthorDate: Mon Feb 12 14:24:02 2024 +

Fix back-port (no lambda with Java 7)
---
 java/org/apache/catalina/core/ApplicationHttpRequest.java |  9 ++---
 java/org/apache/catalina/core/ApplicationRequest.java | 12 ++--
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/core/ApplicationHttpRequest.java 
b/java/org/apache/catalina/core/ApplicationHttpRequest.java
index 8142a3bd05..cc18bdb925 100644
--- a/java/org/apache/catalina/core/ApplicationHttpRequest.java
+++ b/java/org/apache/catalina/core/ApplicationHttpRequest.java
@@ -83,15 +83,18 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
  * It may be possible to remove specials but that will require changes to 
AttributeNamesEnumerator.
  */
 private static final Map specialsMap = new HashMap<>();
+private static final int shortestSpecialNameLength;
 static {
+int minLength = Integer.MAX_VALUE;
 for (int i = 0; i < specials.length; i++) {
 specialsMap.put(specials[i], Integer.valueOf(i));
+if (specials[i].length() < minLength) {
+minLength = specials[i].length();
+}
 }
+shortestSpecialNameLength = minLength;
 }
 
-private static final int shortestSpecialNameLength =
-specialsMap.keySet().stream().mapToInt(s -> 
s.length()).min().getAsInt();
-
 
 private static final int SPECIALS_FIRST_FORWARD_INDEX = 6;
 
diff --git a/java/org/apache/catalina/core/ApplicationRequest.java 
b/java/org/apache/catalina/core/ApplicationRequest.java
index 5828045816..e5ec6729af 100644
--- a/java/org/apache/catalina/core/ApplicationRequest.java
+++ b/java/org/apache/catalina/core/ApplicationRequest.java
@@ -59,8 +59,16 @@ class ApplicationRequest extends ServletRequestWrapper {
  */
 private static final Set specialsSet = new 
HashSet<>(Arrays.asList(specials));
 
-private static final int shortestSpecialNameLength =
-specialsSet.stream().mapToInt(s -> s.length()).min().getAsInt();
+private static final int shortestSpecialNameLength;
+static {
+int minLength = Integer.MAX_VALUE;
+for (String special : specialsSet) {
+if (special.length() < minLength) {
+minLength = special.length();
+}
+}
+shortestSpecialNameLength = minLength;
+}
 
 
 /**


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 8.5.x updated (a329e8b4a9 -> 69b92c479c)

2024-02-12 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


from a329e8b4a9 Further performance improvements for BZ 68089
 new 72d13c612d Fix IDE warnings
 new 69b92c479c Fix back-port (no lambda with Java 7)

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/ApplicationHttpRequest.java |  9 ++---
 java/org/apache/catalina/core/ApplicationRequest.java | 12 ++--
 java/org/apache/catalina/session/StandardManager.java |  2 +-
 java/org/apache/coyote/ajp/AjpProcessor.java  |  2 +-
 java/org/apache/jasper/JspC.java  |  2 +-
 5 files changed, 19 insertions(+), 8 deletions(-)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 01/02: Fix IDE warnings

2024-02-12 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 72d13c612dec48f40e200da5445cf1abd3073055
Author: Mark Thomas 
AuthorDate: Mon Feb 12 14:14:53 2024 +

Fix IDE warnings
---
 java/org/apache/catalina/session/StandardManager.java | 2 +-
 java/org/apache/coyote/ajp/AjpProcessor.java  | 2 +-
 java/org/apache/jasper/JspC.java  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/session/StandardManager.java 
b/java/org/apache/catalina/session/StandardManager.java
index 67514fe1d7..aa8da0f33b 100644
--- a/java/org/apache/catalina/session/StandardManager.java
+++ b/java/org/apache/catalina/session/StandardManager.java
@@ -311,7 +311,7 @@ public class StandardManager extends ManagerBase {
 
 // Expire all the sessions we just wrote
 if (log.isDebugEnabled()) {
-log.debug(sm.getString("standardManager.expiringSessions", 
list.size()));
+log.debug(sm.getString("standardManager.expiringSessions", 
Integer.toString(list.size(;
 }
 for (StandardSession session : list) {
 try {
diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java 
b/java/org/apache/coyote/ajp/AjpProcessor.java
index 5c071ef1b9..b9f5056401 100644
--- a/java/org/apache/coyote/ajp/AjpProcessor.java
+++ b/java/org/apache/coyote/ajp/AjpProcessor.java
@@ -490,7 +490,7 @@ public class AjpProcessor extends AbstractProcessor {
 // Unexpected packet type. Unread body packets should have
 // been swallowed in finish().
 if (getLog().isDebugEnabled()) {
-
getLog().debug(sm.getString("ajpprocessor.unexpectedMessage", type));
+
getLog().debug(sm.getString("ajpprocessor.unexpectedMessage", 
Integer.toString(type)));
 }
 setErrorState(ErrorState.CLOSE_CONNECTION_NOW, null);
 break;
diff --git a/java/org/apache/jasper/JspC.java b/java/org/apache/jasper/JspC.java
index 655942d34a..6ce90fa528 100644
--- a/java/org/apache/jasper/JspC.java
+++ b/java/org/apache/jasper/JspC.java
@@ -1358,7 +1358,7 @@ public class JspC extends Task implements Options {
 @Override
 public void execute() {
 if(log.isDebugEnabled()) {
-log.debug(Localizer.getMessage("jspc.start", pages.size()));
+log.debug(Localizer.getMessage("jspc.start", 
Integer.toString(pages.size(;
 }
 
 try {


-
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: Fix IDE warnings

2024-02-12 Thread markt
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 afe0375210 Fix IDE warnings
afe0375210 is described below

commit afe0375210597e208747befcea80b72ed317d101
Author: Mark Thomas 
AuthorDate: Mon Feb 12 14:14:53 2024 +

Fix IDE warnings
---
 java/org/apache/catalina/session/StandardManager.java | 2 +-
 java/org/apache/coyote/ajp/AjpProcessor.java  | 2 +-
 java/org/apache/jasper/JspC.java  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/session/StandardManager.java 
b/java/org/apache/catalina/session/StandardManager.java
index 67514fe1d7..aa8da0f33b 100644
--- a/java/org/apache/catalina/session/StandardManager.java
+++ b/java/org/apache/catalina/session/StandardManager.java
@@ -311,7 +311,7 @@ public class StandardManager extends ManagerBase {
 
 // Expire all the sessions we just wrote
 if (log.isDebugEnabled()) {
-log.debug(sm.getString("standardManager.expiringSessions", 
list.size()));
+log.debug(sm.getString("standardManager.expiringSessions", 
Integer.toString(list.size(;
 }
 for (StandardSession session : list) {
 try {
diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java 
b/java/org/apache/coyote/ajp/AjpProcessor.java
index 5dcadf893f..00cef4709e 100644
--- a/java/org/apache/coyote/ajp/AjpProcessor.java
+++ b/java/org/apache/coyote/ajp/AjpProcessor.java
@@ -379,7 +379,7 @@ public class AjpProcessor extends AbstractProcessor {
 // Unexpected packet type. Unread body packets should have
 // been swallowed in finish().
 if (getLog().isDebugEnabled()) {
-
getLog().debug(sm.getString("ajpprocessor.unexpectedMessage", type));
+
getLog().debug(sm.getString("ajpprocessor.unexpectedMessage", 
Integer.toString(type)));
 }
 setErrorState(ErrorState.CLOSE_CONNECTION_NOW, null);
 break;
diff --git a/java/org/apache/jasper/JspC.java b/java/org/apache/jasper/JspC.java
index 8ef5a4b96c..71f138526a 100644
--- a/java/org/apache/jasper/JspC.java
+++ b/java/org/apache/jasper/JspC.java
@@ -1398,7 +1398,7 @@ public class JspC extends Task implements Options {
 @Override
 public void execute() {
 if(log.isDebugEnabled()) {
-log.debug(Localizer.getMessage("jspc.start", pages.size()));
+log.debug(Localizer.getMessage("jspc.start", 
Integer.toString(pages.size(;
 }
 
 try {


-
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: Fix IDE warnings

2024-02-12 Thread markt
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 6e57860a66 Fix IDE warnings
6e57860a66 is described below

commit 6e57860a66845d8cab0286546fff9faa79ddd2fd
Author: Mark Thomas 
AuthorDate: Mon Feb 12 14:14:53 2024 +

Fix IDE warnings
---
 java/org/apache/catalina/session/StandardManager.java | 2 +-
 java/org/apache/coyote/ajp/AjpProcessor.java  | 2 +-
 java/org/apache/jasper/JspC.java  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/session/StandardManager.java 
b/java/org/apache/catalina/session/StandardManager.java
index af4cfa191b..629c13ed89 100644
--- a/java/org/apache/catalina/session/StandardManager.java
+++ b/java/org/apache/catalina/session/StandardManager.java
@@ -311,7 +311,7 @@ public class StandardManager extends ManagerBase {
 
 // Expire all the sessions we just wrote
 if (log.isDebugEnabled()) {
-log.debug(sm.getString("standardManager.expiringSessions", 
list.size()));
+log.debug(sm.getString("standardManager.expiringSessions", 
Integer.toString(list.size(;
 }
 for (StandardSession session : list) {
 try {
diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java 
b/java/org/apache/coyote/ajp/AjpProcessor.java
index 2096a20c7b..d13e32635c 100644
--- a/java/org/apache/coyote/ajp/AjpProcessor.java
+++ b/java/org/apache/coyote/ajp/AjpProcessor.java
@@ -386,7 +386,7 @@ public class AjpProcessor extends AbstractProcessor {
 // Unexpected packet type. Unread body packets should have
 // been swallowed in finish().
 if (getLog().isDebugEnabled()) {
-
getLog().debug(sm.getString("ajpprocessor.unexpectedMessage", type));
+
getLog().debug(sm.getString("ajpprocessor.unexpectedMessage", 
Integer.toString(type)));
 }
 setErrorState(ErrorState.CLOSE_CONNECTION_NOW, null);
 break;
diff --git a/java/org/apache/jasper/JspC.java b/java/org/apache/jasper/JspC.java
index dc79af668b..d20a4f150c 100644
--- a/java/org/apache/jasper/JspC.java
+++ b/java/org/apache/jasper/JspC.java
@@ -1349,7 +1349,7 @@ public class JspC extends Task implements Options {
 @Override
 public void execute() {
 if(log.isDebugEnabled()) {
-log.debug(Localizer.getMessage("jspc.start", pages.size()));
+log.debug(Localizer.getMessage("jspc.start", 
Integer.toString(pages.size(;
 }
 
 try {


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch main updated: Fix IDE warnings

2024-02-12 Thread markt
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 1e829dec6d Fix IDE warnings
1e829dec6d is described below

commit 1e829dec6de264b17772adfa38e5d9a4c9d5987e
Author: Mark Thomas 
AuthorDate: Mon Feb 12 14:14:53 2024 +

Fix IDE warnings
---
 java/org/apache/catalina/session/StandardManager.java | 2 +-
 java/org/apache/coyote/ajp/AjpProcessor.java  | 2 +-
 java/org/apache/jasper/JspC.java  | 2 +-
 java/org/apache/tomcat/util/net/openssl/panama/OpenSSLEngine.java | 3 ++-
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/session/StandardManager.java 
b/java/org/apache/catalina/session/StandardManager.java
index a72c2ac8a0..d35e62290c 100644
--- a/java/org/apache/catalina/session/StandardManager.java
+++ b/java/org/apache/catalina/session/StandardManager.java
@@ -223,7 +223,7 @@ public class StandardManager extends ManagerBase {
 
 // Expire all the sessions we just wrote
 if (log.isDebugEnabled()) {
-log.debug(sm.getString("standardManager.expiringSessions", 
list.size()));
+log.debug(sm.getString("standardManager.expiringSessions", 
Integer.toString(list.size(;
 }
 for (StandardSession session : list) {
 try {
diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java 
b/java/org/apache/coyote/ajp/AjpProcessor.java
index cf693aae32..e7dc122827 100644
--- a/java/org/apache/coyote/ajp/AjpProcessor.java
+++ b/java/org/apache/coyote/ajp/AjpProcessor.java
@@ -387,7 +387,7 @@ public class AjpProcessor extends AbstractProcessor {
 // Unexpected packet type. Unread body packets should have
 // been swallowed in finish().
 if (getLog().isDebugEnabled()) {
-
getLog().debug(sm.getString("ajpprocessor.unexpectedMessage", type));
+
getLog().debug(sm.getString("ajpprocessor.unexpectedMessage", 
Integer.toString(type)));
 }
 setErrorState(ErrorState.CLOSE_CONNECTION_NOW, null);
 break;
diff --git a/java/org/apache/jasper/JspC.java b/java/org/apache/jasper/JspC.java
index cd955fb191..e31918cca5 100644
--- a/java/org/apache/jasper/JspC.java
+++ b/java/org/apache/jasper/JspC.java
@@ -1349,7 +1349,7 @@ public class JspC extends Task implements Options {
 @Override
 public void execute() {
 if(log.isDebugEnabled()) {
-log.debug(Localizer.getMessage("jspc.start", pages.size()));
+log.debug(Localizer.getMessage("jspc.start", 
Integer.toString(pages.size(;
 }
 
 try {
diff --git a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLEngine.java 
b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLEngine.java
index 46cfce2b8a..6099620f72 100644
--- a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLEngine.java
+++ b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLEngine.java
@@ -1245,7 +1245,8 @@ public final class OpenSSLEngine extends SSLEngine 
implements SSLUtil.ProtocolIn
 URL url = (new URI(urlString)).toURL();
 ocspResponse = processOCSPRequest(url, 
issuer, x509, x509ctx, localArenal);
 if (log.isDebugEnabled()) {
-
log.debug(sm.getString("engine.ocspResponse", urlString, ocspResponse));
+
log.debug(sm.getString("engine.ocspResponse", urlString,
+
Integer.toString(ocspResponse)));
 }
 } catch (MalformedURLException | 
URISyntaxException e) {
 
log.warn(sm.getString("engine.invalidOCSPURL", urlString));


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 68089] ApplicationHttpRequest.getSpecial() and removeSpecial() use linear scans

2024-02-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68089

Mark Thomas  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #10 from Mark Thomas  ---
Fixed in:
- 11.0.x for 11.0.0-M17 onwards
- 10.1.x for 10.1.19 onwards
-  9.0.x for  9.0.86 onwards
-  8.5.x for  8.5.99 onwards

-- 
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 8.5.x updated: Further performance improvements for BZ 68089

2024-02-12 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new a329e8b4a9 Further performance improvements for BZ 68089
a329e8b4a9 is described below

commit a329e8b4a9d0697b0a888d28d4ab02fa4e0789ee
Author: Mark Thomas 
AuthorDate: Mon Feb 12 14:05:38 2024 +

Further performance improvements for BZ 68089

https://bz.apache.org/bugzilla/show_bug.cgi?id=68089
---
 .../catalina/core/ApplicationHttpRequest.java  | 15 ++
 .../apache/catalina/core/ApplicationRequest.java   | 35 --
 webapps/docs/changelog.xml |  5 
 3 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/java/org/apache/catalina/core/ApplicationHttpRequest.java 
b/java/org/apache/catalina/core/ApplicationHttpRequest.java
index 931a34d18b..8142a3bd05 100644
--- a/java/org/apache/catalina/core/ApplicationHttpRequest.java
+++ b/java/org/apache/catalina/core/ApplicationHttpRequest.java
@@ -89,6 +89,9 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
 }
 }
 
+private static final int shortestSpecialNameLength =
+specialsMap.keySet().stream().mapToInt(s -> 
s.length()).min().getAsInt();
+
 
 private static final int SPECIALS_FIRST_FORWARD_INDEX = 6;
 
@@ -733,6 +736,10 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
  * @param name Attribute name to be tested
  */
 protected boolean isSpecial(String name) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return false;
+}
 return specialsMap.containsKey(name);
 }
 
@@ -743,6 +750,10 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
  * @return the special attribute pos, or -1 if it is not a special 
attribute
  */
 protected int getSpecial(String name) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return -1;
+}
 Integer index = specialsMap.get(name);
 if (index == null) {
 return -1;
@@ -757,6 +768,10 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
  * @return true if the attribute was a special attribute, false otherwise
  */
 protected boolean setSpecial(String name, Object value) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return false;
+}
 Integer index = specialsMap.get(name);
 if (index == null) {
 return false;
diff --git a/java/org/apache/catalina/core/ApplicationRequest.java 
b/java/org/apache/catalina/core/ApplicationRequest.java
index fc9516392d..5828045816 100644
--- a/java/org/apache/catalina/core/ApplicationRequest.java
+++ b/java/org/apache/catalina/core/ApplicationRequest.java
@@ -59,6 +59,9 @@ class ApplicationRequest extends ServletRequestWrapper {
  */
 private static final Set specialsSet = new 
HashSet<>(Arrays.asList(specials));
 
+private static final int shortestSpecialNameLength =
+specialsSet.stream().mapToInt(s -> s.length()).min().getAsInt();
+
 
 /**
  * The request attributes for this request. This is initialized from the 
wrapped request, but updates are allowed.
@@ -135,6 +138,23 @@ class ApplicationRequest extends ServletRequestWrapper {
 }
 
 
+/**
+ * Is this attribute name one of the special ones that is added only for 
included servlets?
+ *
+ * @param name Attribute name to be tested
+ *
+ * @deprecated Will be made private in Tomcat 11 onwards.
+ */
+@Deprecated
+protected boolean isSpecial(String name) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return false;
+}
+return specialsSet.contains(name);
+}
+
+
 // -- ServletRequestWrapper Methods
 
 /**
@@ -157,19 +177,4 @@ class ApplicationRequest extends ServletRequestWrapper {
 }
 }
 }
-
-
-// -- Protected Methods
-
-/**
- * Is this attribute name one of the special ones that is added only for 
included servlets?
- *
- * @param name Attribute name to be tested
- *
- * @deprecated Will be removed without replacement in Tomcat 11 onwards.
- */
-@Deprecated
-protected boolean isSpecial(String name) {
-return specialsSet.contains(name);
-}
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index d243122586..a5a63eadef 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -120,6 +120,11 @@
 Review usage of debug logging and downgrade trace or data 

(tomcat) branch 9.0.x updated: Further performance improvements for BZ 68089

2024-02-12 Thread markt
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 8d3d2a9291 Further performance improvements for BZ 68089
8d3d2a9291 is described below

commit 8d3d2a9291b0efc14b4023e85a67545b3f101be7
Author: Mark Thomas 
AuthorDate: Mon Feb 12 14:05:38 2024 +

Further performance improvements for BZ 68089

https://bz.apache.org/bugzilla/show_bug.cgi?id=68089
---
 .../catalina/core/ApplicationHttpRequest.java  | 15 ++
 .../apache/catalina/core/ApplicationRequest.java   | 35 --
 webapps/docs/changelog.xml |  5 
 3 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/java/org/apache/catalina/core/ApplicationHttpRequest.java 
b/java/org/apache/catalina/core/ApplicationHttpRequest.java
index 7ea652024c..af2bd80551 100644
--- a/java/org/apache/catalina/core/ApplicationHttpRequest.java
+++ b/java/org/apache/catalina/core/ApplicationHttpRequest.java
@@ -92,6 +92,9 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
 }
 }
 
+private static final int shortestSpecialNameLength =
+specialsMap.keySet().stream().mapToInt(s -> 
s.length()).min().getAsInt();
+
 
 private static final int SPECIALS_FIRST_FORWARD_INDEX = 6;
 
@@ -738,6 +741,10 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
  * @param name Attribute name to be tested
  */
 protected boolean isSpecial(String name) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return false;
+}
 return specialsMap.containsKey(name);
 }
 
@@ -748,6 +755,10 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
  * @return the special attribute pos, or -1 if it is not a special 
attribute
  */
 protected int getSpecial(String name) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return -1;
+}
 Integer index = specialsMap.get(name);
 if (index == null) {
 return -1;
@@ -762,6 +773,10 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
  * @return true if the attribute was a special attribute, false otherwise
  */
 protected boolean setSpecial(String name, Object value) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return false;
+}
 Integer index = specialsMap.get(name);
 if (index == null) {
 return false;
diff --git a/java/org/apache/catalina/core/ApplicationRequest.java 
b/java/org/apache/catalina/core/ApplicationRequest.java
index bf84fb63cb..f6c8beb1fb 100644
--- a/java/org/apache/catalina/core/ApplicationRequest.java
+++ b/java/org/apache/catalina/core/ApplicationRequest.java
@@ -59,6 +59,9 @@ class ApplicationRequest extends ServletRequestWrapper {
  */
 private static final Set specialsSet = new 
HashSet<>(Arrays.asList(specials));
 
+private static final int shortestSpecialNameLength =
+specialsSet.stream().mapToInt(s -> s.length()).min().getAsInt();
+
 
 /**
  * The request attributes for this request. This is initialized from the 
wrapped request, but updates are allowed.
@@ -135,6 +138,23 @@ class ApplicationRequest extends ServletRequestWrapper {
 }
 
 
+/**
+ * Is this attribute name one of the special ones that is added only for 
included servlets?
+ *
+ * @param name Attribute name to be tested
+ *
+ * @deprecated Will be made private in Tomcat 11 onwards.
+ */
+@Deprecated
+protected boolean isSpecial(String name) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return false;
+}
+return specialsSet.contains(name);
+}
+
+
 // -- ServletRequestWrapper Methods
 
 /**
@@ -157,19 +177,4 @@ class ApplicationRequest extends ServletRequestWrapper {
 }
 }
 }
-
-
-// -- Protected Methods
-
-/**
- * Is this attribute name one of the special ones that is added only for 
included servlets?
- *
- * @param name Attribute name to be tested
- *
- * @deprecated Will be removed without replacement in Tomcat 11 onwards.
- */
-@Deprecated
-protected boolean isSpecial(String name) {
-return specialsSet.contains(name);
-}
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index a4b6b2bdf3..b92d0b824e 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -126,6 +126,11 @@
 Review usage of debug logging and downgrade trace or data 

(tomcat) branch 10.1.x updated: Further performance improvements for BZ 68089

2024-02-12 Thread markt
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 2454294840 Further performance improvements for BZ 68089
2454294840 is described below

commit 2454294840b1f4e0ec69477c4cab326c63aa38be
Author: Mark Thomas 
AuthorDate: Mon Feb 12 14:05:38 2024 +

Further performance improvements for BZ 68089

https://bz.apache.org/bugzilla/show_bug.cgi?id=68089
---
 .../catalina/core/ApplicationHttpRequest.java  | 15 ++
 .../apache/catalina/core/ApplicationRequest.java   | 35 --
 webapps/docs/changelog.xml |  5 
 3 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/java/org/apache/catalina/core/ApplicationHttpRequest.java 
b/java/org/apache/catalina/core/ApplicationHttpRequest.java
index 3eba826b3f..12534bada5 100644
--- a/java/org/apache/catalina/core/ApplicationHttpRequest.java
+++ b/java/org/apache/catalina/core/ApplicationHttpRequest.java
@@ -92,6 +92,9 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
 }
 }
 
+private static final int shortestSpecialNameLength =
+specialsMap.keySet().stream().mapToInt(s -> 
s.length()).min().getAsInt();
+
 
 private static final int SPECIALS_FIRST_FORWARD_INDEX = 6;
 
@@ -738,6 +741,10 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
  * @param name Attribute name to be tested
  */
 protected boolean isSpecial(String name) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return false;
+}
 return specialsMap.containsKey(name);
 }
 
@@ -748,6 +755,10 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
  * @return the special attribute pos, or -1 if it is not a special 
attribute
  */
 protected int getSpecial(String name) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return -1;
+}
 Integer index = specialsMap.get(name);
 if (index == null) {
 return -1;
@@ -762,6 +773,10 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
  * @return true if the attribute was a special attribute, false otherwise
  */
 protected boolean setSpecial(String name, Object value) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return false;
+}
 Integer index = specialsMap.get(name);
 if (index == null) {
 return false;
diff --git a/java/org/apache/catalina/core/ApplicationRequest.java 
b/java/org/apache/catalina/core/ApplicationRequest.java
index 8e0ec4576d..cdbb845a1d 100644
--- a/java/org/apache/catalina/core/ApplicationRequest.java
+++ b/java/org/apache/catalina/core/ApplicationRequest.java
@@ -59,6 +59,9 @@ class ApplicationRequest extends ServletRequestWrapper {
  */
 private static final Set specialsSet = new 
HashSet<>(Arrays.asList(specials));
 
+private static final int shortestSpecialNameLength =
+specialsSet.stream().mapToInt(s -> s.length()).min().getAsInt();
+
 
 /**
  * The request attributes for this request. This is initialized from the 
wrapped request, but updates are allowed.
@@ -135,6 +138,23 @@ class ApplicationRequest extends ServletRequestWrapper {
 }
 
 
+/**
+ * Is this attribute name one of the special ones that is added only for 
included servlets?
+ *
+ * @param name Attribute name to be tested
+ *
+ * @deprecated Will be made private in Tomcat 11 onwards.
+ */
+@Deprecated
+protected boolean isSpecial(String name) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return false;
+}
+return specialsSet.contains(name);
+}
+
+
 // -- ServletRequestWrapper Methods
 
 /**
@@ -157,19 +177,4 @@ class ApplicationRequest extends ServletRequestWrapper {
 }
 }
 }
-
-
-// -- Protected Methods
-
-/**
- * Is this attribute name one of the special ones that is added only for 
included servlets?
- *
- * @param name Attribute name to be tested
- *
- * @deprecated Will be removed without replacement in Tomcat 11 onwards.
- */
-@Deprecated
-protected boolean isSpecial(String name) {
-return specialsSet.contains(name);
-}
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 01a21ef39a..2a9316ad75 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -126,6 +126,11 @@
 Review usage of debug logging and downgrade trace or data 

(tomcat) branch main updated: Further performance improvements for BZ 68089

2024-02-12 Thread markt
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 c86ab5e882 Further performance improvements for BZ 68089
c86ab5e882 is described below

commit c86ab5e882eeeda1a94ff7e0e311c2a8b60e026e
Author: Mark Thomas 
AuthorDate: Mon Feb 12 14:05:38 2024 +

Further performance improvements for BZ 68089

https://bz.apache.org/bugzilla/show_bug.cgi?id=68089
---
 java/org/apache/catalina/core/ApplicationHttpRequest.java | 15 +++
 java/org/apache/catalina/core/ApplicationRequest.java | 15 +--
 webapps/docs/changelog.xml|  5 +
 3 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/core/ApplicationHttpRequest.java 
b/java/org/apache/catalina/core/ApplicationHttpRequest.java
index b518dbe454..814ee277e8 100644
--- a/java/org/apache/catalina/core/ApplicationHttpRequest.java
+++ b/java/org/apache/catalina/core/ApplicationHttpRequest.java
@@ -88,6 +88,9 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
 }
 }
 
+private static final int shortestSpecialNameLength =
+specialsMap.keySet().stream().mapToInt(s -> 
s.length()).min().getAsInt();
+
 
 private static final int SPECIALS_FIRST_FORWARD_INDEX = 6;
 
@@ -742,6 +745,10 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
  * @param name Attribute name to be tested
  */
 protected boolean isSpecial(String name) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return false;
+}
 return specialsMap.containsKey(name);
 }
 
@@ -752,6 +759,10 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
  * @return the special attribute pos, or -1 if it is not a special 
attribute
  */
 protected int getSpecial(String name) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return -1;
+}
 Integer index = specialsMap.get(name);
 if (index == null) {
 return -1;
@@ -766,6 +777,10 @@ class ApplicationHttpRequest extends 
HttpServletRequestWrapper {
  * @return true if the attribute was a special attribute, false otherwise
  */
 protected boolean setSpecial(String name, Object value) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return false;
+}
 Integer index = specialsMap.get(name);
 if (index == null) {
 return false;
diff --git a/java/org/apache/catalina/core/ApplicationRequest.java 
b/java/org/apache/catalina/core/ApplicationRequest.java
index 330e3da575..add391aa67 100644
--- a/java/org/apache/catalina/core/ApplicationRequest.java
+++ b/java/org/apache/catalina/core/ApplicationRequest.java
@@ -49,6 +49,9 @@ class ApplicationRequest extends ServletRequestWrapper {
 RequestDispatcher.FORWARD_SERVLET_PATH, 
RequestDispatcher.FORWARD_PATH_INFO,
 RequestDispatcher.FORWARD_QUERY_STRING, 
RequestDispatcher.FORWARD_MAPPING));
 
+private static final int shortestSpecialNameLength =
+specialsSet.stream().mapToInt(s -> s.length()).min().getAsInt();
+
 
 /**
  * The request attributes for this request. This is initialized from the 
wrapped request, but updates are allowed.
@@ -101,7 +104,7 @@ class ApplicationRequest extends ServletRequestWrapper {
 public void removeAttribute(String name) {
 synchronized (attributes) {
 attributes.remove(name);
-if (!specialsSet.contains(name)) {
+if (!isSpecial(name)) {
 getRequest().removeAttribute(name);
 }
 }
@@ -118,13 +121,21 @@ class ApplicationRequest extends ServletRequestWrapper {
 public void setAttribute(String name, Object value) {
 synchronized (attributes) {
 attributes.put(name, value);
-if (!specialsSet.contains(name)) {
+if (!isSpecial(name)) {
 getRequest().setAttribute(name, value);
 }
 }
 }
 
 
+private boolean isSpecial(String name) {
+// Performance - see BZ 68089
+if (name.length() < shortestSpecialNameLength) {
+return false;
+}
+return specialsSet.contains(name);
+}
+
 // -- ServletRequestWrapper Methods
 
 /**
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 61c67f700d..1d8f6317a8 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -133,6 +133,11 @@
 Review usage of debug logging and downgrade trace or data dumping
 operations from debug level to 

[Bug 68596] Remaining overhead in javax.el.CompositeELResolver.convertToType

2024-02-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68596

--- Comment #9 from John Engebretson  ---
Responding to these sections of comment #6:

> The setPropertyResolved(boolean) method is not overwritten in subclasses. 
> This is a common situation that occurs everywhere, thus I wonder why this 
> specific JVM cannot optimize it. 

This particular method CAN be overridden on any of unbounded set of subclasses,
and in the case of our application, at least three are loaded at runtime.  The
HotSpot JVM is generally capable of looking at two classes and optimizing but
gives up at 3+, switching instead to the invokevirtual instruction.  I
understand Graal may be more powerful in this regard... but at some point
invokevirtual is used, since that is the purpose of its existence. 
Unfortunately Graal is not an immediate option for us.

> The only unusual is that the method is overloaded, having 
> "setPropertyResolved(boolean)" and "setPropertyResolved(Object base, Object 
> property)".

I expect any overridable method on this class would also be forced into
invokevirtual.  setResolved() stands out because the call frequency creates a
hotspot.

-- 
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 8.5.x updated: Leftovers

2024-02-12 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 1cf33e777e Leftovers
1cf33e777e is described below

commit 1cf33e777e4dad6bb565f999060674eaf9453249
Author: remm 
AuthorDate: Mon Feb 12 13:54:56 2024 +0100

Leftovers
---
 java/org/apache/catalina/tribes/membership/McastServiceImpl.java  | 2 +-
 java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties | 1 +
 java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/tribes/membership/McastServiceImpl.java 
b/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
index e3f05d423d..05f50f3777 100644
--- a/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
+++ b/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
@@ -644,7 +644,7 @@ public class McastServiceImpl {
 if (errorCounter==0) {
 
log.warn(sm.getString("mcastServiceImpl.send.failed"),x);
 } else {
-log.debug("Unable to send mcast message.",x);
+
log.debug(sm.getString("mcastServiceImpl.send.failed"),x);
 }
 if ( (++errorCounter)>=recoveryCounter ) {
 errorCounter=0;
diff --git 
a/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties 
b/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties
index 31fda7d8d0..bb138b1d0d 100644
--- a/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties
+++ b/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties
@@ -27,6 +27,7 @@ nioReceiver.stop.threadRunning=The NioReceiver thread did not 
stop in a timely m
 nioReceiver.threadpool.fail=ThreadPool cannot be initialized. Listener not 
started.
 nioReceiver.threadsExhausted=Channel key is registered, but has had no 
interest ops for the last [{0}] ms. (cancelled: [{1}]):[{2}] last access:[{3}] 
Possible cause: all threads used, perform thread dump
 
+nioReplicationTask.disconnect=Channel closed on the remote end, disconnecting
 nioReplicationTask.error.register.key=Error registering key for read:[{0}]
 nioReplicationTask.exception.drainChannel=Exception caught in 
TcpReplicationThread.drainChannel.
 nioReplicationTask.process.clusterMsg.failed=Processing of cluster message 
failed.
diff --git 
a/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java 
b/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java
index 7edf36b9ed..fb33e3f2f9 100644
--- a/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java
+++ b/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java
@@ -262,7 +262,7 @@ public class NioReplicationTask extends AbstractRxTask {
 private void remoteEof(SelectionKey key) {
 // close channel on EOF, invalidates the key
 if ( log.isDebugEnabled() ) {
-log.debug("Channel closed on the remote end, disconnecting");
+log.debug(sm.getString("nioReplicationTask.disconnect"));
 }
 cancelKey(key);
 }


-
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: Leftovers

2024-02-12 Thread remm
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 6c76c62957 Leftovers
6c76c62957 is described below

commit 6c76c62957281057d19a7b708bf9ef6065fe3b3c
Author: remm 
AuthorDate: Mon Feb 12 13:54:56 2024 +0100

Leftovers
---
 java/org/apache/catalina/tribes/membership/McastServiceImpl.java  | 2 +-
 java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties | 1 +
 java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/tribes/membership/McastServiceImpl.java 
b/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
index 045e8af68e..a255866515 100644
--- a/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
+++ b/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
@@ -633,7 +633,7 @@ public class McastServiceImpl extends 
MembershipProviderBase {
 if (errorCounter==0) {
 
log.warn(sm.getString("mcastServiceImpl.send.failed"),x);
 } else {
-log.debug("Unable to send mcast message.",x);
+
log.debug(sm.getString("mcastServiceImpl.send.failed"),x);
 }
 if ( (++errorCounter)>=recoveryCounter ) {
 errorCounter=0;
diff --git 
a/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties 
b/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties
index 31fda7d8d0..bb138b1d0d 100644
--- a/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties
+++ b/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties
@@ -27,6 +27,7 @@ nioReceiver.stop.threadRunning=The NioReceiver thread did not 
stop in a timely m
 nioReceiver.threadpool.fail=ThreadPool cannot be initialized. Listener not 
started.
 nioReceiver.threadsExhausted=Channel key is registered, but has had no 
interest ops for the last [{0}] ms. (cancelled: [{1}]):[{2}] last access:[{3}] 
Possible cause: all threads used, perform thread dump
 
+nioReplicationTask.disconnect=Channel closed on the remote end, disconnecting
 nioReplicationTask.error.register.key=Error registering key for read:[{0}]
 nioReplicationTask.exception.drainChannel=Exception caught in 
TcpReplicationThread.drainChannel.
 nioReplicationTask.process.clusterMsg.failed=Processing of cluster message 
failed.
diff --git 
a/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java 
b/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java
index 7fd5ecbe1a..f28648c3b9 100644
--- a/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java
+++ b/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java
@@ -261,7 +261,7 @@ public class NioReplicationTask extends AbstractRxTask {
 private void remoteEof(SelectionKey key) {
 // close channel on EOF, invalidates the key
 if ( log.isDebugEnabled() ) {
-log.debug("Channel closed on the remote end, disconnecting");
+log.debug(sm.getString("nioReplicationTask.disconnect"));
 }
 cancelKey(key);
 }


-
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: Leftovers

2024-02-12 Thread remm
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 f97598e6b2 Leftovers
f97598e6b2 is described below

commit f97598e6b2a3216ddbe98f896bfb9eccb43277b1
Author: remm 
AuthorDate: Mon Feb 12 13:54:56 2024 +0100

Leftovers
---
 java/org/apache/catalina/tribes/membership/McastServiceImpl.java  | 2 +-
 java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties | 1 +
 java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/tribes/membership/McastServiceImpl.java 
b/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
index bf7541cabe..b2752a531a 100644
--- a/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
+++ b/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
@@ -634,7 +634,7 @@ public class McastServiceImpl extends 
MembershipProviderBase {
 if (errorCounter==0) {
 
log.warn(sm.getString("mcastServiceImpl.send.failed"),x);
 } else {
-log.debug("Unable to send mcast message.",x);
+
log.debug(sm.getString("mcastServiceImpl.send.failed"),x);
 }
 if ( (++errorCounter)>=recoveryCounter ) {
 errorCounter=0;
diff --git 
a/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties 
b/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties
index df2b56c77f..441b425d12 100644
--- a/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties
+++ b/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties
@@ -27,6 +27,7 @@ nioReceiver.stop.threadRunning=The NioReceiver thread did not 
stop in a timely m
 nioReceiver.threadpool.fail=ThreadPool cannot be initialized. Listener not 
started.
 nioReceiver.threadsExhausted=Channel key is registered, but has had no 
interest ops for the last [{0}] ms. (cancelled: [{1}]):[{2}] last access:[{3}] 
Possible cause: all threads used, perform thread dump
 
+nioReplicationTask.disconnect=Channel closed on the remote end, disconnecting
 nioReplicationTask.error.register.key=Error registering key for read:[{0}]
 nioReplicationTask.exception.drainChannel=Exception caught in 
TcpReplicationThread.drainChannel.
 nioReplicationTask.process.clusterMsg.failed=Processing of cluster message 
failed.
diff --git 
a/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java 
b/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java
index 7fd5ecbe1a..f28648c3b9 100644
--- a/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java
+++ b/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java
@@ -261,7 +261,7 @@ public class NioReplicationTask extends AbstractRxTask {
 private void remoteEof(SelectionKey key) {
 // close channel on EOF, invalidates the key
 if ( log.isDebugEnabled() ) {
-log.debug("Channel closed on the remote end, disconnecting");
+log.debug(sm.getString("nioReplicationTask.disconnect"));
 }
 cancelKey(key);
 }


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch main updated: Leftovers

2024-02-12 Thread remm
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 4804e2c436 Leftovers
4804e2c436 is described below

commit 4804e2c436d88ceec2a0aeffeb3295e90a77c267
Author: remm 
AuthorDate: Mon Feb 12 13:54:56 2024 +0100

Leftovers
---
 java/org/apache/catalina/tribes/membership/McastServiceImpl.java  | 2 +-
 java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties | 1 +
 java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/tribes/membership/McastServiceImpl.java 
b/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
index b5e01a4cbb..b5306d41ae 100644
--- a/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
+++ b/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
@@ -631,7 +631,7 @@ public class McastServiceImpl extends 
MembershipProviderBase {
 if (errorCounter==0) {
 
log.warn(sm.getString("mcastServiceImpl.send.failed"),x);
 } else {
-log.debug("Unable to send mcast message.",x);
+
log.debug(sm.getString("mcastServiceImpl.send.failed"),x);
 }
 if ( (++errorCounter)>=recoveryCounter ) {
 errorCounter=0;
diff --git 
a/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties 
b/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties
index df2b56c77f..441b425d12 100644
--- a/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties
+++ b/java/org/apache/catalina/tribes/transport/nio/LocalStrings.properties
@@ -27,6 +27,7 @@ nioReceiver.stop.threadRunning=The NioReceiver thread did not 
stop in a timely m
 nioReceiver.threadpool.fail=ThreadPool cannot be initialized. Listener not 
started.
 nioReceiver.threadsExhausted=Channel key is registered, but has had no 
interest ops for the last [{0}] ms. (cancelled: [{1}]):[{2}] last access:[{3}] 
Possible cause: all threads used, perform thread dump
 
+nioReplicationTask.disconnect=Channel closed on the remote end, disconnecting
 nioReplicationTask.error.register.key=Error registering key for read:[{0}]
 nioReplicationTask.exception.drainChannel=Exception caught in 
TcpReplicationThread.drainChannel.
 nioReplicationTask.process.clusterMsg.failed=Processing of cluster message 
failed.
diff --git 
a/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java 
b/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java
index 7fd5ecbe1a..f28648c3b9 100644
--- a/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java
+++ b/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java
@@ -261,7 +261,7 @@ public class NioReplicationTask extends AbstractRxTask {
 private void remoteEof(SelectionKey key) {
 // close channel on EOF, invalidates the key
 if ( log.isDebugEnabled() ) {
-log.debug("Channel closed on the remote end, disconnecting");
+log.debug(sm.getString("nioReplicationTask.disconnect"));
 }
 cancelKey(key);
 }


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) branch 8.5.x updated: Localization for debug strings

2024-02-12 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new c3e62032d5 Localization for debug strings
c3e62032d5 is described below

commit c3e62032d5928b8951b0742ca02eb87d9a546b9b
Author: remm 
AuthorDate: Mon Feb 12 11:19:54 2024 +0100

Localization for debug strings

Since debug is now more significant.
---
 .../catalina/authenticator/AuthenticatorBase.java  | 33 +-
 .../catalina/authenticator/FormAuthenticator.java  | 40 +++---
 .../catalina/authenticator/LocalStrings.properties | 12 +++
 .../authenticator/NonLoginAuthenticator.java   |  4 +--
 .../catalina/authenticator/SSLAuthenticator.java   |  8 ++---
 .../apache/catalina/connector/CoyoteAdapter.java   |  4 +--
 java/org/apache/catalina/core/ContainerBase.java   |  2 +-
 .../apache/catalina/core/LocalStrings.properties   |  6 
 .../catalina/core/NamingContextListener.java   | 16 +
 .../core/ThreadLocalLeakPreventionListener.java|  4 ++-
 .../catalina/filters/CsrfPreventionFilter.java | 40 ++
 .../catalina/filters/LocalStrings.properties   |  4 +++
 .../catalina/ha/session/ClusterManagerBase.java|  4 ++-
 .../catalina/ha/session/LocalStrings.properties|  2 ++
 .../apache/catalina/ha/tcp/LocalStrings.properties |  3 ++
 .../apache/catalina/ha/tcp/SimpleTcpCluster.java   |  8 ++---
 .../mbeans/GlobalResourcesLifecycleListener.java   |  2 +-
 .../apache/catalina/mbeans/LocalStrings.properties |  1 +
 .../catalina/realm/JAASMemoryLoginModule.java  |  2 +-
 java/org/apache/catalina/realm/JNDIRealm.java  |  8 ++---
 .../apache/catalina/realm/LocalStrings.properties  |  2 ++
 java/org/apache/catalina/realm/RealmBase.java  |  2 +-
 java/org/apache/catalina/session/FileStore.java|  2 +-
 .../catalina/session/LocalStrings.properties   |  3 ++
 java/org/apache/catalina/session/ManagerBase.java  |  8 ++---
 .../apache/catalina/session/StandardManager.java   |  4 +--
 java/org/apache/catalina/startup/Catalina.java |  6 ++--
 .../org/apache/catalina/startup/ContextConfig.java |  7 ++--
 .../startup/CopyParentClassLoaderRule.java |  4 +--
 java/org/apache/catalina/startup/HostConfig.java   |  4 +--
 .../catalina/startup/LocalStrings.properties   |  4 +++
 .../group/interceptors/LocalStrings.properties |  1 +
 .../group/interceptors/TcpFailureDetector.java |  2 +-
 .../group/interceptors/TcpPingInterceptor.java |  4 +--
 .../tribes/membership/LocalStrings.properties  |  6 
 .../tribes/membership/McastServiceImpl.java| 18 ++
 .../tribes/tipis/AbstractReplicatedMap.java| 12 +++
 .../catalina/tribes/tipis/LocalStrings.properties  |  6 +++-
 .../catalina/tribes/tipis/ReplicatedMap.java   |  2 +-
 .../tribes/transport/LocalStrings.properties   |  1 +
 .../catalina/tribes/transport/ReceiverBase.java|  2 +-
 .../tribes/transport/nio/LocalStrings.properties   |  3 ++
 .../catalina/tribes/transport/nio/NioReceiver.java | 10 +++---
 .../tribes/transport/nio/NioReplicationTask.java   |  2 +-
 .../apache/catalina/valves/ErrorReportValve.java   |  2 +-
 .../catalina/valves/ExtendedAccessLogValve.java|  4 +--
 .../catalina/valves/JsonErrorReportValve.java  |  2 +-
 .../catalina/valves/LoadBalancerDrainingValve.java |  5 ++-
 .../apache/catalina/valves/LocalStrings.properties |  7 
 .../catalina/valves/ProxyErrorReportValve.java |  2 +-
 .../catalina/valves/StuckThreadDetectionValve.java |  2 +-
 .../valves/rewrite/LocalStrings.properties |  2 ++
 .../catalina/valves/rewrite/RewriteValve.java  |  7 ++--
 java/org/apache/coyote/AbstractProcessor.java  |  2 +-
 java/org/apache/coyote/LocalStrings.properties |  1 +
 java/org/apache/coyote/ajp/AjpProcessor.java   |  4 +--
 java/org/apache/coyote/ajp/LocalStrings.properties |  2 ++
 .../coyote/http11/filters/GzipOutputFilter.java|  4 ++-
 .../coyote/http11/filters/LocalStrings.properties  |  2 ++
 java/org/apache/jasper/JspC.java   | 11 +++---
 java/org/apache/jasper/compiler/AntCompiler.java   |  3 +-
 java/org/apache/jasper/compiler/Compiler.java  |  3 +-
 java/org/apache/jasper/compiler/JDTCompiler.java   |  3 +-
 java/org/apache/jasper/compiler/JspReader.java |  2 +-
 .../optimizations/ELInterpreterTagSetters.java | 19 +-
 .../jasper/resources/LocalStrings.properties   |  9 +
 .../apache/tomcat/util/buf/LocalStrings.properties |  3 ++
 java/org/apache/tomcat/util/buf/StringCache.java   |  6 ++--
 .../tomcat/util/http/LocalStrings.properties   |  1 +
 .../tomcat/util/http/Rfc6265CookieProcessor.java   |  2 +-
 .../tomcat/util/threads/LocalStrings.properties|  2 ++
 .../org/apache/tomcat/util/threads/TaskThread.java |  4 ++-
 72 files changed, 262 

(tomcat) branch 9.0.x updated: Localization for debug strings

2024-02-12 Thread remm
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 5cc633c8f6 Localization for debug strings
5cc633c8f6 is described below

commit 5cc633c8f6586ccaaa3aeb89aaff54937b15add7
Author: remm 
AuthorDate: Mon Feb 12 11:19:54 2024 +0100

Localization for debug strings

Since debug is now more significant.
---
 .../catalina/authenticator/AuthenticatorBase.java  | 33 +-
 .../catalina/authenticator/FormAuthenticator.java  | 40 +++---
 .../catalina/authenticator/LocalStrings.properties | 12 +++
 .../authenticator/NonLoginAuthenticator.java   |  4 +--
 .../catalina/authenticator/SSLAuthenticator.java   |  8 ++---
 .../apache/catalina/connector/CoyoteAdapter.java   |  4 +--
 java/org/apache/catalina/core/ContainerBase.java   |  2 +-
 .../apache/catalina/core/LocalStrings.properties   |  6 
 .../catalina/core/NamingContextListener.java   | 16 +
 .../core/ThreadLocalLeakPreventionListener.java|  4 ++-
 .../catalina/filters/CsrfPreventionFilter.java | 40 ++
 .../catalina/filters/LocalStrings.properties   |  4 +++
 .../catalina/ha/session/ClusterManagerBase.java|  4 ++-
 .../catalina/ha/session/LocalStrings.properties|  2 ++
 .../apache/catalina/ha/tcp/LocalStrings.properties |  3 ++
 .../apache/catalina/ha/tcp/SimpleTcpCluster.java   |  8 ++---
 .../mbeans/GlobalResourcesLifecycleListener.java   |  2 +-
 .../apache/catalina/mbeans/LocalStrings.properties |  1 +
 .../catalina/realm/JAASMemoryLoginModule.java  |  2 +-
 java/org/apache/catalina/realm/JNDIRealm.java  |  8 ++---
 .../apache/catalina/realm/LocalStrings.properties  |  2 ++
 java/org/apache/catalina/realm/RealmBase.java  |  2 +-
 java/org/apache/catalina/session/FileStore.java|  2 +-
 .../catalina/session/LocalStrings.properties   |  3 ++
 java/org/apache/catalina/session/ManagerBase.java  |  8 ++---
 .../apache/catalina/session/StandardManager.java   |  4 +--
 java/org/apache/catalina/startup/Catalina.java |  8 ++---
 .../org/apache/catalina/startup/ContextConfig.java |  7 ++--
 .../startup/CopyParentClassLoaderRule.java |  4 +--
 java/org/apache/catalina/startup/HostConfig.java   |  4 +--
 .../catalina/startup/LocalStrings.properties   |  8 +
 .../group/interceptors/LocalStrings.properties |  1 +
 .../group/interceptors/TcpFailureDetector.java |  2 +-
 .../group/interceptors/TcpPingInterceptor.java |  4 +--
 .../tribes/membership/LocalStrings.properties  |  6 
 .../tribes/membership/McastServiceImpl.java| 18 ++
 .../tribes/tipis/AbstractReplicatedMap.java| 12 +++
 .../catalina/tribes/tipis/LocalStrings.properties  |  6 +++-
 .../catalina/tribes/tipis/ReplicatedMap.java   |  2 +-
 .../tribes/transport/LocalStrings.properties   |  1 +
 .../catalina/tribes/transport/ReceiverBase.java|  2 +-
 .../tribes/transport/nio/LocalStrings.properties   |  2 ++
 .../catalina/tribes/transport/nio/NioReceiver.java | 10 +++---
 .../tribes/transport/nio/NioReplicationTask.java   |  2 +-
 .../catalina/users/DataSourceUserDatabase.java |  6 ++--
 .../apache/catalina/users/LocalStrings.properties  |  1 +
 .../apache/catalina/valves/ErrorReportValve.java   |  2 +-
 .../catalina/valves/ExtendedAccessLogValve.java|  4 +--
 .../catalina/valves/JsonErrorReportValve.java  |  2 +-
 .../catalina/valves/LoadBalancerDrainingValve.java |  5 ++-
 .../apache/catalina/valves/LocalStrings.properties |  7 
 .../catalina/valves/ProxyErrorReportValve.java |  2 +-
 .../catalina/valves/StuckThreadDetectionValve.java |  2 +-
 .../valves/rewrite/LocalStrings.properties |  2 ++
 .../catalina/valves/rewrite/RewriteValve.java  |  9 ++---
 java/org/apache/coyote/AbstractProcessor.java  |  2 +-
 java/org/apache/coyote/LocalStrings.properties |  1 +
 java/org/apache/coyote/ajp/AjpProcessor.java   |  4 +--
 java/org/apache/coyote/ajp/LocalStrings.properties |  2 ++
 .../coyote/http11/filters/GzipOutputFilter.java|  4 ++-
 .../coyote/http11/filters/LocalStrings.properties  |  2 ++
 java/org/apache/jasper/JspC.java   | 11 +++---
 java/org/apache/jasper/compiler/AntCompiler.java   |  3 +-
 java/org/apache/jasper/compiler/Compiler.java  |  3 +-
 java/org/apache/jasper/compiler/JDTCompiler.java   |  3 +-
 java/org/apache/jasper/compiler/JspReader.java |  2 +-
 .../optimizations/ELInterpreterTagSetters.java | 19 +-
 .../jasper/resources/LocalStrings.properties   |  9 +
 .../apache/tomcat/util/buf/LocalStrings.properties |  3 ++
 java/org/apache/tomcat/util/buf/StringCache.java   |  6 ++--
 java/org/apache/tomcat/util/digester/Digester.java |  2 +-
 .../tomcat/util/digester/FactoryCreateRule.java|  8 ++---
 

(tomcat) branch 10.1.x updated: Localization for debug strings

2024-02-12 Thread remm
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 9b34da5946 Localization for debug strings
9b34da5946 is described below

commit 9b34da5946eecbf19cdd9aab0fd580ec059b79f9
Author: remm 
AuthorDate: Mon Feb 12 11:19:54 2024 +0100

Localization for debug strings

Since debug is now more significant.
---
 .../catalina/authenticator/AuthenticatorBase.java  | 33 +-
 .../catalina/authenticator/FormAuthenticator.java  | 40 +++---
 .../catalina/authenticator/LocalStrings.properties | 12 +++
 .../authenticator/NonLoginAuthenticator.java   |  4 +--
 .../catalina/authenticator/SSLAuthenticator.java   |  8 ++---
 .../apache/catalina/connector/CoyoteAdapter.java   |  4 +--
 java/org/apache/catalina/core/ContainerBase.java   |  2 +-
 .../apache/catalina/core/LocalStrings.properties   |  6 
 .../catalina/core/NamingContextListener.java   | 16 +
 .../core/ThreadLocalLeakPreventionListener.java|  4 ++-
 .../catalina/filters/CsrfPreventionFilter.java | 40 ++
 .../catalina/filters/LocalStrings.properties   |  4 +++
 .../catalina/ha/session/ClusterManagerBase.java|  4 ++-
 .../catalina/ha/session/LocalStrings.properties|  2 ++
 .../apache/catalina/ha/tcp/LocalStrings.properties |  3 ++
 .../apache/catalina/ha/tcp/SimpleTcpCluster.java   |  8 ++---
 .../mbeans/GlobalResourcesLifecycleListener.java   |  2 +-
 .../apache/catalina/mbeans/LocalStrings.properties |  1 +
 .../catalina/realm/JAASMemoryLoginModule.java  |  2 +-
 java/org/apache/catalina/realm/JNDIRealm.java  |  8 ++---
 .../apache/catalina/realm/LocalStrings.properties  |  2 ++
 java/org/apache/catalina/realm/RealmBase.java  |  2 +-
 java/org/apache/catalina/session/FileStore.java|  2 +-
 .../catalina/session/LocalStrings.properties   |  3 ++
 java/org/apache/catalina/session/ManagerBase.java  |  8 ++---
 .../apache/catalina/session/StandardManager.java   |  4 +--
 java/org/apache/catalina/startup/Catalina.java |  8 ++---
 .../org/apache/catalina/startup/ContextConfig.java |  7 ++--
 .../startup/CopyParentClassLoaderRule.java |  4 +--
 java/org/apache/catalina/startup/HostConfig.java   |  4 +--
 .../catalina/startup/LocalStrings.properties   |  8 +
 .../group/interceptors/LocalStrings.properties |  1 +
 .../group/interceptors/TcpFailureDetector.java |  2 +-
 .../group/interceptors/TcpPingInterceptor.java |  4 +--
 .../tribes/membership/LocalStrings.properties  |  6 
 .../tribes/membership/McastServiceImpl.java| 18 ++
 .../tribes/tipis/AbstractReplicatedMap.java| 12 +++
 .../catalina/tribes/tipis/LocalStrings.properties  |  6 +++-
 .../catalina/tribes/tipis/ReplicatedMap.java   |  2 +-
 .../tribes/transport/LocalStrings.properties   |  1 +
 .../catalina/tribes/transport/ReceiverBase.java|  2 +-
 .../tribes/transport/nio/LocalStrings.properties   |  3 ++
 .../catalina/tribes/transport/nio/NioReceiver.java | 10 +++---
 .../tribes/transport/nio/NioReplicationTask.java   |  2 +-
 .../tribes/transport/nio/ParallelNioSender.java|  2 +-
 .../catalina/users/DataSourceUserDatabase.java |  6 ++--
 .../apache/catalina/users/LocalStrings.properties  |  1 +
 .../apache/catalina/valves/ErrorReportValve.java   |  2 +-
 .../catalina/valves/ExtendedAccessLogValve.java|  4 +--
 .../catalina/valves/JsonErrorReportValve.java  |  2 +-
 .../catalina/valves/LoadBalancerDrainingValve.java |  5 ++-
 .../apache/catalina/valves/LocalStrings.properties |  7 
 .../catalina/valves/ProxyErrorReportValve.java |  2 +-
 .../catalina/valves/StuckThreadDetectionValve.java |  2 +-
 .../valves/rewrite/LocalStrings.properties |  2 ++
 .../catalina/valves/rewrite/RewriteValve.java  |  9 ++---
 java/org/apache/coyote/AbstractProcessor.java  |  2 +-
 java/org/apache/coyote/LocalStrings.properties |  1 +
 java/org/apache/coyote/ajp/AjpProcessor.java   |  4 +--
 java/org/apache/coyote/ajp/LocalStrings.properties |  2 ++
 .../coyote/http11/filters/GzipOutputFilter.java|  4 ++-
 .../coyote/http11/filters/LocalStrings.properties  |  2 ++
 java/org/apache/jasper/JspC.java   | 11 +++---
 java/org/apache/jasper/compiler/AntCompiler.java   |  3 +-
 java/org/apache/jasper/compiler/Compiler.java  |  3 +-
 java/org/apache/jasper/compiler/JDTCompiler.java   |  3 +-
 java/org/apache/jasper/compiler/JspReader.java |  2 +-
 .../optimizations/ELInterpreterTagSetters.java | 19 +-
 .../jasper/resources/LocalStrings.properties   |  9 +
 .../apache/tomcat/util/buf/LocalStrings.properties |  3 ++
 java/org/apache/tomcat/util/buf/StringCache.java   |  6 ++--
 java/org/apache/tomcat/util/digester/Digester.java |  2 +-
 

(tomcat) branch main updated: Localization for debug strings

2024-02-12 Thread remm
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 8773b42935 Localization for debug strings
8773b42935 is described below

commit 8773b429355d6ff5d05064774492d8a05aac118f
Author: remm 
AuthorDate: Mon Feb 12 11:19:54 2024 +0100

Localization for debug strings

Since debug is now more significant.
---
 .../catalina/authenticator/AuthenticatorBase.java  | 33 +-
 .../catalina/authenticator/FormAuthenticator.java  | 40 +++---
 .../catalina/authenticator/LocalStrings.properties | 12 +++
 .../authenticator/NonLoginAuthenticator.java   |  4 +--
 .../catalina/authenticator/SSLAuthenticator.java   |  8 ++---
 .../apache/catalina/connector/CoyoteAdapter.java   |  4 +--
 java/org/apache/catalina/core/ContainerBase.java   |  2 +-
 .../apache/catalina/core/LocalStrings.properties   |  6 
 .../catalina/core/NamingContextListener.java   | 16 +
 .../core/ThreadLocalLeakPreventionListener.java|  4 ++-
 .../catalina/filters/CsrfPreventionFilter.java | 40 ++
 .../catalina/filters/LocalStrings.properties   |  4 +++
 .../catalina/ha/session/ClusterManagerBase.java|  4 ++-
 .../catalina/ha/session/LocalStrings.properties|  2 ++
 .../apache/catalina/ha/tcp/LocalStrings.properties |  3 ++
 .../apache/catalina/ha/tcp/SimpleTcpCluster.java   |  8 ++---
 .../mbeans/GlobalResourcesLifecycleListener.java   |  2 +-
 .../apache/catalina/mbeans/LocalStrings.properties |  1 +
 .../catalina/realm/JAASMemoryLoginModule.java  |  2 +-
 java/org/apache/catalina/realm/JNDIRealm.java  |  8 ++---
 .../apache/catalina/realm/LocalStrings.properties  |  2 ++
 java/org/apache/catalina/realm/RealmBase.java  |  2 +-
 java/org/apache/catalina/session/FileStore.java|  2 +-
 .../catalina/session/LocalStrings.properties   |  3 ++
 java/org/apache/catalina/session/ManagerBase.java  |  8 ++---
 .../apache/catalina/session/StandardManager.java   |  4 +--
 java/org/apache/catalina/startup/Catalina.java |  8 ++---
 .../org/apache/catalina/startup/ContextConfig.java |  7 ++--
 .../startup/CopyParentClassLoaderRule.java |  4 +--
 java/org/apache/catalina/startup/HostConfig.java   |  4 +--
 .../catalina/startup/LocalStrings.properties   |  8 +
 .../group/interceptors/LocalStrings.properties |  1 +
 .../group/interceptors/TcpFailureDetector.java |  2 +-
 .../group/interceptors/TcpPingInterceptor.java |  4 +--
 .../tribes/membership/LocalStrings.properties  |  6 
 .../tribes/membership/McastServiceImpl.java| 18 ++
 .../tribes/tipis/AbstractReplicatedMap.java| 12 +++
 .../catalina/tribes/tipis/LocalStrings.properties  |  6 +++-
 .../catalina/tribes/tipis/ReplicatedMap.java   |  2 +-
 .../tribes/transport/LocalStrings.properties   |  1 +
 .../catalina/tribes/transport/ReceiverBase.java|  2 +-
 .../tribes/transport/nio/LocalStrings.properties   |  3 ++
 .../catalina/tribes/transport/nio/NioReceiver.java | 10 +++---
 .../tribes/transport/nio/NioReplicationTask.java   |  2 +-
 .../tribes/transport/nio/ParallelNioSender.java|  2 +-
 .../catalina/users/DataSourceUserDatabase.java |  6 ++--
 .../apache/catalina/users/LocalStrings.properties  |  1 +
 .../apache/catalina/valves/ErrorReportValve.java   |  2 +-
 .../catalina/valves/ExtendedAccessLogValve.java|  4 +--
 .../catalina/valves/JsonErrorReportValve.java  |  2 +-
 .../catalina/valves/LoadBalancerDrainingValve.java |  5 ++-
 .../apache/catalina/valves/LocalStrings.properties |  7 
 .../catalina/valves/ProxyErrorReportValve.java |  2 +-
 .../catalina/valves/StuckThreadDetectionValve.java |  2 +-
 .../valves/rewrite/LocalStrings.properties |  2 ++
 .../catalina/valves/rewrite/RewriteValve.java  |  9 ++---
 java/org/apache/coyote/AbstractProcessor.java  |  2 +-
 java/org/apache/coyote/LocalStrings.properties |  1 +
 java/org/apache/coyote/ajp/AjpProcessor.java   |  4 +--
 java/org/apache/coyote/ajp/LocalStrings.properties |  2 ++
 .../coyote/http11/filters/GzipOutputFilter.java|  4 ++-
 .../coyote/http11/filters/LocalStrings.properties  |  2 ++
 java/org/apache/jasper/JspC.java   | 11 +++---
 java/org/apache/jasper/compiler/AntCompiler.java   |  3 +-
 java/org/apache/jasper/compiler/Compiler.java  |  3 +-
 java/org/apache/jasper/compiler/JDTCompiler.java   |  3 +-
 java/org/apache/jasper/compiler/JspReader.java |  2 +-
 .../optimizations/ELInterpreterTagSetters.java | 19 +-
 .../jasper/resources/LocalStrings.properties   |  9 +
 .../apache/tomcat/util/buf/LocalStrings.properties |  3 ++
 java/org/apache/tomcat/util/buf/StringCache.java   |  6 ++--
 java/org/apache/tomcat/util/digester/Digester.java |  2 +-