(tomcat) branch main updated: Fix BZ 68124

2023-11-20 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 5c93608da1 Fix BZ 68124
5c93608da1 is described below

commit 5c93608da1e75066e4c4bb70dcda495e944261a7
Author: lihan 
AuthorDate: Mon Nov 20 18:16:26 2023 +0800

Fix BZ 68124

https://bz.apache.org/bugzilla/show_bug.cgi?id=68124
---
 webapps/docs/appdev/sample/sample.war | Bin 4606 -> 4704 bytes
 webapps/docs/changelog.xml|   3 +++
 2 files changed, 3 insertions(+)

diff --git a/webapps/docs/appdev/sample/sample.war 
b/webapps/docs/appdev/sample/sample.war
index 0a127e6bd1..b879399810 100644
Binary files a/webapps/docs/appdev/sample/sample.war and 
b/webapps/docs/appdev/sample/sample.war differ
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 6140c4dbdf..8ac8b81fa3 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -126,6 +126,9 @@
   
 Update the OWB module to Apache OpenWebBeans 4.0.0. (remm)
   
+  
+68124: Migrate sample.war from javax to jakarta. (lihan)
+  
 
   
 


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

2023-11-20 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 c8e3b5e721 Fix BZ 68124
c8e3b5e721 is described below

commit c8e3b5e721d5e67fa1fe42eef03bc5e378af6f4e
Author: lihan 
AuthorDate: Mon Nov 20 18:16:26 2023 +0800

Fix BZ 68124

https://bz.apache.org/bugzilla/show_bug.cgi?id=68124
---
 webapps/docs/appdev/sample/sample.war | Bin 4606 -> 4704 bytes
 webapps/docs/changelog.xml|   7 +++
 2 files changed, 7 insertions(+)

diff --git a/webapps/docs/appdev/sample/sample.war 
b/webapps/docs/appdev/sample/sample.war
index 0a127e6bd1..b879399810 100644
Binary files a/webapps/docs/appdev/sample/sample.war and 
b/webapps/docs/appdev/sample/sample.war differ
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 93bf4d1104..93e5bba5d0 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -113,6 +113,13 @@
   
 
   
+  
+
+  
+68124: Migrate sample.war from javax to jakarta. (lihan)
+  
+
+  
 
 
   


-
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 Nio/Nio2Channel's toString() throwing NPE in some cases (#671)

2023-10-25 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 9b3c28da7e Fix Nio/Nio2Channel's toString() throwing NPE in some cases 
(#671)
9b3c28da7e is described below

commit 9b3c28da7ec8ddbd721b127f7f3b0a7d475ab797
Author: chenggwang <90715678+chenggw...@users.noreply.github.com>
AuthorDate: Thu Oct 26 10:33:14 2023 +0800

Fix Nio/Nio2Channel's toString() throwing NPE in some cases (#671)

* Fix NioChannel and Nio2Channel's toString() throwing NPE in some cases

NioChannel's toString() causes NioEndpoint's setSocketOptions method to 
throw a NullPointerException in some scenarios (e.g. idea breakpoint debugging).

(cherry picked from commit 3ef8fb6fb6fda60dce304ba4842a5b32dc28b459)
---
 java/org/apache/tomcat/util/net/Nio2Channel.java | 2 +-
 java/org/apache/tomcat/util/net/NioChannel.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/Nio2Channel.java 
b/java/org/apache/tomcat/util/net/Nio2Channel.java
index a2612fd0c1..181f12913c 100644
--- a/java/org/apache/tomcat/util/net/Nio2Channel.java
+++ b/java/org/apache/tomcat/util/net/Nio2Channel.java
@@ -136,7 +136,7 @@ public class Nio2Channel implements AsynchronousByteChannel 
{
 
 @Override
 public String toString() {
-return super.toString() + ":" + sc.toString();
+return super.toString() + ":" + sc;
 }
 
 @Override
diff --git a/java/org/apache/tomcat/util/net/NioChannel.java 
b/java/org/apache/tomcat/util/net/NioChannel.java
index 8e3cb4f0e1..96493ed75a 100644
--- a/java/org/apache/tomcat/util/net/NioChannel.java
+++ b/java/org/apache/tomcat/util/net/NioChannel.java
@@ -203,7 +203,7 @@ public class NioChannel implements ByteChannel, 
ScatteringByteChannel, Gathering
 
 @Override
 public String toString() {
-return super.toString() + ":" + sc.toString();
+return super.toString() + ":" + sc;
 }
 
 public int getOutboundRemaining() {


-
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 Nio/Nio2Channel's toString() throwing NPE in some cases (#671)

2023-10-25 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 ea7db77568 Fix Nio/Nio2Channel's toString() throwing NPE in some cases 
(#671)
ea7db77568 is described below

commit ea7db77568b293ad371969d9ee034b39a668b8b9
Author: chenggwang <90715678+chenggw...@users.noreply.github.com>
AuthorDate: Thu Oct 26 10:33:14 2023 +0800

Fix Nio/Nio2Channel's toString() throwing NPE in some cases (#671)

* Fix NioChannel and Nio2Channel's toString() throwing NPE in some cases

NioChannel's toString() causes NioEndpoint's setSocketOptions method to 
throw a NullPointerException in some scenarios (e.g. idea breakpoint debugging).

(cherry picked from commit 3ef8fb6fb6fda60dce304ba4842a5b32dc28b459)
---
 java/org/apache/tomcat/util/net/Nio2Channel.java | 2 +-
 java/org/apache/tomcat/util/net/NioChannel.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/Nio2Channel.java 
b/java/org/apache/tomcat/util/net/Nio2Channel.java
index a2612fd0c1..181f12913c 100644
--- a/java/org/apache/tomcat/util/net/Nio2Channel.java
+++ b/java/org/apache/tomcat/util/net/Nio2Channel.java
@@ -136,7 +136,7 @@ public class Nio2Channel implements AsynchronousByteChannel 
{
 
 @Override
 public String toString() {
-return super.toString() + ":" + sc.toString();
+return super.toString() + ":" + sc;
 }
 
 @Override
diff --git a/java/org/apache/tomcat/util/net/NioChannel.java 
b/java/org/apache/tomcat/util/net/NioChannel.java
index 8e3cb4f0e1..96493ed75a 100644
--- a/java/org/apache/tomcat/util/net/NioChannel.java
+++ b/java/org/apache/tomcat/util/net/NioChannel.java
@@ -203,7 +203,7 @@ public class NioChannel implements ByteChannel, 
ScatteringByteChannel, Gathering
 
 @Override
 public String toString() {
-return super.toString() + ":" + sc.toString();
+return super.toString() + ":" + sc;
 }
 
 public int getOutboundRemaining() {


-
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 Nio/Nio2Channel's toString() throwing NPE in some cases (#671)

2023-10-25 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 011860ca74 Fix Nio/Nio2Channel's toString() throwing NPE in some cases 
(#671)
011860ca74 is described below

commit 011860ca7461fcb26cb464f751792db7bb2886da
Author: chenggwang <90715678+chenggw...@users.noreply.github.com>
AuthorDate: Thu Oct 26 10:33:14 2023 +0800

Fix Nio/Nio2Channel's toString() throwing NPE in some cases (#671)

* Fix NioChannel and Nio2Channel's toString() throwing NPE in some cases

NioChannel's toString() causes NioEndpoint's setSocketOptions method to 
throw a NullPointerException in some scenarios (e.g. idea breakpoint debugging).

(cherry picked from commit 3ef8fb6fb6fda60dce304ba4842a5b32dc28b459)
---
 java/org/apache/tomcat/util/net/Nio2Channel.java | 2 +-
 java/org/apache/tomcat/util/net/NioChannel.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/Nio2Channel.java 
b/java/org/apache/tomcat/util/net/Nio2Channel.java
index 603c43f416..be816eb280 100644
--- a/java/org/apache/tomcat/util/net/Nio2Channel.java
+++ b/java/org/apache/tomcat/util/net/Nio2Channel.java
@@ -136,7 +136,7 @@ public class Nio2Channel implements AsynchronousByteChannel 
{
 
 @Override
 public String toString() {
-return super.toString() + ":" + sc.toString();
+return super.toString() + ":" + sc;
 }
 
 @Override
diff --git a/java/org/apache/tomcat/util/net/NioChannel.java 
b/java/org/apache/tomcat/util/net/NioChannel.java
index d263ce9ae6..6ddf5637f0 100644
--- a/java/org/apache/tomcat/util/net/NioChannel.java
+++ b/java/org/apache/tomcat/util/net/NioChannel.java
@@ -185,7 +185,7 @@ public class NioChannel implements ByteChannel, 
ScatteringByteChannel, Gathering
 
 @Override
 public String toString() {
-return super.toString() + ":" + sc.toString();
+return super.toString() + ":" + sc;
 }
 
 public int getOutboundRemaining() {


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



[tomcat] branch main updated: Fix Nio/Nio2Channel's toString() throwing NPE in some cases (#671)

2023-10-25 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 3ef8fb6fb6 Fix Nio/Nio2Channel's toString() throwing NPE in some cases 
(#671)
3ef8fb6fb6 is described below

commit 3ef8fb6fb6fda60dce304ba4842a5b32dc28b459
Author: chenggwang <90715678+chenggw...@users.noreply.github.com>
AuthorDate: Thu Oct 26 10:33:14 2023 +0800

Fix Nio/Nio2Channel's toString() throwing NPE in some cases (#671)

* Fix NioChannel and Nio2Channel's toString() throwing NPE in some cases

NioChannel's toString() causes NioEndpoint's setSocketOptions method to 
throw a NullPointerException in some scenarios (e.g. idea breakpoint debugging).
---
 java/org/apache/tomcat/util/net/Nio2Channel.java | 2 +-
 java/org/apache/tomcat/util/net/NioChannel.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/Nio2Channel.java 
b/java/org/apache/tomcat/util/net/Nio2Channel.java
index 603c43f416..be816eb280 100644
--- a/java/org/apache/tomcat/util/net/Nio2Channel.java
+++ b/java/org/apache/tomcat/util/net/Nio2Channel.java
@@ -136,7 +136,7 @@ public class Nio2Channel implements AsynchronousByteChannel 
{
 
 @Override
 public String toString() {
-return super.toString() + ":" + sc.toString();
+return super.toString() + ":" + sc;
 }
 
 @Override
diff --git a/java/org/apache/tomcat/util/net/NioChannel.java 
b/java/org/apache/tomcat/util/net/NioChannel.java
index d263ce9ae6..6ddf5637f0 100644
--- a/java/org/apache/tomcat/util/net/NioChannel.java
+++ b/java/org/apache/tomcat/util/net/NioChannel.java
@@ -185,7 +185,7 @@ public class NioChannel implements ByteChannel, 
ScatteringByteChannel, Gathering
 
 @Override
 public String toString() {
-return super.toString() + ":" + sc.toString();
+return super.toString() + ":" + sc;
 }
 
 public int getOutboundRemaining() {


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



[tomcat] branch main updated: Fix typo.

2023-10-25 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 7400288181 Fix typo.
7400288181 is described below

commit 74002881816ff47dbfa0430962f12a63a93891f4
Author: lihan 
AuthorDate: Thu Oct 26 10:26:10 2023 +0800

Fix typo.
---
 java/jakarta/el/RecordELResolver.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/jakarta/el/RecordELResolver.java 
b/java/jakarta/el/RecordELResolver.java
index 55ba2f5baf..0f21bb1e38 100644
--- a/java/jakarta/el/RecordELResolver.java
+++ b/java/jakarta/el/RecordELResolver.java
@@ -23,7 +23,7 @@ import java.util.Objects;
  * Defines property resolution behavior on instances of {@link Record}.
  * 
  * The resolver handles base objects of type {@link Record}. It accepts any 
non-{@code null} object as a property and coerces it to a
- * String using {@link Object#toString()}. The property string is used to find 
find an accessor method for a field
+ * String using {@link Object#toString()}. The property string is used to find 
an accessor method for a field
  * with the same name.
  * 
  * This resolver is always read-only since {@link Record}s are always 
read-only.


-
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: Correct exception message.

2023-10-24 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 9663a8fad0 Correct exception message.
9663a8fad0 is described below

commit 9663a8fad03790107e7ebce8f747270b2a508e1c
Author: lihan 
AuthorDate: Wed Oct 25 09:53:56 2023 +0800

Correct exception message.

(cherry picked from commit 76ac8d1b55ba5c2ca08827d793bcf6e20d6c9e4e)
---
 java/org/apache/tomcat/util/net/jsse/PEMFile.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/jsse/PEMFile.java 
b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
index 71db800680..a136bef6a6 100644
--- a/java/org/apache/tomcat/util/net/jsse/PEMFile.java
+++ b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
@@ -404,7 +404,7 @@ public class PEMFile {
 byte[] oidPRF = p.parseOIDAsBytes();
 String prf = OID_TO_PRF.get(HexUtils.toHexString(oidPRF));
 if (prf == null) {
-throw new 
NoSuchAlgorithmException(sm.getString("pemFile.unknownPrfAlgorithm", prf));
+throw new 
NoSuchAlgorithmException(sm.getString("pemFile.unknownPrfAlgorithm", 
HexUtils.toHexString(oidPRF)));
 }
 p.parseNull();
 


-
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: Correct exception message.

2023-10-24 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 bec7a51d7f Correct exception message.
bec7a51d7f is described below

commit bec7a51d7fc3fb913c755b258169d1816b77bea5
Author: lihan 
AuthorDate: Wed Oct 25 09:53:56 2023 +0800

Correct exception message.

(cherry picked from commit 76ac8d1b55ba5c2ca08827d793bcf6e20d6c9e4e)
---
 java/org/apache/tomcat/util/net/jsse/PEMFile.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/jsse/PEMFile.java 
b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
index b051c539ea..b3f60ce0db 100644
--- a/java/org/apache/tomcat/util/net/jsse/PEMFile.java
+++ b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
@@ -406,7 +406,7 @@ public class PEMFile {
 byte[] oidPRF = p.parseOIDAsBytes();
 String prf = OID_TO_PRF.get(HexUtils.toHexString(oidPRF));
 if (prf == null) {
-throw new 
NoSuchAlgorithmException(sm.getString("pemFile.unknownPrfAlgorithm", prf));
+throw new 
NoSuchAlgorithmException(sm.getString("pemFile.unknownPrfAlgorithm", 
HexUtils.toHexString(oidPRF)));
 }
 p.parseNull();
 


-
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: Correct exception message.

2023-10-24 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 9ced1b8edb Correct exception message.
9ced1b8edb is described below

commit 9ced1b8edbac631f47b976e2867b9c4e7d76534c
Author: lihan 
AuthorDate: Wed Oct 25 09:53:56 2023 +0800

Correct exception message.

(cherry picked from commit 76ac8d1b55ba5c2ca08827d793bcf6e20d6c9e4e)
---
 java/org/apache/tomcat/util/net/jsse/PEMFile.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/jsse/PEMFile.java 
b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
index b051c539ea..b3f60ce0db 100644
--- a/java/org/apache/tomcat/util/net/jsse/PEMFile.java
+++ b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
@@ -406,7 +406,7 @@ public class PEMFile {
 byte[] oidPRF = p.parseOIDAsBytes();
 String prf = OID_TO_PRF.get(HexUtils.toHexString(oidPRF));
 if (prf == null) {
-throw new 
NoSuchAlgorithmException(sm.getString("pemFile.unknownPrfAlgorithm", prf));
+throw new 
NoSuchAlgorithmException(sm.getString("pemFile.unknownPrfAlgorithm", 
HexUtils.toHexString(oidPRF)));
 }
 p.parseNull();
 


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



[tomcat] branch main updated: Correct exception message.

2023-10-24 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 76ac8d1b55 Correct exception message.
76ac8d1b55 is described below

commit 76ac8d1b55ba5c2ca08827d793bcf6e20d6c9e4e
Author: lihan 
AuthorDate: Wed Oct 25 09:53:56 2023 +0800

Correct exception message.
---
 java/org/apache/tomcat/util/net/jsse/PEMFile.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/jsse/PEMFile.java 
b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
index b051c539ea..b3f60ce0db 100644
--- a/java/org/apache/tomcat/util/net/jsse/PEMFile.java
+++ b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
@@ -406,7 +406,7 @@ public class PEMFile {
 byte[] oidPRF = p.parseOIDAsBytes();
 String prf = OID_TO_PRF.get(HexUtils.toHexString(oidPRF));
 if (prf == null) {
-throw new 
NoSuchAlgorithmException(sm.getString("pemFile.unknownPrfAlgorithm", prf));
+throw new 
NoSuchAlgorithmException(sm.getString("pemFile.unknownPrfAlgorithm", 
HexUtils.toHexString(oidPRF)));
 }
 p.parseNull();
 


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



[tomcat] branch main updated: Fix typo.

2023-10-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 2fab725c2e Fix typo.
2fab725c2e is described below

commit 2fab725c2e8f7d7653617a25e831d3be4726eee0
Author: lihan 
AuthorDate: Tue Oct 10 09:52:29 2023 +0800

Fix typo.
---
 java/org/apache/catalina/valves/FilterValve.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/valves/FilterValve.java 
b/java/org/apache/catalina/valves/FilterValve.java
index 2ac4ace086..2f47845322 100644
--- a/java/org/apache/catalina/valves/FilterValve.java
+++ b/java/org/apache/catalina/valves/FilterValve.java
@@ -203,7 +203,7 @@ public class FilterValve extends ValveBase implements 
FilterConfig {
 return executor;
 } else {
 throw new UnsupportedOperationException(
-"This ServletContet is not really 
meant to be used.");
+"This ServletContext is not really 
meant to be used.");
 }
 }
 });


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



[tomcat] branch main updated: Fix BZ 67611 - Correct the download link in BUILDING.txt

2023-10-05 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 a0605e86a8 Fix BZ 67611 - Correct the download link in BUILDING.txt
a0605e86a8 is described below

commit a0605e86a8ebcc39e0b72d82a2e2b1840855069c
Author: lihan 
AuthorDate: Fri Oct 6 12:24:44 2023 +0800

Fix BZ 67611 - Correct the download link in BUILDING.txt

https://bz.apache.org/bugzilla/show_bug.cgi?id=67611
---
 BUILDING.txt   | 2 +-
 webapps/docs/changelog.xml | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/BUILDING.txt b/BUILDING.txt
index 5eee8234cc..799b579ba8 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -104,7 +104,7 @@ package.
 
  *  Source packages can be downloaded from:
 
-https://tomcat.apache.org/download-@version_ma...@0.cgi
+https://tomcat.apache.org/download-@VERSION_MAJOR@.cgi
 
 The location where the source has been placed will be further referred as
 ${tomcat.source}.
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index de2e082745..0a8fd38b2b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -208,6 +208,9 @@
   
 Update Commons Pool to 2.12.0. (markt)
   
+  
+67611: Correct the download link in BUILDING.txt. (lihan)
+  
 
   
 


-
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 BZ 67611 - Correct the download link in BUILDING.txt

2023-10-05 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 de99971200 Fix BZ 67611 - Correct the download link in BUILDING.txt
de99971200 is described below

commit de999712000741a42cf4bcd91a8cc43ea2a9a5d8
Author: lihan 
AuthorDate: Fri Oct 6 12:24:44 2023 +0800

Fix BZ 67611 - Correct the download link in BUILDING.txt

https://bz.apache.org/bugzilla/show_bug.cgi?id=67611
---
 BUILDING.txt   | 2 +-
 webapps/docs/changelog.xml | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/BUILDING.txt b/BUILDING.txt
index 5eee8234cc..799b579ba8 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -104,7 +104,7 @@ package.
 
  *  Source packages can be downloaded from:
 
-https://tomcat.apache.org/download-@version_ma...@0.cgi
+https://tomcat.apache.org/download-@VERSION_MAJOR@.cgi
 
 The location where the source has been placed will be further referred as
 ${tomcat.source}.
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8ea4205594..4042c974bf 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -195,6 +195,9 @@
   
 Update Commons Pool to 2.12.0. (markt)
   
+  
+67611: Correct the download link in BUILDING.txt. (lihan)
+  
 
   
 


-
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: Update tool-wrapper.bat (#665)

2023-09-11 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 c61037a8c3 Update tool-wrapper.bat (#665)
c61037a8c3 is described below

commit c61037a8c32ce45e4bfa160a23682d00a3cbfb0a
Author: lihan 
AuthorDate: Mon Sep 11 16:36:14 2023 +0800

Update tool-wrapper.bat (#665)

Solved issue with spaces in path
---
 bin/tool-wrapper.bat | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/tool-wrapper.bat b/bin/tool-wrapper.bat
index 94de4fe326..5d91999fa5 100755
--- a/bin/tool-wrapper.bat
+++ b/bin/tool-wrapper.bat
@@ -105,6 +105,6 @@ shift
 goto setArgs
 :doneSetArgs
 
-%_RUNJAVA% %JAVA_OPTS% %TOOL_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" 
-classpath "%CLASSPATH%" -Dcatalina.home="%CATALINA_HOME%" 
org.apache.catalina.startup.Tool %CMD_LINE_ARGS%
+"%_RUNJAVA%" %JAVA_OPTS% %TOOL_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" 
-classpath "%CLASSPATH%" -Dcatalina.home="%CATALINA_HOME%" 
org.apache.catalina.startup.Tool %CMD_LINE_ARGS%
 
 :end


-
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: Update tool-wrapper.bat (#665)

2023-09-11 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 f2facc3ab4 Update tool-wrapper.bat (#665)
f2facc3ab4 is described below

commit f2facc3ab45da07fa65a17012b851b648c6f5eaa
Author: lihan 
AuthorDate: Mon Sep 11 16:35:36 2023 +0800

Update tool-wrapper.bat (#665)

Solved issue with spaces in path
---
 bin/tool-wrapper.bat | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/tool-wrapper.bat b/bin/tool-wrapper.bat
index 94de4fe326..5d91999fa5 100755
--- a/bin/tool-wrapper.bat
+++ b/bin/tool-wrapper.bat
@@ -105,6 +105,6 @@ shift
 goto setArgs
 :doneSetArgs
 
-%_RUNJAVA% %JAVA_OPTS% %TOOL_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" 
-classpath "%CLASSPATH%" -Dcatalina.home="%CATALINA_HOME%" 
org.apache.catalina.startup.Tool %CMD_LINE_ARGS%
+"%_RUNJAVA%" %JAVA_OPTS% %TOOL_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" 
-classpath "%CLASSPATH%" -Dcatalina.home="%CATALINA_HOME%" 
org.apache.catalina.startup.Tool %CMD_LINE_ARGS%
 
 :end


-
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: Update tool-wrapper.bat (#665)

2023-09-11 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 ea6930eae7 Update tool-wrapper.bat (#665)
ea6930eae7 is described below

commit ea6930eae76921868e634705ebb881db96fff3ef
Author: ChrissW-R1 
AuthorDate: Mon Sep 11 10:33:51 2023 +0200

Update tool-wrapper.bat (#665)

Solved issue with spaces in path

(cherry picked from commit a6acd986aa7b415c6390d578318054f51efbe876)
---
 bin/tool-wrapper.bat | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/tool-wrapper.bat b/bin/tool-wrapper.bat
index 64f38a02a1..e9320d81bc 100755
--- a/bin/tool-wrapper.bat
+++ b/bin/tool-wrapper.bat
@@ -85,6 +85,6 @@ shift
 goto setArgs
 :doneSetArgs
 
-%_RUNJAVA% %JAVA_OPTS% %TOOL_OPTS% -classpath "%CLASSPATH%" 
-Dcatalina.home="%CATALINA_HOME%" org.apache.catalina.startup.Tool 
%CMD_LINE_ARGS%
+"%_RUNJAVA%" %JAVA_OPTS% %TOOL_OPTS% -classpath "%CLASSPATH%" 
-Dcatalina.home="%CATALINA_HOME%" org.apache.catalina.startup.Tool 
%CMD_LINE_ARGS%
 
 :end


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



[tomcat] branch main updated: Update tool-wrapper.bat (#665)

2023-09-11 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 a6acd986aa Update tool-wrapper.bat (#665)
a6acd986aa is described below

commit a6acd986aa7b415c6390d578318054f51efbe876
Author: ChrissW-R1 
AuthorDate: Mon Sep 11 10:33:51 2023 +0200

Update tool-wrapper.bat (#665)

Solved issue with spaces in path
---
 bin/tool-wrapper.bat | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/tool-wrapper.bat b/bin/tool-wrapper.bat
index 64f38a02a1..e9320d81bc 100755
--- a/bin/tool-wrapper.bat
+++ b/bin/tool-wrapper.bat
@@ -85,6 +85,6 @@ shift
 goto setArgs
 :doneSetArgs
 
-%_RUNJAVA% %JAVA_OPTS% %TOOL_OPTS% -classpath "%CLASSPATH%" 
-Dcatalina.home="%CATALINA_HOME%" org.apache.catalina.startup.Tool 
%CMD_LINE_ARGS%
+"%_RUNJAVA%" %JAVA_OPTS% %TOOL_OPTS% -classpath "%CLASSPATH%" 
-Dcatalina.home="%CATALINA_HOME%" org.apache.catalina.startup.Tool 
%CMD_LINE_ARGS%
 
 :end


-
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: Update documentation (#668)

2023-09-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 deb371f854 Update documentation (#668)
deb371f854 is described below

commit deb371f854561fa50598fb57d05ecc35bf5dcc79
Author: marcorobiati <82662790+marcorobi...@users.noreply.github.com>
AuthorDate: Mon Sep 11 04:38:13 2023 +0200

Update documentation (#668)

* Update graal.xml

JMX is now supported as a experimental feature

https://medium.com/graalvm/a-new-graalvm-release-and-new-free-license-4aab483692f5#8501
and the previous github issue related to this was closed long ago as 
resolved https://github.com/oracle/graal/issues/2103

* Update index.xml

remove non existent page and and added missing one

(cherry picked from commit 268b7cc8de7f59f22a2d2aac4df47be7dce192b6)
---
 webapps/docs/graal.xml | 2 --
 webapps/docs/index.xml | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/webapps/docs/graal.xml b/webapps/docs/graal.xml
index 7b776e2119..4534159707 100644
--- a/webapps/docs/graal.xml
+++ b/webapps/docs/graal.xml
@@ -209,8 +209,6 @@ mvn package
   
 Missing items for better Tomcat functionality:
 
-  https://github.com/oracle/graal/issues/2103;>JMX:
-The usual monitoring and management is not usable
   java.util.logging LogManager: Configuration through a system property
 is not implemented, so standard java.util.logging must be used instead
 of JULI
diff --git a/webapps/docs/index.xml b/webapps/docs/index.xml
index 947ac14376..1ea22a717d 100644
--- a/webapps/docs/index.xml
+++ b/webapps/docs/index.xml
@@ -125,8 +125,6 @@ Apache Tomcat, and using many of the Apache Tomcat 
features.
 Configuring virtual hosting in Apache Tomcat.
 Advanced IO -
 Extensions available over regular, blocking IO.
-Additional Components -
-Obtaining additional, optional components.
 Using Tomcat libraries with 
Maven -
 Obtaining Tomcat jars through Maven.
 Security Considerations 
-
@@ -143,6 +141,8 @@ Apache Tomcat, and using many of the Apache Tomcat 
features.
 Using the regexp based rewrite valve for conditional URL and host 
rewrite.
 CDI and JAX-RS support -
 Configuring CDI,JAX-RS and Eclipse Microprofile support.
+AOT compilation support -
+Ahead of Time compilation support with GraalVM/Native Image.
 
 
 


-
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: Update documentation (#668)

2023-09-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 2270b0f231 Update documentation (#668)
2270b0f231 is described below

commit 2270b0f2310cc6b3ed4c45cda47c7424c5829028
Author: marcorobiati <82662790+marcorobi...@users.noreply.github.com>
AuthorDate: Mon Sep 11 04:38:13 2023 +0200

Update documentation (#668)

* Update graal.xml

JMX is now supported as a experimental feature

https://medium.com/graalvm/a-new-graalvm-release-and-new-free-license-4aab483692f5#8501
and the previous github issue related to this was closed long ago as 
resolved https://github.com/oracle/graal/issues/2103

* Update index.xml

remove non existent page and and added missing one

(cherry picked from commit 268b7cc8de7f59f22a2d2aac4df47be7dce192b6)
---
 webapps/docs/graal.xml | 2 --
 webapps/docs/index.xml | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/webapps/docs/graal.xml b/webapps/docs/graal.xml
index 385db171ae..d427898c07 100644
--- a/webapps/docs/graal.xml
+++ b/webapps/docs/graal.xml
@@ -209,8 +209,6 @@ mvn package
   
 Missing items for better Tomcat functionality:
 
-  https://github.com/oracle/graal/issues/2103;>JMX:
-The usual monitoring and management is not usable
   java.util.logging LogManager: Configuration through a system property
 is not implemented, so standard java.util.logging must be used instead
 of JULI
diff --git a/webapps/docs/index.xml b/webapps/docs/index.xml
index 835097d5e6..1853658d73 100644
--- a/webapps/docs/index.xml
+++ b/webapps/docs/index.xml
@@ -124,8 +124,6 @@ Apache Tomcat, and using many of the Apache Tomcat 
features.
 Configuring virtual hosting in Apache Tomcat.
 Advanced IO -
 Extensions available over regular, blocking IO.
-Additional Components -
-Obtaining additional, optional components.
 Using Tomcat libraries with 
Maven -
 Obtaining Tomcat jars through Maven.
 Security Considerations 
-
@@ -142,6 +140,8 @@ Apache Tomcat, and using many of the Apache Tomcat 
features.
 Using the regexp based rewrite valve for conditional URL and host 
rewrite.
 CDI and JAX-RS support -
 Configuring CDI,JAX-RS and Eclipse Microprofile support.
+AOT compilation support -
+Ahead of Time compilation support with GraalVM/Native Image.
 
 
 


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



[tomcat] branch main updated: Update documentation (#668)

2023-09-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 268b7cc8de Update documentation (#668)
268b7cc8de is described below

commit 268b7cc8de7f59f22a2d2aac4df47be7dce192b6
Author: marcorobiati <82662790+marcorobi...@users.noreply.github.com>
AuthorDate: Mon Sep 11 04:38:13 2023 +0200

Update documentation (#668)

* Update graal.xml

JMX is now supported as a experimental feature

https://medium.com/graalvm/a-new-graalvm-release-and-new-free-license-4aab483692f5#8501
and the previous github issue related to this was closed long ago as 
resolved https://github.com/oracle/graal/issues/2103

* Update index.xml

remove non existent page and and added missing one
---
 webapps/docs/graal.xml | 2 --
 webapps/docs/index.xml | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/webapps/docs/graal.xml b/webapps/docs/graal.xml
index 385db171ae..d427898c07 100644
--- a/webapps/docs/graal.xml
+++ b/webapps/docs/graal.xml
@@ -209,8 +209,6 @@ mvn package
   
 Missing items for better Tomcat functionality:
 
-  https://github.com/oracle/graal/issues/2103;>JMX:
-The usual monitoring and management is not usable
   java.util.logging LogManager: Configuration through a system property
 is not implemented, so standard java.util.logging must be used instead
 of JULI
diff --git a/webapps/docs/index.xml b/webapps/docs/index.xml
index ee5067cd25..e41a1b2649 100644
--- a/webapps/docs/index.xml
+++ b/webapps/docs/index.xml
@@ -120,8 +120,6 @@ Apache Tomcat, and using many of the Apache Tomcat 
features.
 Configuring virtual hosting in Apache Tomcat.
 Advanced IO -
 Extensions available over regular, blocking IO.
-Additional Components -
-Obtaining additional, optional components.
 Using Tomcat libraries with 
Maven -
 Obtaining Tomcat jars through Maven.
 Security Considerations 
-
@@ -138,6 +136,8 @@ Apache Tomcat, and using many of the Apache Tomcat 
features.
 Using the regexp based rewrite valve for conditional URL and host 
rewrite.
 CDI and JAX-RS support -
 Configuring CDI,JAX-RS and Eclipse Microprofile support.
+AOT compilation support -
+Ahead of Time compilation support with GraalVM/Native Image.
 
 
 


-
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: Refactor Request::getSession() to invoke Request::getSession(true) internally. (#648)

2023-09-05 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 2cd8eff7b5 Refactor Request::getSession() to invoke 
Request::getSession(true) internally. (#648)
2cd8eff7b5 is described below

commit 2cd8eff7b587504d1afc89b8af6d92862e605904
Author: xxeol2 
AuthorDate: Tue Sep 5 15:07:23 2023 +0900

Refactor Request::getSession() to invoke Request::getSession(true) 
internally. (#648)

Refactor Request::getSession() to invoke Request::getSession(true) 
internally to eliminate code redundancy.

(cherry picked from commit d0b655d8316bcef78b84255a9d8ee2f7cd78d649)
---
 java/org/apache/catalina/connector/Request.java | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index cebd50640c..40ec9d9c07 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -2395,12 +2395,7 @@ public class Request implements HttpServletRequest {
  */
 @Override
 public HttpSession getSession() {
-Session session = doGetSession(true);
-if (session == null) {
-return null;
-}
-
-return session.getSession();
+return getSession(true);
 }
 
 


-
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: Refactor Request::getSession() to invoke Request::getSession(true) internally. (#648)

2023-09-05 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 e51b6709bf Refactor Request::getSession() to invoke 
Request::getSession(true) internally. (#648)
e51b6709bf is described below

commit e51b6709bf50c59ea2a77111337abb9c114393ff
Author: xxeol2 
AuthorDate: Tue Sep 5 15:07:23 2023 +0900

Refactor Request::getSession() to invoke Request::getSession(true) 
internally. (#648)

Refactor Request::getSession() to invoke Request::getSession(true) 
internally to eliminate code redundancy.

(cherry picked from commit d0b655d8316bcef78b84255a9d8ee2f7cd78d649)
---
 java/org/apache/catalina/connector/Request.java | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 619dfc34fd..a38aad0d23 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -2404,12 +2404,7 @@ public class Request implements HttpServletRequest {
  */
 @Override
 public HttpSession getSession() {
-Session session = doGetSession(true);
-if (session == null) {
-return null;
-}
-
-return session.getSession();
+return getSession(true);
 }
 
 


-
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: Refactor Request::getSession() to invoke Request::getSession(true) internally. (#648)

2023-09-05 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 a95d18861c Refactor Request::getSession() to invoke 
Request::getSession(true) internally. (#648)
a95d18861c is described below

commit a95d18861ccaa30a4264bcf97fb3e8a2e0f06de9
Author: xxeol2 
AuthorDate: Tue Sep 5 15:07:23 2023 +0900

Refactor Request::getSession() to invoke Request::getSession(true) 
internally. (#648)

Refactor Request::getSession() to invoke Request::getSession(true) 
internally to eliminate code redundancy.

(cherry picked from commit d0b655d8316bcef78b84255a9d8ee2f7cd78d649)
---
 java/org/apache/catalina/connector/Request.java | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index a0748b1774..a407ecdb79 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -2366,12 +2366,7 @@ public class Request implements HttpServletRequest {
  */
 @Override
 public HttpSession getSession() {
-Session session = doGetSession(true);
-if (session == null) {
-return null;
-}
-
-return session.getSession();
+return getSession(true);
 }
 
 


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



[tomcat] branch main updated: Refactor Request::getSession() to invoke Request::getSession(false) internally. (#648)

2023-09-05 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 d0b655d831 Refactor Request::getSession() to invoke 
Request::getSession(false) internally. (#648)
d0b655d831 is described below

commit d0b655d8316bcef78b84255a9d8ee2f7cd78d649
Author: xxeol2 
AuthorDate: Tue Sep 5 15:07:23 2023 +0900

Refactor Request::getSession() to invoke Request::getSession(false) 
internally. (#648)

Refactor Request::getSession() to invoke Request::getSession(false) 
internally to eliminate code redundancy.
---
 java/org/apache/catalina/connector/Request.java | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 82fea929f8..a9ba406047 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -2288,12 +2288,7 @@ public class Request implements HttpServletRequest {
  */
 @Override
 public HttpSession getSession() {
-Session session = doGetSession(true);
-if (session == null) {
-return null;
-}
-
-return session.getSession();
+return getSession(true);
 }
 
 


-
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 javadoc and documentation.

2023-08-31 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 5d6e0ea5c8 Fix javadoc and documentation.
5d6e0ea5c8 is described below

commit 5d6e0ea5c86c43110e3efeeb4d2cc110131c8b3a
Author: lihan 
AuthorDate: Fri Sep 1 10:43:45 2023 +0800

Fix javadoc and documentation.

Update the default value of 'socket.processorCache' and 'socket.eventCache' 
in the documentation and javadoc. And remove 'socket.keyCache' from the AJP 
documentation.

(cherry picked from commit ca095d52c98c2e25005990a9ef02240a823f0334)
---
 java/org/apache/tomcat/util/net/SocketProperties.java |  8 
 webapps/docs/config/ajp.xml   | 13 +++--
 webapps/docs/config/http.xml  |  2 +-
 3 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/SocketProperties.java 
b/java/org/apache/tomcat/util/net/SocketProperties.java
index 1cdb2c6302..b91d54f0e2 100644
--- a/java/org/apache/tomcat/util/net/SocketProperties.java
+++ b/java/org/apache/tomcat/util/net/SocketProperties.java
@@ -36,7 +36,7 @@ public class SocketProperties {
 /**
  * Enable/disable socket processor cache, this bounded cache stores
  * SocketProcessor objects to reduce GC
- * Default is 500
+ * Default is 0
  * -1 is unlimited
  * 0 is disabled
  */
@@ -45,7 +45,7 @@ public class SocketProperties {
 /**
  * Enable/disable poller event cache, this bounded cache stores
  * PollerEvent objects to reduce GC for the poller
- * Default is 500
+ * Default is 0
  * -1 is unlimited
  * 0 is disabled
  * 0 the max number of objects to keep in cache.
@@ -78,13 +78,13 @@ public class SocketProperties {
 
 /**
  * The application read buffer size in bytes.
- * Default value is rxBufSize
+ * Default value is 8192
  */
 protected int appReadBufSize = 8192;
 
 /**
  * The application write buffer size in bytes
- * Default value is txBufSize
+ * Default value is 8192
  */
 protected int appWriteBufSize = 8192;
 
diff --git a/webapps/docs/config/ajp.xml b/webapps/docs/config/ajp.xml
index b704c9e733..aff9f44a6a 100644
--- a/webapps/docs/config/ajp.xml
+++ b/webapps/docs/config/ajp.xml
@@ -724,21 +724,14 @@
   
 (int)Tomcat will cache SocketProcessor objects to reduce garbage
 collection. The integer value specifies how many objects to keep in the
-cache at most. The default is 500. Other values are
--1 for unlimited cache and 0 for no 
cache.
-  
-
-  
-(int)Tomcat will cache KeyAttachment objects to reduce garbage
-collection. The integer value specifies how many objects to keep in the
-cache at most. The default is 500. Other values are
+cache at most. The default is 0. Other values are
 -1 for unlimited cache and 0 for no 
cache.
   
 
   
 (int)Tomcat will cache PollerEvent objects to reduce garbage
 collection. The integer value specifies how many objects to keep in the
-cache at most. The default is 500. Other values are
+cache at most. The default is 0. Other values are
 -1 for unlimited cache and 0 for no 
cache.
   
 
@@ -798,7 +791,7 @@
   
 (int)Tomcat will cache SocketProcessor objects to reduce garbage
 collection. The integer value specifies how many objects to keep in the
-cache at most. The default is 500. Other values are
+cache at most. The default is 0. Other values are
 -1 for unlimited cache and 0 for no 
cache.
   
 
diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index 6f71e36dd0..30101b80d8 100644
--- a/webapps/docs/config/http.xml
+++ b/webapps/docs/config/http.xml
@@ -1033,7 +1033,7 @@
   
 (int)Tomcat will cache SocketProcessor objects to reduce garbage
 collection. The integer value specifies how many objects to keep in the
-cache at most. The default is 500. Other values are
+cache at most. The default is 0. Other values are
 -1 for unlimited cache and 0 for no 
cache.
   
 


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



[tomcat] branch main updated: Fix javadoc and documentation.

2023-08-31 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 ca095d52c9 Fix javadoc and documentation.
ca095d52c9 is described below

commit ca095d52c98c2e25005990a9ef02240a823f0334
Author: lihan 
AuthorDate: Fri Sep 1 10:43:45 2023 +0800

Fix javadoc and documentation.

Update the default value of 'socket.processorCache' and 'socket.eventCache' 
in the documentation and javadoc. And remove 'socket.keyCache' from the AJP 
documentation.
---
 java/org/apache/tomcat/util/net/SocketProperties.java |  8 
 webapps/docs/config/ajp.xml   | 13 +++--
 webapps/docs/config/http.xml  |  2 +-
 3 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/SocketProperties.java 
b/java/org/apache/tomcat/util/net/SocketProperties.java
index 1cdb2c6302..b91d54f0e2 100644
--- a/java/org/apache/tomcat/util/net/SocketProperties.java
+++ b/java/org/apache/tomcat/util/net/SocketProperties.java
@@ -36,7 +36,7 @@ public class SocketProperties {
 /**
  * Enable/disable socket processor cache, this bounded cache stores
  * SocketProcessor objects to reduce GC
- * Default is 500
+ * Default is 0
  * -1 is unlimited
  * 0 is disabled
  */
@@ -45,7 +45,7 @@ public class SocketProperties {
 /**
  * Enable/disable poller event cache, this bounded cache stores
  * PollerEvent objects to reduce GC for the poller
- * Default is 500
+ * Default is 0
  * -1 is unlimited
  * 0 is disabled
  * 0 the max number of objects to keep in cache.
@@ -78,13 +78,13 @@ public class SocketProperties {
 
 /**
  * The application read buffer size in bytes.
- * Default value is rxBufSize
+ * Default value is 8192
  */
 protected int appReadBufSize = 8192;
 
 /**
  * The application write buffer size in bytes
- * Default value is txBufSize
+ * Default value is 8192
  */
 protected int appWriteBufSize = 8192;
 
diff --git a/webapps/docs/config/ajp.xml b/webapps/docs/config/ajp.xml
index 6eda243d89..bc85a734b3 100644
--- a/webapps/docs/config/ajp.xml
+++ b/webapps/docs/config/ajp.xml
@@ -720,21 +720,14 @@
   
 (int)Tomcat will cache SocketProcessor objects to reduce garbage
 collection. The integer value specifies how many objects to keep in the
-cache at most. The default is 500. Other values are
--1 for unlimited cache and 0 for no 
cache.
-  
-
-  
-(int)Tomcat will cache KeyAttachment objects to reduce garbage
-collection. The integer value specifies how many objects to keep in the
-cache at most. The default is 500. Other values are
+cache at most. The default is 0. Other values are
 -1 for unlimited cache and 0 for no 
cache.
   
 
   
 (int)Tomcat will cache PollerEvent objects to reduce garbage
 collection. The integer value specifies how many objects to keep in the
-cache at most. The default is 500. Other values are
+cache at most. The default is 0. Other values are
 -1 for unlimited cache and 0 for no 
cache.
   
 
@@ -794,7 +787,7 @@
   
 (int)Tomcat will cache SocketProcessor objects to reduce garbage
 collection. The integer value specifies how many objects to keep in the
-cache at most. The default is 500. Other values are
+cache at most. The default is 0. Other values are
 -1 for unlimited cache and 0 for no 
cache.
   
 
diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index 5bc3c4a6e4..9cbab65964 100644
--- a/webapps/docs/config/http.xml
+++ b/webapps/docs/config/http.xml
@@ -1008,7 +1008,7 @@
   
 (int)Tomcat will cache SocketProcessor objects to reduce garbage
 collection. The integer value specifies how many objects to keep in the
-cache at most. The default is 500. Other values are
+cache at most. The default is 0. Other values are
 -1 for unlimited cache and 0 for no 
cache.
   
 


-
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 a regression in 6353e786

2023-08-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 5623b08fac Fix a regression in 6353e786
5623b08fac is described below

commit 5623b08fac963514c6793fda0aca743a876924a3
Author: lihan 
AuthorDate: Thu Aug 10 15:48:56 2023 +0800

Fix a regression in 6353e786
---
 java/org/apache/catalina/mapper/Mapper.java | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/mapper/Mapper.java 
b/java/org/apache/catalina/mapper/Mapper.java
index d2d3b4635e..a1f9d19257 100644
--- a/java/org/apache/catalina/mapper/Mapper.java
+++ b/java/org/apache/catalina/mapper/Mapper.java
@@ -1319,7 +1319,8 @@ public final class Mapper {
 private static int compare(CharChunk name, int start, int end, String 
compareTo) {
 int result = 0;
 char[] c = name.getBuffer();
-int len = compareTo.length();
+int compareLen = compareTo.length();
+int len = compareLen;
 if ((end - start) < len) {
 len = end - start;
 }
@@ -1333,9 +1334,9 @@ public final class Mapper {
 }
 }
 if (result == 0) {
-if (len > (end - start)) {
+if (compareLen > (end - start)) {
 result = -1;
-} else if (len < (end - start)) {
+} else if (compareLen < (end - start)) {
 result = 1;
 }
 }
@@ -1350,7 +1351,8 @@ public final class Mapper {
 private static int compareIgnoreCase(CharChunk name, int start, int end, 
String compareTo) {
 int result = 0;
 char[] c = name.getBuffer();
-int len = compareTo.length();
+int compareLen = compareTo.length();
+int len = compareLen;
 if ((end - start) < len) {
 len = end - start;
 }
@@ -1364,9 +1366,9 @@ public final class Mapper {
 }
 }
 if (result == 0) {
-if (len > (end - start)) {
+if (compareLen > (end - start)) {
 result = -1;
-} else if (len < (end - start)) {
+} else if (compareLen < (end - start)) {
 result = 1;
 }
 }


-
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 a regression in 6353e786

2023-08-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 96ee000b9a Fix a regression in 6353e786
96ee000b9a is described below

commit 96ee000b9ad61d123bf3889e5152f668a36006ee
Author: lihan 
AuthorDate: Thu Aug 10 15:48:56 2023 +0800

Fix a regression in 6353e786
---
 java/org/apache/catalina/mapper/Mapper.java | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/mapper/Mapper.java 
b/java/org/apache/catalina/mapper/Mapper.java
index 70e428b45b..0a5690704b 100644
--- a/java/org/apache/catalina/mapper/Mapper.java
+++ b/java/org/apache/catalina/mapper/Mapper.java
@@ -1320,7 +1320,8 @@ public final class Mapper {
 private static int compare(CharChunk name, int start, int end, String 
compareTo) {
 int result = 0;
 char[] c = name.getBuffer();
-int len = compareTo.length();
+int compareLen = compareTo.length();
+int len = compareLen;
 if ((end - start) < len) {
 len = end - start;
 }
@@ -1334,9 +1335,9 @@ public final class Mapper {
 }
 }
 if (result == 0) {
-if (len > (end - start)) {
+if (compareLen > (end - start)) {
 result = -1;
-} else if (len < (end - start)) {
+} else if (compareLen < (end - start)) {
 result = 1;
 }
 }
@@ -1351,7 +1352,8 @@ public final class Mapper {
 private static int compareIgnoreCase(CharChunk name, int start, int end, 
String compareTo) {
 int result = 0;
 char[] c = name.getBuffer();
-int len = compareTo.length();
+int compareLen = compareTo.length();
+int len = compareLen;
 if ((end - start) < len) {
 len = end - start;
 }
@@ -1365,9 +1367,9 @@ public final class Mapper {
 }
 }
 if (result == 0) {
-if (len > (end - start)) {
+if (compareLen > (end - start)) {
 result = -1;
-} else if (len < (end - start)) {
+} else if (compareLen < (end - start)) {
 result = 1;
 }
 }


-
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 a regression in 6353e786

2023-08-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 4d3f1bdbf3 Fix a regression in 6353e786
4d3f1bdbf3 is described below

commit 4d3f1bdbf3e7a626edfea97f1b2853ee27076264
Author: lihan 
AuthorDate: Thu Aug 10 15:48:56 2023 +0800

Fix a regression in 6353e786
---
 java/org/apache/catalina/mapper/Mapper.java | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/mapper/Mapper.java 
b/java/org/apache/catalina/mapper/Mapper.java
index b1c87e1070..f73e7429b5 100644
--- a/java/org/apache/catalina/mapper/Mapper.java
+++ b/java/org/apache/catalina/mapper/Mapper.java
@@ -1314,7 +1314,8 @@ public final class Mapper {
 private static int compare(CharChunk name, int start, int end, String 
compareTo) {
 int result = 0;
 char[] c = name.getBuffer();
-int len = compareTo.length();
+int compareLen = compareTo.length();
+int len = compareLen;
 if ((end - start) < len) {
 len = end - start;
 }
@@ -1328,9 +1329,9 @@ public final class Mapper {
 }
 }
 if (result == 0) {
-if (len > (end - start)) {
+if (compareLen > (end - start)) {
 result = -1;
-} else if (len < (end - start)) {
+} else if (compareLen < (end - start)) {
 result = 1;
 }
 }
@@ -1345,7 +1346,8 @@ public final class Mapper {
 private static int compareIgnoreCase(CharChunk name, int start, int end, 
String compareTo) {
 int result = 0;
 char[] c = name.getBuffer();
-int len = compareTo.length();
+int compareLen = compareTo.length();
+int len = compareLen;
 if ((end - start) < len) {
 len = end - start;
 }
@@ -1359,9 +1361,9 @@ public final class Mapper {
 }
 }
 if (result == 0) {
-if (len > (end - start)) {
+if (compareLen > (end - start)) {
 result = -1;
-} else if (len < (end - start)) {
+} else if (compareLen < (end - start)) {
 result = 1;
 }
 }


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



[tomcat] branch main updated: Fix a regression in 6353e786

2023-08-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 3a92f6a0bf Fix a regression in 6353e786
3a92f6a0bf is described below

commit 3a92f6a0bf3c73451a5fcc0b1d6de6fe5a6bb5b2
Author: lihan 
AuthorDate: Thu Aug 10 15:48:56 2023 +0800

Fix a regression in 6353e786
---
 java/org/apache/catalina/mapper/Mapper.java | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/mapper/Mapper.java 
b/java/org/apache/catalina/mapper/Mapper.java
index b1cfa8033b..b8708b9c45 100644
--- a/java/org/apache/catalina/mapper/Mapper.java
+++ b/java/org/apache/catalina/mapper/Mapper.java
@@ -1332,7 +1332,8 @@ public final class Mapper {
 private static int compare(CharChunk name, int start, int end, String 
compareTo) {
 int result = 0;
 char[] c = name.getBuffer();
-int len = compareTo.length();
+int compareLen = compareTo.length();
+int len = compareLen;
 if ((end - start) < len) {
 len = end - start;
 }
@@ -1346,9 +1347,9 @@ public final class Mapper {
 }
 }
 if (result == 0) {
-if (len > (end - start)) {
+if (compareLen > (end - start)) {
 result = -1;
-} else if (len < (end - start)) {
+} else if (compareLen < (end - start)) {
 result = 1;
 }
 }
@@ -1363,7 +1364,8 @@ public final class Mapper {
 private static int compareIgnoreCase(CharChunk name, int start, int end, 
String compareTo) {
 int result = 0;
 char[] c = name.getBuffer();
-int len = compareTo.length();
+int compareLen = compareTo.length();
+int len = compareLen;
 if ((end - start) < len) {
 len = end - start;
 }
@@ -1377,9 +1379,9 @@ public final class Mapper {
 }
 }
 if (result == 0) {
-if (len > (end - start)) {
+if (compareLen > (end - start)) {
 result = -1;
-} else if (len < (end - start)) {
+} else if (compareLen < (end - start)) {
 result = 1;
 }
 }


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

2023-08-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 fd416efaa5 Fix typo.
fd416efaa5 is described below

commit fd416efaa5b78cf6de5d97ba8a62ddd0a31e9339
Author: lihan 
AuthorDate: Thu Aug 10 11:15:06 2023 +0800

Fix typo.

(cherry picked from commit c1388b3ed08f7a72bc5193d5c5242087a9e73e7d)
---
 java/org/apache/catalina/connector/Request.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 1adc04e392..41f8573f1f 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -3177,7 +3177,7 @@ public class Request implements HttpServletRequest {
 parameters.setQueryStringCharset(charset);
 }
 // Note: If !useBodyEncodingForURI, the query string encoding is
-// that set towards the start of CoyoyeAdapter.service()
+// that set towards the start of CoyoteAdapter.service()
 
 parameters.handleQueryParameters();
 


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

2023-08-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 29ef6e183f Fix typo.
29ef6e183f is described below

commit 29ef6e183f956d58eba5820b0b463a990aff4928
Author: lihan 
AuthorDate: Thu Aug 10 11:15:06 2023 +0800

Fix typo.

(cherry picked from commit c1388b3ed08f7a72bc5193d5c5242087a9e73e7d)
---
 java/org/apache/catalina/connector/Request.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index be6aed055f..2ed59f22a0 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -3162,7 +3162,7 @@ public class Request implements HttpServletRequest {
 parameters.setQueryStringCharset(charset);
 }
 // Note: If !useBodyEncodingForURI, the query string encoding is
-// that set towards the start of CoyoyeAdapter.service()
+// that set towards the start of CoyoteAdapter.service()
 
 parameters.handleQueryParameters();
 


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

2023-08-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 3ca902a025 Fix typo.
3ca902a025 is described below

commit 3ca902a025ae88c7b195658019e1cc0a54b9f5b4
Author: lihan 
AuthorDate: Thu Aug 10 11:15:06 2023 +0800

Fix typo.

(cherry picked from commit c1388b3ed08f7a72bc5193d5c5242087a9e73e7d)
---
 java/org/apache/catalina/connector/Request.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 0f2ee5c046..6954351c92 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -3103,7 +3103,7 @@ public class Request implements HttpServletRequest {
 parameters.setQueryStringCharset(charset);
 }
 // Note: If !useBodyEncodingForURI, the query string encoding is
-// that set towards the start of CoyoyeAdapter.service()
+// that set towards the start of CoyoteAdapter.service()
 
 parameters.handleQueryParameters();
 


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



[tomcat] branch main updated: Fix typo.

2023-08-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 c1388b3ed0 Fix typo.
c1388b3ed0 is described below

commit c1388b3ed08f7a72bc5193d5c5242087a9e73e7d
Author: lihan 
AuthorDate: Thu Aug 10 11:15:06 2023 +0800

Fix typo.
---
 java/org/apache/catalina/connector/Request.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 8ec5f187c0..f43d8c835d 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -3055,7 +3055,7 @@ public class Request implements HttpServletRequest {
 parameters.setQueryStringCharset(charset);
 }
 // Note: If !useBodyEncodingForURI, the query string encoding is
-// that set towards the start of CoyoyeAdapter.service()
+// that set towards the start of CoyoteAdapter.service()
 
 parameters.handleQueryParameters();
 


-
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: Minor optimization

2023-08-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 745a0b9ddf Minor optimization
745a0b9ddf is described below

commit 745a0b9ddf5afcdec6c5c3f5a5c0c65b3fe4124e
Author: lihan 
AuthorDate: Wed Aug 9 16:42:11 2023 +0800

Minor optimization
---
 java/org/apache/catalina/mapper/Mapper.java | 20 
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/mapper/Mapper.java 
b/java/org/apache/catalina/mapper/Mapper.java
index fff38137d3..d2d3b4635e 100644
--- a/java/org/apache/catalina/mapper/Mapper.java
+++ b/java/org/apache/catalina/mapper/Mapper.java
@@ -1324,16 +1324,18 @@ public final class Mapper {
 len = end - start;
 }
 for (int i = 0; (i < len) && (result == 0); i++) {
-if (c[i + start] > compareTo.charAt(i)) {
+char nameChar = c[i + start];
+char compareToChar = compareTo.charAt(i);
+if (nameChar > compareToChar) {
 result = 1;
-} else if (c[i + start] < compareTo.charAt(i)) {
+} else if (nameChar < compareToChar) {
 result = -1;
 }
 }
 if (result == 0) {
-if (compareTo.length() > (end - start)) {
+if (len > (end - start)) {
 result = -1;
-} else if (compareTo.length() < (end - start)) {
+} else if (len < (end - start)) {
 result = 1;
 }
 }
@@ -1353,16 +1355,18 @@ public final class Mapper {
 len = end - start;
 }
 for (int i = 0; (i < len) && (result == 0); i++) {
-if (Ascii.toLower(c[i + start]) > 
Ascii.toLower(compareTo.charAt(i))) {
+int nameLower = Ascii.toLower(c[i + start]);
+int compareLower = Ascii.toLower(compareTo.charAt(i));
+if (nameLower > compareLower) {
 result = 1;
-} else if (Ascii.toLower(c[i + start]) < 
Ascii.toLower(compareTo.charAt(i))) {
+} else if (nameLower < compareLower) {
 result = -1;
 }
 }
 if (result == 0) {
-if (compareTo.length() > (end - start)) {
+if (len > (end - start)) {
 result = -1;
-} else if (compareTo.length() < (end - start)) {
+} else if (len < (end - start)) {
 result = 1;
 }
 }


-
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: Minor optimization

2023-08-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 4fb73ee846 Minor optimization
4fb73ee846 is described below

commit 4fb73ee846183d224d980f31fb7967352bb149a6
Author: lihan 
AuthorDate: Wed Aug 9 16:42:11 2023 +0800

Minor optimization
---
 java/org/apache/catalina/mapper/Mapper.java | 20 
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/mapper/Mapper.java 
b/java/org/apache/catalina/mapper/Mapper.java
index 9d529f..70e428b45b 100644
--- a/java/org/apache/catalina/mapper/Mapper.java
+++ b/java/org/apache/catalina/mapper/Mapper.java
@@ -1325,16 +1325,18 @@ public final class Mapper {
 len = end - start;
 }
 for (int i = 0; (i < len) && (result == 0); i++) {
-if (c[i + start] > compareTo.charAt(i)) {
+char nameChar = c[i + start];
+char compareToChar = compareTo.charAt(i);
+if (nameChar > compareToChar) {
 result = 1;
-} else if (c[i + start] < compareTo.charAt(i)) {
+} else if (nameChar < compareToChar) {
 result = -1;
 }
 }
 if (result == 0) {
-if (compareTo.length() > (end - start)) {
+if (len > (end - start)) {
 result = -1;
-} else if (compareTo.length() < (end - start)) {
+} else if (len < (end - start)) {
 result = 1;
 }
 }
@@ -1354,16 +1356,18 @@ public final class Mapper {
 len = end - start;
 }
 for (int i = 0; (i < len) && (result == 0); i++) {
-if (Ascii.toLower(c[i + start]) > 
Ascii.toLower(compareTo.charAt(i))) {
+int nameLower = Ascii.toLower(c[i + start]);
+int compareLower = Ascii.toLower(compareTo.charAt(i));
+if (nameLower > compareLower) {
 result = 1;
-} else if (Ascii.toLower(c[i + start]) < 
Ascii.toLower(compareTo.charAt(i))) {
+} else if (nameLower < compareLower) {
 result = -1;
 }
 }
 if (result == 0) {
-if (compareTo.length() > (end - start)) {
+if (len > (end - start)) {
 result = -1;
-} else if (compareTo.length() < (end - start)) {
+} else if (len < (end - start)) {
 result = 1;
 }
 }


-
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: Minor optimization

2023-08-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 171e2c768b Minor optimization
171e2c768b is described below

commit 171e2c768bb75015ce4ea51e9f1d8df4a054fbd2
Author: lihan 
AuthorDate: Wed Aug 9 16:42:11 2023 +0800

Minor optimization
---
 java/org/apache/catalina/mapper/Mapper.java | 20 
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/mapper/Mapper.java 
b/java/org/apache/catalina/mapper/Mapper.java
index 945c0ae8a2..b1c87e1070 100644
--- a/java/org/apache/catalina/mapper/Mapper.java
+++ b/java/org/apache/catalina/mapper/Mapper.java
@@ -1319,16 +1319,18 @@ public final class Mapper {
 len = end - start;
 }
 for (int i = 0; (i < len) && (result == 0); i++) {
-if (c[i + start] > compareTo.charAt(i)) {
+char nameChar = c[i + start];
+char compareToChar = compareTo.charAt(i);
+if (nameChar > compareToChar) {
 result = 1;
-} else if (c[i + start] < compareTo.charAt(i)) {
+} else if (nameChar < compareToChar) {
 result = -1;
 }
 }
 if (result == 0) {
-if (compareTo.length() > (end - start)) {
+if (len > (end - start)) {
 result = -1;
-} else if (compareTo.length() < (end - start)) {
+} else if (len < (end - start)) {
 result = 1;
 }
 }
@@ -1348,16 +1350,18 @@ public final class Mapper {
 len = end - start;
 }
 for (int i = 0; (i < len) && (result == 0); i++) {
-if (Ascii.toLower(c[i + start]) > 
Ascii.toLower(compareTo.charAt(i))) {
+int nameLower = Ascii.toLower(c[i + start]);
+int compareLower = Ascii.toLower(compareTo.charAt(i));
+if (nameLower > compareLower) {
 result = 1;
-} else if (Ascii.toLower(c[i + start]) < 
Ascii.toLower(compareTo.charAt(i))) {
+} else if (nameLower < compareLower) {
 result = -1;
 }
 }
 if (result == 0) {
-if (compareTo.length() > (end - start)) {
+if (len > (end - start)) {
 result = -1;
-} else if (compareTo.length() < (end - start)) {
+} else if (len < (end - start)) {
 result = 1;
 }
 }


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



[tomcat] branch main updated: Minor optimization

2023-08-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 6353e78658 Minor optimization
6353e78658 is described below

commit 6353e78658ea09c5056943901877f0b6ed31faae
Author: lihan 
AuthorDate: Wed Aug 9 16:42:11 2023 +0800

Minor optimization
---
 java/org/apache/catalina/mapper/Mapper.java | 20 
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/mapper/Mapper.java 
b/java/org/apache/catalina/mapper/Mapper.java
index 9a3cfd833f..b1cfa8033b 100644
--- a/java/org/apache/catalina/mapper/Mapper.java
+++ b/java/org/apache/catalina/mapper/Mapper.java
@@ -1337,16 +1337,18 @@ public final class Mapper {
 len = end - start;
 }
 for (int i = 0; (i < len) && (result == 0); i++) {
-if (c[i + start] > compareTo.charAt(i)) {
+char nameChar = c[i + start];
+char compareToChar = compareTo.charAt(i);
+if (nameChar > compareToChar) {
 result = 1;
-} else if (c[i + start] < compareTo.charAt(i)) {
+} else if (nameChar < compareToChar) {
 result = -1;
 }
 }
 if (result == 0) {
-if (compareTo.length() > (end - start)) {
+if (len > (end - start)) {
 result = -1;
-} else if (compareTo.length() < (end - start)) {
+} else if (len < (end - start)) {
 result = 1;
 }
 }
@@ -1366,16 +1368,18 @@ public final class Mapper {
 len = end - start;
 }
 for (int i = 0; (i < len) && (result == 0); i++) {
-if (Ascii.toLower(c[i + start]) > 
Ascii.toLower(compareTo.charAt(i))) {
+int nameLower = Ascii.toLower(c[i + start]);
+int compareLower = Ascii.toLower(compareTo.charAt(i));
+if (nameLower > compareLower) {
 result = 1;
-} else if (Ascii.toLower(c[i + start]) < 
Ascii.toLower(compareTo.charAt(i))) {
+} else if (nameLower < compareLower) {
 result = -1;
 }
 }
 if (result == 0) {
-if (compareTo.length() > (end - start)) {
+if (len > (end - start)) {
 result = -1;
-} else if (compareTo.length() < (end - start)) {
+} else if (len < (end - start)) {
 result = 1;
 }
 }


-
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 the releaseIdleCounter is incorrect.

2023-08-04 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 fcdc7e86be Fix the releaseIdleCounter is incorrect.
fcdc7e86be is described below

commit fcdc7e86bed9f59c046598fdd8fb295dc176810e
Author: lihan 
AuthorDate: Fri Aug 4 14:52:50 2023 +0800

Fix the releaseIdleCounter is incorrect.

Fix the releaseIdleCounter does not increment when testAllIdle releases 
them. Pull request #241 provided by Arun Chaitanya Miriappalli
---
 .../src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java| 1 +
 webapps/docs/changelog.xml   | 5 +
 2 files changed, 6 insertions(+)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
index e4f5873d04..6d059b32ca 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
@@ -1142,6 +1142,7 @@ public class ConnectionPool {
 continue;
 }
 if (!con.validate(PooledConnection.VALIDATE_IDLE)) {
+releasedIdleCount.incrementAndGet();
 idle.remove(con);
 release(con);
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4c2d76803b..51d90d62cd 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -151,6 +151,11 @@
   
   
 
+  
+Fix the releaseIdleCounter does not increment when 
testAllIdle
+releases them. Pull request 241 provided by Arun Chaitanya 
Miriappalli
+(lihan)
+  
   
 Fix the ConnectionState state will be inconsistent with 
actual
 state on the connection when an exception occurs while writing. Pull 
request


-
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 the releaseIdleCounter is incorrect.

2023-08-04 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 05ed86f850 Fix the releaseIdleCounter is incorrect.
05ed86f850 is described below

commit 05ed86f85028d2a72c83fe417af24dce7442cab9
Author: lihan 
AuthorDate: Fri Aug 4 14:52:50 2023 +0800

Fix the releaseIdleCounter is incorrect.

Fix the releaseIdleCounter does not increment when testAllIdle releases 
them. Pull request #241 provided by Arun Chaitanya Miriappalli
---
 .../src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java| 1 +
 webapps/docs/changelog.xml   | 5 +
 2 files changed, 6 insertions(+)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
index 06989ab807..203abe1a50 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
@@ -1197,6 +1197,7 @@ public class ConnectionPool {
 release = !reconnectIfExpired(con) || 
!con.validate(PooledConnection.VALIDATE_IDLE);
 }
 if (release) {
+releasedIdleCount.incrementAndGet();
 idle.remove(con);
 release(con);
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 79f3ca2f55..e0b4ed7b94 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -168,6 +168,11 @@
   
   
 
+  
+Fix the releaseIdleCounter does not increment when 
testAllIdle
+releases them. Pull request 241 provided by Arun Chaitanya 
Miriappalli
+(lihan)
+  
   
 Fix the ConnectionState state will be inconsistent with 
actual
 state on the connection when an exception occurs while writing. Pull 
request


-
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 the releaseIdleCounter is incorrect.

2023-08-04 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 11f68a00ce Fix the releaseIdleCounter is incorrect.
11f68a00ce is described below

commit 11f68a00cef1eea95ad1eef94065f5808d32680f
Author: lihan 
AuthorDate: Fri Aug 4 14:52:50 2023 +0800

Fix the releaseIdleCounter is incorrect.

Fix the releaseIdleCounter does not increment when testAllIdle releases 
them. Pull request #241 provided by Arun Chaitanya Miriappalli
---
 .../src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java| 1 +
 webapps/docs/changelog.xml   | 5 +
 2 files changed, 6 insertions(+)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
index 58505cabc6..bc7653b3ac 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
@@ -1204,6 +1204,7 @@ public class ConnectionPool {
 release = !reconnectIfExpired(con) || 
!con.validate(PooledConnection.VALIDATE_IDLE);
 }
 if (release) {
+releasedIdleCount.incrementAndGet();
 idle.remove(con);
 release(con);
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f069f91ee1..d19f6b45e4 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -147,6 +147,11 @@
   
   
 
+  
+Fix the releaseIdleCounter does not increment when 
testAllIdle
+releases them. Pull request 241 provided by Arun Chaitanya 
Miriappalli
+(lihan)
+  
   
 Fix the ConnectionState state will be inconsistent with 
actual
 state on the connection when an exception occurs while writing. Pull 
request


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



[tomcat] branch main updated: Add a changelog entry for f1e571a9

2023-08-04 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 71a5ed4ab3 Add a changelog entry for f1e571a9
71a5ed4ab3 is described below

commit 71a5ed4ab3cb69bb3711723791b87e7ce2a5beb6
Author: lihan 
AuthorDate: Fri Aug 4 14:48:55 2023 +0800

Add a changelog entry for f1e571a9
---
 webapps/docs/changelog.xml | 5 +
 1 file changed, 5 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f1969a6009..6ee6b5de0e 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -168,6 +168,11 @@
   
   
 
+  
+Fix the releaseIdleCounter does not increment when 
testAllIdle
+releases them. Pull request 241 provided by Arun Chaitanya 
Miriappalli
+(lihan)
+  
   
 Fix the ConnectionState state will be inconsistent with 
actual
 state on the connection when an exception occurs while writing. Pull 
request


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



[tomcat] branch main updated: Increment ReleaseIdle Counter when testAllIdle releases them

2023-08-04 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 f1e571a9ef Increment ReleaseIdle Counter when testAllIdle releases them
f1e571a9ef is described below

commit f1e571a9ef3026e594c1fbe0fbba3b550f5a02ed
Author: Arun Chaitanya Miriappalli 
AuthorDate: Fri Feb 14 15:39:14 2020 +0800

Increment ReleaseIdle Counter when testAllIdle releases them
---
 .../src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java| 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
index 702589fad5..aa8f8154bf 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
@@ -1202,6 +1202,7 @@ public class ConnectionPool {
 release = !reconnectIfExpired(con) || 
!con.validate(PooledConnection.VALIDATE_IDLE);
 }
 if (release) {
+releasedIdleCount.incrementAndGet();
 idle.remove(con);
 release(con);
 }


-
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 the inconsistent state of ConnectionState

2023-08-02 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 5375dc1e84 Fix the inconsistent state of ConnectionState
5375dc1e84 is described below

commit 5375dc1e841c3dd656258a5016001d4068eb244c
Author: lihan 
AuthorDate: Thu Aug 3 10:11:36 2023 +0800

Fix the inconsistent state of ConnectionState

(cherry picked from commit 77dcb33743d394e158aae1d538f94aaed1edd6ae)
---
 .../jdbc/pool/interceptor/ConnectionState.java | 27 +---
 .../tomcat/jdbc/test/TestConnectionState.java  | 72 ++
 webapps/docs/changelog.xml |  9 +++
 3 files changed, 101 insertions(+), 7 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
index dac5463c8f..fdc64fba3b 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
@@ -155,14 +155,27 @@ public class ConnectionState extends JdbcInterceptor  {
 }
 }
 
-result = super.invoke(proxy, method, args);
-if (read || write) {
-switch (index) {
-case 0:{autoCommit = (Boolean) (read?result:args[0]); break;}
-case 1:{transactionIsolation = (Integer)(read?result:args[0]); 
break;}
-case 2:{readOnly = (Boolean)(read?result:args[0]); break;}
-case 3:{catalog = (String)(read?result:args[0]); break;}
+try {
+result = super.invoke(proxy, method, args);
+if (read || write) {
+switch (index) {
+case 0:{autoCommit = (Boolean) (read?result:args[0]); 
break;}
+case 1:{transactionIsolation = 
(Integer)(read?result:args[0]); break;}
+case 2:{readOnly = (Boolean)(read?result:args[0]); break;}
+case 3:{catalog = (String)(read?result:args[0]); break;}
+}
+}
+} catch (Throwable e) {
+if (write) {
+log.warn("Reset state to null as an exception occurred while 
calling method[" + name + "].", e);
+switch (index) {
+case 0:{autoCommit = null; break;}
+case 1:{transactionIsolation = null; break;}
+case 2:{readOnly = null; break;}
+case 3:{catalog = null; break;}
+}
 }
+throw e;
 }
 return result;
 }
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
index daa8ea4967..73e1044b9f 100644
--- 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
@@ -17,13 +17,19 @@
 package org.apache.tomcat.jdbc.test;
 
 import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.Properties;
 
+import org.apache.tomcat.jdbc.test.driver.Driver;
 import org.junit.Assert;
 import org.junit.Test;
 
 import org.apache.tomcat.jdbc.pool.DataSourceProxy;
 import org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;
 
+import javax.sql.PooledConnection;
+
 public class TestConnectionState extends DefaultTestCase {
 
 @Test
@@ -79,4 +85,70 @@ public class TestConnectionState extends DefaultTestCase {
 c1 = d1.getConnection();
 Assert.assertEquals("Catalog should be 
information_schema",c1.getCatalog(),"information_schema");
 }
+
+@Test
+public void testWithException() throws SQLException {
+DriverManager.registerDriver(new MockErrorDriver());
+// use our mock driver
+datasource.setDriverClassName(MockErrorDriver.class.getName());
+datasource.setUrl(MockErrorDriver.url);
+datasource.setDefaultAutoCommit(true);
+datasource.setMinIdle(1);
+datasource.setMaxIdle(1);
+datasource.setMaxActive(1);
+datasource.setJdbcInterceptors(ConnectionState.class.getName());
+Connection connection = datasource.getConnection();
+PooledConnection pc = (PooledConnection) connection;
+MockErrorConnection c1 = (MockErrorConnection) pc.getConnection();
+Assert.assertTrue("Auto commit should be true", c1.getAutoCommit());
+connection.close();
+c1.setThrowError(true);
+Connection c2 = datasource.getConnection();
+try {
+   

[tomcat] branch 9.0.x updated: Fix the inconsistent state of ConnectionState

2023-08-02 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 5e39cd81d3 Fix the inconsistent state of ConnectionState
5e39cd81d3 is described below

commit 5e39cd81d3fa0d084a4dec41b187967999ebc639
Author: lihan 
AuthorDate: Thu Aug 3 10:11:36 2023 +0800

Fix the inconsistent state of ConnectionState

(cherry picked from commit 77dcb33743d394e158aae1d538f94aaed1edd6ae)
---
 .../jdbc/pool/interceptor/ConnectionState.java | 27 +---
 .../tomcat/jdbc/test/TestConnectionState.java  | 72 ++
 webapps/docs/changelog.xml |  9 +++
 3 files changed, 101 insertions(+), 7 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
index dac5463c8f..fdc64fba3b 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
@@ -155,14 +155,27 @@ public class ConnectionState extends JdbcInterceptor  {
 }
 }
 
-result = super.invoke(proxy, method, args);
-if (read || write) {
-switch (index) {
-case 0:{autoCommit = (Boolean) (read?result:args[0]); break;}
-case 1:{transactionIsolation = (Integer)(read?result:args[0]); 
break;}
-case 2:{readOnly = (Boolean)(read?result:args[0]); break;}
-case 3:{catalog = (String)(read?result:args[0]); break;}
+try {
+result = super.invoke(proxy, method, args);
+if (read || write) {
+switch (index) {
+case 0:{autoCommit = (Boolean) (read?result:args[0]); 
break;}
+case 1:{transactionIsolation = 
(Integer)(read?result:args[0]); break;}
+case 2:{readOnly = (Boolean)(read?result:args[0]); break;}
+case 3:{catalog = (String)(read?result:args[0]); break;}
+}
+}
+} catch (Throwable e) {
+if (write) {
+log.warn("Reset state to null as an exception occurred while 
calling method[" + name + "].", e);
+switch (index) {
+case 0:{autoCommit = null; break;}
+case 1:{transactionIsolation = null; break;}
+case 2:{readOnly = null; break;}
+case 3:{catalog = null; break;}
+}
 }
+throw e;
 }
 return result;
 }
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
index daa8ea4967..73e1044b9f 100644
--- 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
@@ -17,13 +17,19 @@
 package org.apache.tomcat.jdbc.test;
 
 import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.Properties;
 
+import org.apache.tomcat.jdbc.test.driver.Driver;
 import org.junit.Assert;
 import org.junit.Test;
 
 import org.apache.tomcat.jdbc.pool.DataSourceProxy;
 import org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;
 
+import javax.sql.PooledConnection;
+
 public class TestConnectionState extends DefaultTestCase {
 
 @Test
@@ -79,4 +85,70 @@ public class TestConnectionState extends DefaultTestCase {
 c1 = d1.getConnection();
 Assert.assertEquals("Catalog should be 
information_schema",c1.getCatalog(),"information_schema");
 }
+
+@Test
+public void testWithException() throws SQLException {
+DriverManager.registerDriver(new MockErrorDriver());
+// use our mock driver
+datasource.setDriverClassName(MockErrorDriver.class.getName());
+datasource.setUrl(MockErrorDriver.url);
+datasource.setDefaultAutoCommit(true);
+datasource.setMinIdle(1);
+datasource.setMaxIdle(1);
+datasource.setMaxActive(1);
+datasource.setJdbcInterceptors(ConnectionState.class.getName());
+Connection connection = datasource.getConnection();
+PooledConnection pc = (PooledConnection) connection;
+MockErrorConnection c1 = (MockErrorConnection) pc.getConnection();
+Assert.assertTrue("Auto commit should be true", c1.getAutoCommit());
+connection.close();
+c1.setThrowError(true);
+Connection c2 = datasource.getConnection();
+try {
+   

[tomcat] branch 10.1.x updated: Fix the inconsistent state of ConnectionState

2023-08-02 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 7d73d88dd5 Fix the inconsistent state of ConnectionState
7d73d88dd5 is described below

commit 7d73d88dd5f67ce3f34e332c3bf75ce2e3ec29ef
Author: lihan 
AuthorDate: Thu Aug 3 10:11:36 2023 +0800

Fix the inconsistent state of ConnectionState

(cherry picked from commit 77dcb33743d394e158aae1d538f94aaed1edd6ae)
---
 .../jdbc/pool/interceptor/ConnectionState.java | 27 +---
 .../tomcat/jdbc/test/TestConnectionState.java  | 72 ++
 webapps/docs/changelog.xml |  9 +++
 3 files changed, 101 insertions(+), 7 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
index dac5463c8f..fdc64fba3b 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
@@ -155,14 +155,27 @@ public class ConnectionState extends JdbcInterceptor  {
 }
 }
 
-result = super.invoke(proxy, method, args);
-if (read || write) {
-switch (index) {
-case 0:{autoCommit = (Boolean) (read?result:args[0]); break;}
-case 1:{transactionIsolation = (Integer)(read?result:args[0]); 
break;}
-case 2:{readOnly = (Boolean)(read?result:args[0]); break;}
-case 3:{catalog = (String)(read?result:args[0]); break;}
+try {
+result = super.invoke(proxy, method, args);
+if (read || write) {
+switch (index) {
+case 0:{autoCommit = (Boolean) (read?result:args[0]); 
break;}
+case 1:{transactionIsolation = 
(Integer)(read?result:args[0]); break;}
+case 2:{readOnly = (Boolean)(read?result:args[0]); break;}
+case 3:{catalog = (String)(read?result:args[0]); break;}
+}
+}
+} catch (Throwable e) {
+if (write) {
+log.warn("Reset state to null as an exception occurred while 
calling method[" + name + "].", e);
+switch (index) {
+case 0:{autoCommit = null; break;}
+case 1:{transactionIsolation = null; break;}
+case 2:{readOnly = null; break;}
+case 3:{catalog = null; break;}
+}
 }
+throw e;
 }
 return result;
 }
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
index daa8ea4967..73e1044b9f 100644
--- 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
@@ -17,13 +17,19 @@
 package org.apache.tomcat.jdbc.test;
 
 import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.Properties;
 
+import org.apache.tomcat.jdbc.test.driver.Driver;
 import org.junit.Assert;
 import org.junit.Test;
 
 import org.apache.tomcat.jdbc.pool.DataSourceProxy;
 import org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;
 
+import javax.sql.PooledConnection;
+
 public class TestConnectionState extends DefaultTestCase {
 
 @Test
@@ -79,4 +85,70 @@ public class TestConnectionState extends DefaultTestCase {
 c1 = d1.getConnection();
 Assert.assertEquals("Catalog should be 
information_schema",c1.getCatalog(),"information_schema");
 }
+
+@Test
+public void testWithException() throws SQLException {
+DriverManager.registerDriver(new MockErrorDriver());
+// use our mock driver
+datasource.setDriverClassName(MockErrorDriver.class.getName());
+datasource.setUrl(MockErrorDriver.url);
+datasource.setDefaultAutoCommit(true);
+datasource.setMinIdle(1);
+datasource.setMaxIdle(1);
+datasource.setMaxActive(1);
+datasource.setJdbcInterceptors(ConnectionState.class.getName());
+Connection connection = datasource.getConnection();
+PooledConnection pc = (PooledConnection) connection;
+MockErrorConnection c1 = (MockErrorConnection) pc.getConnection();
+Assert.assertTrue("Auto commit should be true", c1.getAutoCommit());
+connection.close();
+c1.setThrowError(true);
+Connection c2 = datasource.getConnection();
+try {
+   

[tomcat] branch main updated: Fix the inconsistent state of ConnectionState

2023-08-02 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 77dcb33743 Fix the inconsistent state of ConnectionState
77dcb33743 is described below

commit 77dcb33743d394e158aae1d538f94aaed1edd6ae
Author: lihan 
AuthorDate: Thu Aug 3 10:11:36 2023 +0800

Fix the inconsistent state of ConnectionState
---
 .../jdbc/pool/interceptor/ConnectionState.java | 27 +---
 .../tomcat/jdbc/test/TestConnectionState.java  | 72 ++
 webapps/docs/changelog.xml |  9 +++
 3 files changed, 101 insertions(+), 7 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
index dac5463c8f..fdc64fba3b 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java
@@ -155,14 +155,27 @@ public class ConnectionState extends JdbcInterceptor  {
 }
 }
 
-result = super.invoke(proxy, method, args);
-if (read || write) {
-switch (index) {
-case 0:{autoCommit = (Boolean) (read?result:args[0]); break;}
-case 1:{transactionIsolation = (Integer)(read?result:args[0]); 
break;}
-case 2:{readOnly = (Boolean)(read?result:args[0]); break;}
-case 3:{catalog = (String)(read?result:args[0]); break;}
+try {
+result = super.invoke(proxy, method, args);
+if (read || write) {
+switch (index) {
+case 0:{autoCommit = (Boolean) (read?result:args[0]); 
break;}
+case 1:{transactionIsolation = 
(Integer)(read?result:args[0]); break;}
+case 2:{readOnly = (Boolean)(read?result:args[0]); break;}
+case 3:{catalog = (String)(read?result:args[0]); break;}
+}
+}
+} catch (Throwable e) {
+if (write) {
+log.warn("Reset state to null as an exception occurred while 
calling method[" + name + "].", e);
+switch (index) {
+case 0:{autoCommit = null; break;}
+case 1:{transactionIsolation = null; break;}
+case 2:{readOnly = null; break;}
+case 3:{catalog = null; break;}
+}
 }
+throw e;
 }
 return result;
 }
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
index daa8ea4967..73e1044b9f 100644
--- 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestConnectionState.java
@@ -17,13 +17,19 @@
 package org.apache.tomcat.jdbc.test;
 
 import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.Properties;
 
+import org.apache.tomcat.jdbc.test.driver.Driver;
 import org.junit.Assert;
 import org.junit.Test;
 
 import org.apache.tomcat.jdbc.pool.DataSourceProxy;
 import org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;
 
+import javax.sql.PooledConnection;
+
 public class TestConnectionState extends DefaultTestCase {
 
 @Test
@@ -79,4 +85,70 @@ public class TestConnectionState extends DefaultTestCase {
 c1 = d1.getConnection();
 Assert.assertEquals("Catalog should be 
information_schema",c1.getCatalog(),"information_schema");
 }
+
+@Test
+public void testWithException() throws SQLException {
+DriverManager.registerDriver(new MockErrorDriver());
+// use our mock driver
+datasource.setDriverClassName(MockErrorDriver.class.getName());
+datasource.setUrl(MockErrorDriver.url);
+datasource.setDefaultAutoCommit(true);
+datasource.setMinIdle(1);
+datasource.setMaxIdle(1);
+datasource.setMaxActive(1);
+datasource.setJdbcInterceptors(ConnectionState.class.getName());
+Connection connection = datasource.getConnection();
+PooledConnection pc = (PooledConnection) connection;
+MockErrorConnection c1 = (MockErrorConnection) pc.getConnection();
+Assert.assertTrue("Auto commit should be true", c1.getAutoCommit());
+connection.close();
+c1.setThrowError(true);
+Connection c2 = datasource.getConnection();
+try {
+c2.setAutoCommit(false);
+} catch (SQLException e) {
+// i

[tomcat] branch 8.5.x updated: Revert "Clear SocketWrapper reference to help GC"

2023-05-20 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 ffb68373ae Revert "Clear SocketWrapper reference to help GC"
ffb68373ae is described below

commit ffb68373ae76a0c4f62e65800b544feba09fdba5
Author: lihan 
AuthorDate: Sun May 21 09:30:02 2023 +0800

Revert "Clear SocketWrapper reference to help GC"

This reverts commit 2a084c266e09b048c1a49c749cb8ab1e8feedbfc.
---
 java/org/apache/coyote/AbstractProcessor.java  | 3 ---
 java/org/apache/coyote/http11/Http11Processor.java | 1 +
 java/org/apache/tomcat/util/net/Nio2Channel.java   | 1 -
 java/org/apache/tomcat/util/net/NioChannel.java| 1 -
 4 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProcessor.java 
b/java/org/apache/coyote/AbstractProcessor.java
index 0295396112..2a28d683ed 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -709,9 +709,6 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
 public void recycle() {
 errorState = ErrorState.NONE;
 asyncStateMachine.recycle();
-// Clear fields that can be cleared to aid GC and trigger NPEs if this
-// is reused
-socketWrapper = null;
 }
 
 
diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 5cc2ecc752..b8705441e8 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -1612,6 +1612,7 @@ public class Http11Processor extends AbstractProcessor {
 inputBuffer.recycle();
 outputBuffer.recycle();
 upgradeToken = null;
+socketWrapper = null;
 sendfileData = null;
 }
 
diff --git a/java/org/apache/tomcat/util/net/Nio2Channel.java 
b/java/org/apache/tomcat/util/net/Nio2Channel.java
index 6040b8855e..a2612fd0c1 100644
--- a/java/org/apache/tomcat/util/net/Nio2Channel.java
+++ b/java/org/apache/tomcat/util/net/Nio2Channel.java
@@ -79,7 +79,6 @@ public class Nio2Channel implements AsynchronousByteChannel {
 @Override
 public void close() throws IOException {
 sc.close();
-reset(this.sc, null);
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/NioChannel.java 
b/java/org/apache/tomcat/util/net/NioChannel.java
index 777880d67d..8e3cb4f0e1 100644
--- a/java/org/apache/tomcat/util/net/NioChannel.java
+++ b/java/org/apache/tomcat/util/net/NioChannel.java
@@ -99,7 +99,6 @@ public class NioChannel implements ByteChannel, 
ScatteringByteChannel, Gathering
 @Override
 public void close() throws IOException {
 sc.close();
-reset(this.sc,null);
 }
 
 /**


-
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: Revert "Clear SocketWrapper reference to help GC"

2023-05-20 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 02ea99c869 Revert "Clear SocketWrapper reference to help GC"
02ea99c869 is described below

commit 02ea99c86923c6ac544a5a9289bdc233c04e08f3
Author: lihan 
AuthorDate: Sun May 21 09:29:32 2023 +0800

Revert "Clear SocketWrapper reference to help GC"

This reverts commit 2cb6f8e4681359087a2a52b6950a315383a8d422.
---
 java/org/apache/coyote/AbstractProcessor.java  | 3 ---
 java/org/apache/coyote/http11/Http11Processor.java | 1 +
 java/org/apache/coyote/http2/StreamProcessor.java  | 6 +-
 java/org/apache/tomcat/util/net/Nio2Channel.java   | 1 -
 java/org/apache/tomcat/util/net/NioChannel.java| 1 -
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProcessor.java 
b/java/org/apache/coyote/AbstractProcessor.java
index 0230a5d442..a49bc921cf 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -716,9 +716,6 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
 public void recycle() {
 errorState = ErrorState.NONE;
 asyncStateMachine.recycle();
-// Clear fields that can be cleared to aid GC and trigger NPEs if this
-// is reused
-socketWrapper = null;
 }
 
 
diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 9070b9727c..aab2290407 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -1419,6 +1419,7 @@ public class Http11Processor extends AbstractProcessor {
 inputBuffer.recycle();
 outputBuffer.recycle();
 upgradeToken = null;
+socketWrapper = null;
 sendfileData = null;
 sslSupport = null;
 }
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index e1ed635e8d..fd1e011bea 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -391,8 +391,8 @@ class StreamProcessor extends AbstractProcessor {
 
 @Override
 public final void recycle() {
-super.recycle();
 // StreamProcessor instances are not re-used.
+
 // Calling removeRequestProcessor even though the RequestProcesser was
 // never added will add the values from the RequestProcessor to the
 // running total for the GlobalRequestProcessor
@@ -400,6 +400,10 @@ class StreamProcessor extends AbstractProcessor {
 if (global != null) {
 global.removeRequestProcessor(request.getRequestProcessor());
 }
+
+// Clear fields that can be cleared to aid GC and trigger NPEs if this
+// is reused
+setSocketWrapper(null);
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/Nio2Channel.java 
b/java/org/apache/tomcat/util/net/Nio2Channel.java
index 6040b8855e..a2612fd0c1 100644
--- a/java/org/apache/tomcat/util/net/Nio2Channel.java
+++ b/java/org/apache/tomcat/util/net/Nio2Channel.java
@@ -79,7 +79,6 @@ public class Nio2Channel implements AsynchronousByteChannel {
 @Override
 public void close() throws IOException {
 sc.close();
-reset(this.sc, null);
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/NioChannel.java 
b/java/org/apache/tomcat/util/net/NioChannel.java
index 777880d67d..8e3cb4f0e1 100644
--- a/java/org/apache/tomcat/util/net/NioChannel.java
+++ b/java/org/apache/tomcat/util/net/NioChannel.java
@@ -99,7 +99,6 @@ public class NioChannel implements ByteChannel, 
ScatteringByteChannel, Gathering
 @Override
 public void close() throws IOException {
 sc.close();
-reset(this.sc,null);
 }
 
 /**


-
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: Revert "Clear SocketWrapper reference to help GC"

2023-05-20 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 47b57c32ac Revert "Clear SocketWrapper reference to help GC"
47b57c32ac is described below

commit 47b57c32acdbe953b8b66b08b62db6416985415e
Author: lihan 
AuthorDate: Sun May 21 09:28:59 2023 +0800

Revert "Clear SocketWrapper reference to help GC"

This reverts commit 2b65532cafe4b9eedb588b45aa8570cfc03c165e.
---
 java/org/apache/coyote/AbstractProcessor.java  | 3 ---
 java/org/apache/coyote/http11/Http11Processor.java | 1 +
 java/org/apache/coyote/http2/StreamProcessor.java  | 6 +-
 java/org/apache/tomcat/util/net/Nio2Channel.java   | 1 -
 java/org/apache/tomcat/util/net/NioChannel.java| 1 -
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProcessor.java 
b/java/org/apache/coyote/AbstractProcessor.java
index d14224702c..ece5a6abda 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -717,9 +717,6 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
 public void recycle() {
 errorState = ErrorState.NONE;
 asyncStateMachine.recycle();
-// Clear fields that can be cleared to aid GC and trigger NPEs if this
-// is reused
-socketWrapper = null;
 }
 
 
diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index cb03b4fa41..db2286d2b0 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -1420,6 +1420,7 @@ public class Http11Processor extends AbstractProcessor {
 inputBuffer.recycle();
 outputBuffer.recycle();
 upgradeToken = null;
+socketWrapper = null;
 sendfileData = null;
 sslSupport = null;
 }
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index f76fbfa788..d08c875cbd 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -385,8 +385,8 @@ class StreamProcessor extends AbstractProcessor {
 
 @Override
 public final void recycle() {
-super.recycle();
 // StreamProcessor instances are not re-used.
+
 // Calling removeRequestProcessor even though the RequestProcesser was
 // never added will add the values from the RequestProcessor to the
 // running total for the GlobalRequestProcessor
@@ -394,6 +394,10 @@ class StreamProcessor extends AbstractProcessor {
 if (global != null) {
 global.removeRequestProcessor(request.getRequestProcessor());
 }
+
+// Clear fields that can be cleared to aid GC and trigger NPEs if this
+// is reused
+setSocketWrapper(null);
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/Nio2Channel.java 
b/java/org/apache/tomcat/util/net/Nio2Channel.java
index 9d65266374..603c43f416 100644
--- a/java/org/apache/tomcat/util/net/Nio2Channel.java
+++ b/java/org/apache/tomcat/util/net/Nio2Channel.java
@@ -79,7 +79,6 @@ public class Nio2Channel implements AsynchronousByteChannel {
 @Override
 public void close() throws IOException {
 sc.close();
-reset(this.sc, null);
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/NioChannel.java 
b/java/org/apache/tomcat/util/net/NioChannel.java
index eae3f51171..d263ce9ae6 100644
--- a/java/org/apache/tomcat/util/net/NioChannel.java
+++ b/java/org/apache/tomcat/util/net/NioChannel.java
@@ -81,7 +81,6 @@ public class NioChannel implements ByteChannel, 
ScatteringByteChannel, Gathering
 @Override
 public void close() throws IOException {
 sc.close();
-reset(this.sc,null);
 }
 
 /**


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



[tomcat] branch main updated: Revert "Clear SocketWrapper reference to help GC"

2023-05-20 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 2de4a3c337 Revert "Clear SocketWrapper reference to help GC"
2de4a3c337 is described below

commit 2de4a3c337b47bb2654d70a76a7e031ce970f679
Author: lihan 
AuthorDate: Sun May 21 09:27:51 2023 +0800

Revert "Clear SocketWrapper reference to help GC"

This reverts commit 10492dd22bd64ff63cf77786fa67d45cdc2a54b3.
---
 java/org/apache/coyote/AbstractProcessor.java  | 3 ---
 java/org/apache/coyote/http11/Http11Processor.java | 1 +
 java/org/apache/coyote/http2/StreamProcessor.java  | 6 +-
 java/org/apache/tomcat/util/net/Nio2Channel.java   | 1 -
 java/org/apache/tomcat/util/net/NioChannel.java| 1 -
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProcessor.java 
b/java/org/apache/coyote/AbstractProcessor.java
index 8965dab62b..3ee6898fbd 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -721,9 +721,6 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
 public void recycle() {
 errorState = ErrorState.NONE;
 asyncStateMachine.recycle();
-// Clear fields that can be cleared to aid GC and trigger NPEs if this
-// is reused
-socketWrapper = null;
 }
 
 
diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 85dfd34f3c..9e2e74914c 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -1418,6 +1418,7 @@ public class Http11Processor extends AbstractProcessor {
 inputBuffer.recycle();
 outputBuffer.recycle();
 upgradeToken = null;
+socketWrapper = null;
 sendfileData = null;
 sslSupport = null;
 }
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index 3b1c03ac38..78cb770649 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -392,8 +392,8 @@ class StreamProcessor extends AbstractProcessor {
 
 @Override
 public final void recycle() {
-super.recycle();
 // StreamProcessor instances are not re-used.
+
 // Calling removeRequestProcessor even though the RequestProcesser was
 // never added will add the values from the RequestProcessor to the
 // running total for the GlobalRequestProcessor
@@ -401,6 +401,10 @@ class StreamProcessor extends AbstractProcessor {
 if (global != null) {
 global.removeRequestProcessor(request.getRequestProcessor());
 }
+
+// Clear fields that can be cleared to aid GC and trigger NPEs if this
+// is reused
+setSocketWrapper(null);
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/Nio2Channel.java 
b/java/org/apache/tomcat/util/net/Nio2Channel.java
index 9d65266374..603c43f416 100644
--- a/java/org/apache/tomcat/util/net/Nio2Channel.java
+++ b/java/org/apache/tomcat/util/net/Nio2Channel.java
@@ -79,7 +79,6 @@ public class Nio2Channel implements AsynchronousByteChannel {
 @Override
 public void close() throws IOException {
 sc.close();
-reset(this.sc, null);
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/NioChannel.java 
b/java/org/apache/tomcat/util/net/NioChannel.java
index eae3f51171..d263ce9ae6 100644
--- a/java/org/apache/tomcat/util/net/NioChannel.java
+++ b/java/org/apache/tomcat/util/net/NioChannel.java
@@ -81,7 +81,6 @@ public class NioChannel implements ByteChannel, 
ScatteringByteChannel, Gathering
 @Override
 public void close() throws IOException {
 sc.close();
-reset(this.sc,null);
 }
 
 /**


-
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 BZ 66602 - skip sending the WINDOW_UPDATE frame if the increment is zero.

2023-05-19 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 338aaec1f3 Fix BZ 66602 - skip sending the WINDOW_UPDATE frame if the 
increment is zero.
338aaec1f3 is described below

commit 338aaec1f37984e8d8bef11a79ca929128e509ec
Author: ledefe 
AuthorDate: Fri May 19 13:24:50 2023 +0800

Fix BZ 66602 - skip sending the WINDOW_UPDATE frame if the increment is 
zero.

Closes #619
https://bz.apache.org/bugzilla/show_bug.cgi?id=66602
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 4 +++-
 webapps/docs/changelog.xml| 5 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index c5aeaf87ea..b32b9dbbfb 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -1625,7 +1625,9 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 // the call to this method. This means the bytes read will have 
been
 // written to the original stream and, effectively, swallowed.
 // Therefore, need to notify that those bytes were swallowed here.
-onSwallowedDataFramePayload(streamId, dataLength);
+if (dataLength>0) {
+onSwallowedDataFramePayload(streamId, dataLength);
+}
 }
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index a04e745926..6a2afaa8b7 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -112,6 +112,11 @@
 defined in RFC 9218 rather than the one defined in RFC 7540.
 (markt)
   
+  
+66602: not sending WINDOW_UPDATE when dataLength is ZERO
+on call SwallowedDataFramePayload. Pull request #619 by
+ledefe. (lihan)
+  
 
   
   


-
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 BZ 66602 - skip sending the WINDOW_UPDATE frame if the increment is zero.

2023-05-19 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 eb51363de4 Fix BZ 66602 - skip sending the WINDOW_UPDATE frame if the 
increment is zero.
eb51363de4 is described below

commit eb51363de43e2b1c16ecc48cd968a9a497374576
Author: ledefe 
AuthorDate: Fri May 19 13:24:50 2023 +0800

Fix BZ 66602 - skip sending the WINDOW_UPDATE frame if the increment is 
zero.

Closes #619
https://bz.apache.org/bugzilla/show_bug.cgi?id=66602
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 4 +++-
 webapps/docs/changelog.xml| 5 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 63586fc756..e653611498 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -1514,7 +1514,9 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 // the call to this method. This means the bytes read will have 
been
 // written to the original stream and, effectively, swallowed.
 // Therefore, need to notify that those bytes were swallowed here.
-onSwallowedDataFramePayload(streamId, dataLength);
+if (dataLength>0) {
+onSwallowedDataFramePayload(streamId, dataLength);
+}
 }
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 9413908290..978c599ab9 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -125,6 +125,11 @@
 defined in RFC 9218 rather than the one defined in RFC 7540.
 (markt)
   
+  
+66602: not sending WINDOW_UPDATE when dataLength is ZERO
+on call SwallowedDataFramePayload. Pull request #619 by
+ledefe. (lihan)
+  
 
   
   


-
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 BZ 66602 - skip sending the WINDOW_UPDATE frame if the increment is zero.

2023-05-19 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 7b417e313e Fix BZ 66602 - skip sending the WINDOW_UPDATE frame if the 
increment is zero.
7b417e313e is described below

commit 7b417e313e419f55459d90af7a713578359ac853
Author: ledefe 
AuthorDate: Fri May 19 13:24:50 2023 +0800

Fix BZ 66602 - skip sending the WINDOW_UPDATE frame if the increment is 
zero.

Closes #619
https://bz.apache.org/bugzilla/show_bug.cgi?id=66602
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 4 +++-
 webapps/docs/changelog.xml| 5 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 0e280deb45..ec3e098c0d 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -1522,7 +1522,9 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 // the call to this method. This means the bytes read will have 
been
 // written to the original stream and, effectively, swallowed.
 // Therefore, need to notify that those bytes were swallowed here.
-onSwallowedDataFramePayload(streamId, dataLength);
+if (dataLength>0) {
+onSwallowedDataFramePayload(streamId, dataLength);
+}
 }
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f38a017f6d..57d5bc3c11 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -128,6 +128,11 @@
 defined in RFC 9218 rather than the one defined in RFC 7540.
 (markt)
   
+  
+66602: not sending WINDOW_UPDATE when dataLength is ZERO
+on call SwallowedDataFramePayload. Pull request #619 by
+ledefe. (lihan)
+  
 
   
   


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



[tomcat] branch main updated: Fix BZ 66602 - skip sending the WINDOW_UPDATE frame if the increment is zero.

2023-05-19 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 5af5af674f Fix BZ 66602 - skip sending the WINDOW_UPDATE frame if the 
increment is zero.
5af5af674f is described below

commit 5af5af674f74bc88febc5cd5dc06213de516eb3e
Author: lihan 
AuthorDate: Fri May 19 14:06:09 2023 +0800

Fix BZ 66602 - skip sending the WINDOW_UPDATE frame if the increment is 
zero.

Closes #619
https://bz.apache.org/bugzilla/show_bug.cgi?id=66602
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 4 +++-
 webapps/docs/changelog.xml| 9 +
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 46f3eee022..d890945452 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -1522,7 +1522,9 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 // the call to this method. This means the bytes read will have 
been
 // written to the original stream and, effectively, swallowed.
 // Therefore, need to notify that those bytes were swallowed here.
-onSwallowedDataFramePayload(streamId, dataLength);
+if (dataLength > 0) {
+onSwallowedDataFramePayload(streamId, dataLength);
+}
 }
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index d5a96ce78c..e37c67094b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -137,6 +137,15 @@
   
 
   
+  
+
+  
+66602: not sending WINDOW_UPDATE when dataLength is ZERO
+on call SwallowedDataFramePayload. Pull request #619 by
+ledefe. (lihan)
+  
+
+  
   
 
   


-
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: Clear SocketWrapper reference to help GC

2023-05-18 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 2a084c266e Clear SocketWrapper reference to help GC
2a084c266e is described below

commit 2a084c266e09b048c1a49c749cb8ab1e8feedbfc
Author: lihan 
AuthorDate: Fri May 19 11:24:27 2023 +0800

Clear SocketWrapper reference to help GC
---
 java/org/apache/coyote/AbstractProcessor.java  | 3 +++
 java/org/apache/coyote/http11/Http11Processor.java | 1 -
 java/org/apache/tomcat/util/net/Nio2Channel.java   | 1 +
 java/org/apache/tomcat/util/net/NioChannel.java| 1 +
 4 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/AbstractProcessor.java 
b/java/org/apache/coyote/AbstractProcessor.java
index 2a28d683ed..0295396112 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -709,6 +709,9 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
 public void recycle() {
 errorState = ErrorState.NONE;
 asyncStateMachine.recycle();
+// Clear fields that can be cleared to aid GC and trigger NPEs if this
+// is reused
+socketWrapper = null;
 }
 
 
diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index b8705441e8..5cc2ecc752 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -1612,7 +1612,6 @@ public class Http11Processor extends AbstractProcessor {
 inputBuffer.recycle();
 outputBuffer.recycle();
 upgradeToken = null;
-socketWrapper = null;
 sendfileData = null;
 }
 
diff --git a/java/org/apache/tomcat/util/net/Nio2Channel.java 
b/java/org/apache/tomcat/util/net/Nio2Channel.java
index a2612fd0c1..6040b8855e 100644
--- a/java/org/apache/tomcat/util/net/Nio2Channel.java
+++ b/java/org/apache/tomcat/util/net/Nio2Channel.java
@@ -79,6 +79,7 @@ public class Nio2Channel implements AsynchronousByteChannel {
 @Override
 public void close() throws IOException {
 sc.close();
+reset(this.sc, null);
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/NioChannel.java 
b/java/org/apache/tomcat/util/net/NioChannel.java
index 8e3cb4f0e1..777880d67d 100644
--- a/java/org/apache/tomcat/util/net/NioChannel.java
+++ b/java/org/apache/tomcat/util/net/NioChannel.java
@@ -99,6 +99,7 @@ public class NioChannel implements ByteChannel, 
ScatteringByteChannel, Gathering
 @Override
 public void close() throws IOException {
 sc.close();
+reset(this.sc,null);
 }
 
 /**


-
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: Clear SocketWrapper reference to help GC

2023-05-18 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 2cb6f8e468 Clear SocketWrapper reference to help GC
2cb6f8e468 is described below

commit 2cb6f8e4681359087a2a52b6950a315383a8d422
Author: lihan 
AuthorDate: Fri May 19 11:24:27 2023 +0800

Clear SocketWrapper reference to help GC

(cherry picked from commit 10492dd22bd64ff63cf77786fa67d45cdc2a54b3)
---
 java/org/apache/coyote/AbstractProcessor.java  | 3 +++
 java/org/apache/coyote/http11/Http11Processor.java | 1 -
 java/org/apache/coyote/http2/StreamProcessor.java  | 6 +-
 java/org/apache/tomcat/util/net/Nio2Channel.java   | 1 +
 java/org/apache/tomcat/util/net/NioChannel.java| 1 +
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProcessor.java 
b/java/org/apache/coyote/AbstractProcessor.java
index a49bc921cf..0230a5d442 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -716,6 +716,9 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
 public void recycle() {
 errorState = ErrorState.NONE;
 asyncStateMachine.recycle();
+// Clear fields that can be cleared to aid GC and trigger NPEs if this
+// is reused
+socketWrapper = null;
 }
 
 
diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index aab2290407..9070b9727c 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -1419,7 +1419,6 @@ public class Http11Processor extends AbstractProcessor {
 inputBuffer.recycle();
 outputBuffer.recycle();
 upgradeToken = null;
-socketWrapper = null;
 sendfileData = null;
 sslSupport = null;
 }
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index fd1e011bea..e1ed635e8d 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -391,8 +391,8 @@ class StreamProcessor extends AbstractProcessor {
 
 @Override
 public final void recycle() {
+super.recycle();
 // StreamProcessor instances are not re-used.
-
 // Calling removeRequestProcessor even though the RequestProcesser was
 // never added will add the values from the RequestProcessor to the
 // running total for the GlobalRequestProcessor
@@ -400,10 +400,6 @@ class StreamProcessor extends AbstractProcessor {
 if (global != null) {
 global.removeRequestProcessor(request.getRequestProcessor());
 }
-
-// Clear fields that can be cleared to aid GC and trigger NPEs if this
-// is reused
-setSocketWrapper(null);
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/Nio2Channel.java 
b/java/org/apache/tomcat/util/net/Nio2Channel.java
index a2612fd0c1..6040b8855e 100644
--- a/java/org/apache/tomcat/util/net/Nio2Channel.java
+++ b/java/org/apache/tomcat/util/net/Nio2Channel.java
@@ -79,6 +79,7 @@ public class Nio2Channel implements AsynchronousByteChannel {
 @Override
 public void close() throws IOException {
 sc.close();
+reset(this.sc, null);
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/NioChannel.java 
b/java/org/apache/tomcat/util/net/NioChannel.java
index 8e3cb4f0e1..777880d67d 100644
--- a/java/org/apache/tomcat/util/net/NioChannel.java
+++ b/java/org/apache/tomcat/util/net/NioChannel.java
@@ -99,6 +99,7 @@ public class NioChannel implements ByteChannel, 
ScatteringByteChannel, Gathering
 @Override
 public void close() throws IOException {
 sc.close();
+reset(this.sc,null);
 }
 
 /**


-
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: Clear SocketWrapper reference to help GC

2023-05-18 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 2b65532caf Clear SocketWrapper reference to help GC
2b65532caf is described below

commit 2b65532cafe4b9eedb588b45aa8570cfc03c165e
Author: lihan 
AuthorDate: Fri May 19 11:24:27 2023 +0800

Clear SocketWrapper reference to help GC

(cherry picked from commit 10492dd22bd64ff63cf77786fa67d45cdc2a54b3)
---
 java/org/apache/coyote/AbstractProcessor.java  | 3 +++
 java/org/apache/coyote/http11/Http11Processor.java | 1 -
 java/org/apache/coyote/http2/StreamProcessor.java  | 6 +-
 java/org/apache/tomcat/util/net/Nio2Channel.java   | 1 +
 java/org/apache/tomcat/util/net/NioChannel.java| 1 +
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProcessor.java 
b/java/org/apache/coyote/AbstractProcessor.java
index ece5a6abda..d14224702c 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -717,6 +717,9 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
 public void recycle() {
 errorState = ErrorState.NONE;
 asyncStateMachine.recycle();
+// Clear fields that can be cleared to aid GC and trigger NPEs if this
+// is reused
+socketWrapper = null;
 }
 
 
diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index db2286d2b0..cb03b4fa41 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -1420,7 +1420,6 @@ public class Http11Processor extends AbstractProcessor {
 inputBuffer.recycle();
 outputBuffer.recycle();
 upgradeToken = null;
-socketWrapper = null;
 sendfileData = null;
 sslSupport = null;
 }
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index d08c875cbd..f76fbfa788 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -385,8 +385,8 @@ class StreamProcessor extends AbstractProcessor {
 
 @Override
 public final void recycle() {
+super.recycle();
 // StreamProcessor instances are not re-used.
-
 // Calling removeRequestProcessor even though the RequestProcesser was
 // never added will add the values from the RequestProcessor to the
 // running total for the GlobalRequestProcessor
@@ -394,10 +394,6 @@ class StreamProcessor extends AbstractProcessor {
 if (global != null) {
 global.removeRequestProcessor(request.getRequestProcessor());
 }
-
-// Clear fields that can be cleared to aid GC and trigger NPEs if this
-// is reused
-setSocketWrapper(null);
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/Nio2Channel.java 
b/java/org/apache/tomcat/util/net/Nio2Channel.java
index 603c43f416..9d65266374 100644
--- a/java/org/apache/tomcat/util/net/Nio2Channel.java
+++ b/java/org/apache/tomcat/util/net/Nio2Channel.java
@@ -79,6 +79,7 @@ public class Nio2Channel implements AsynchronousByteChannel {
 @Override
 public void close() throws IOException {
 sc.close();
+reset(this.sc, null);
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/NioChannel.java 
b/java/org/apache/tomcat/util/net/NioChannel.java
index d263ce9ae6..eae3f51171 100644
--- a/java/org/apache/tomcat/util/net/NioChannel.java
+++ b/java/org/apache/tomcat/util/net/NioChannel.java
@@ -81,6 +81,7 @@ public class NioChannel implements ByteChannel, 
ScatteringByteChannel, Gathering
 @Override
 public void close() throws IOException {
 sc.close();
+reset(this.sc,null);
 }
 
 /**


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



[tomcat] branch main updated: Clear SocketWrapper reference to help GC

2023-05-18 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 10492dd22b Clear SocketWrapper reference to help GC
10492dd22b is described below

commit 10492dd22bd64ff63cf77786fa67d45cdc2a54b3
Author: lihan 
AuthorDate: Fri May 19 11:24:27 2023 +0800

Clear SocketWrapper reference to help GC
---
 java/org/apache/coyote/AbstractProcessor.java  | 3 +++
 java/org/apache/coyote/http11/Http11Processor.java | 1 -
 java/org/apache/coyote/http2/StreamProcessor.java  | 6 +-
 java/org/apache/tomcat/util/net/Nio2Channel.java   | 1 +
 java/org/apache/tomcat/util/net/NioChannel.java| 1 +
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProcessor.java 
b/java/org/apache/coyote/AbstractProcessor.java
index 3ee6898fbd..8965dab62b 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -721,6 +721,9 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
 public void recycle() {
 errorState = ErrorState.NONE;
 asyncStateMachine.recycle();
+// Clear fields that can be cleared to aid GC and trigger NPEs if this
+// is reused
+socketWrapper = null;
 }
 
 
diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 9e2e74914c..85dfd34f3c 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -1418,7 +1418,6 @@ public class Http11Processor extends AbstractProcessor {
 inputBuffer.recycle();
 outputBuffer.recycle();
 upgradeToken = null;
-socketWrapper = null;
 sendfileData = null;
 sslSupport = null;
 }
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index 78cb770649..3b1c03ac38 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -392,8 +392,8 @@ class StreamProcessor extends AbstractProcessor {
 
 @Override
 public final void recycle() {
+super.recycle();
 // StreamProcessor instances are not re-used.
-
 // Calling removeRequestProcessor even though the RequestProcesser was
 // never added will add the values from the RequestProcessor to the
 // running total for the GlobalRequestProcessor
@@ -401,10 +401,6 @@ class StreamProcessor extends AbstractProcessor {
 if (global != null) {
 global.removeRequestProcessor(request.getRequestProcessor());
 }
-
-// Clear fields that can be cleared to aid GC and trigger NPEs if this
-// is reused
-setSocketWrapper(null);
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/Nio2Channel.java 
b/java/org/apache/tomcat/util/net/Nio2Channel.java
index 603c43f416..9d65266374 100644
--- a/java/org/apache/tomcat/util/net/Nio2Channel.java
+++ b/java/org/apache/tomcat/util/net/Nio2Channel.java
@@ -79,6 +79,7 @@ public class Nio2Channel implements AsynchronousByteChannel {
 @Override
 public void close() throws IOException {
 sc.close();
+reset(this.sc, null);
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/NioChannel.java 
b/java/org/apache/tomcat/util/net/NioChannel.java
index d263ce9ae6..eae3f51171 100644
--- a/java/org/apache/tomcat/util/net/NioChannel.java
+++ b/java/org/apache/tomcat/util/net/NioChannel.java
@@ -81,6 +81,7 @@ public class NioChannel implements ByteChannel, 
ScatteringByteChannel, Gathering
 @Override
 public void close() throws IOException {
 sc.close();
+reset(this.sc,null);
 }
 
 /**


-
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: Update IDE configs

2023-05-11 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 d86253f2f2 Update IDE configs
d86253f2f2 is described below

commit d86253f2f2a07aa3c7cb388c1bf12db1fe92cc74
Author: lihan 
AuthorDate: Thu May 11 14:59:22 2023 +0800

Update IDE configs
---
 res/ide-support/eclipse/eclipse.classpath | 1 -
 res/ide-support/idea/tomcat.iml   | 2 +-
 res/ide-support/netbeans/project.xml  | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/res/ide-support/eclipse/eclipse.classpath 
b/res/ide-support/eclipse/eclipse.classpath
index 881f58847e..de3d205f3a 100644
--- a/res/ide-support/eclipse/eclipse.classpath
+++ b/res/ide-support/eclipse/eclipse.classpath
@@ -29,7 +29,6 @@
 
 
 
-
 
 
 
diff --git a/res/ide-support/idea/tomcat.iml b/res/ide-support/idea/tomcat.iml
index 4d83e65156..904c85171c 100644
--- a/res/ide-support/idea/tomcat.iml
+++ b/res/ide-support/idea/tomcat.iml
@@ -113,7 +113,7 @@
 
   
 
-  
+  
 
 
 
diff --git a/res/ide-support/netbeans/project.xml 
b/res/ide-support/netbeans/project.xml
index fea783cd6e..05c25d860f 100644
--- a/res/ide-support/netbeans/project.xml
+++ b/res/ide-support/netbeans/project.xml
@@ -178,7 +178,7 @@
 -->
 
 java
-@JAXRPC_JAR@:@WSDL4J_JAR@:@JDT_JAR@:@BND_JAR@:@MIGRATION_JAR@:${ant.includes}/
+@JAXRPC_JAR@:@WSDL4J_JAR@:@JDT_JAR@:${ant.includes}/
 @BUILD_JAVA_VERSION@
 
 


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

2023-05-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 9f37ce0770 Fix typo
9f37ce0770 is described below

commit 9f37ce0770f3a65d07d1e88c55672337c2619393
Author: lihan 
AuthorDate: Fri Apr 28 10:57:48 2023 +0800

Fix typo
---
 test/org/apache/catalina/filters/TestRateLimitFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/filters/TestRateLimitFilter.java 
b/test/org/apache/catalina/filters/TestRateLimitFilter.java
index 7e986e75d0..ca21f5e1f4 100644
--- a/test/org/apache/catalina/filters/TestRateLimitFilter.java
+++ b/test/org/apache/catalina/filters/TestRateLimitFilter.java
@@ -74,7 +74,7 @@ public class TestRateLimitFilter extends TomcatBaseTest {
 // Sleep for up to 10s for clients to complete
 int count = 0;
 while (count < 100 && (tc1.results[24] == 0 || tc2.results[49] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
-tc3.results[allowedRequests] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
+tc3.results[allowedRequests] == 0 || 
tc4.results[allowedRequests - 1] == 0 ||
 tc4.results[allowedRequests] == 0)) {
 Thread.sleep(100);
 count++;


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

2023-05-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 ef5339cc0d Fix typo
ef5339cc0d is described below

commit ef5339cc0db07614a20fe7a335a2db1b8754cb04
Author: lihan 
AuthorDate: Fri Apr 28 10:57:48 2023 +0800

Fix typo
---
 test/org/apache/catalina/filters/TestRateLimitFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/filters/TestRateLimitFilter.java 
b/test/org/apache/catalina/filters/TestRateLimitFilter.java
index ce7467eb64..7e92351f8d 100644
--- a/test/org/apache/catalina/filters/TestRateLimitFilter.java
+++ b/test/org/apache/catalina/filters/TestRateLimitFilter.java
@@ -74,7 +74,7 @@ public class TestRateLimitFilter extends TomcatBaseTest {
 // Sleep for up to 10s for clients to complete
 int count = 0;
 while (count < 100 && (tc1.results[24] == 0 || tc2.results[49] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
-tc3.results[allowedRequests] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
+tc3.results[allowedRequests] == 0 || 
tc4.results[allowedRequests - 1] == 0 ||
 tc4.results[allowedRequests] == 0)) {
 Thread.sleep(100);
 count++;


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

2023-05-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 131d81b879 Fix typo
131d81b879 is described below

commit 131d81b879d42876668b666dcda385e0d01fdd08
Author: lihan 
AuthorDate: Fri Apr 28 10:57:48 2023 +0800

Fix typo
---
 test/org/apache/catalina/filters/TestRateLimitFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/filters/TestRateLimitFilter.java 
b/test/org/apache/catalina/filters/TestRateLimitFilter.java
index b47e67ed60..ac418726ce 100644
--- a/test/org/apache/catalina/filters/TestRateLimitFilter.java
+++ b/test/org/apache/catalina/filters/TestRateLimitFilter.java
@@ -74,7 +74,7 @@ public class TestRateLimitFilter extends TomcatBaseTest {
 // Sleep for up to 10s for clients to complete
 int count = 0;
 while (count < 100 && (tc1.results[24] == 0 || tc2.results[49] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
-tc3.results[allowedRequests] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
+tc3.results[allowedRequests] == 0 || 
tc4.results[allowedRequests - 1] == 0 ||
 tc4.results[allowedRequests] == 0)) {
 Thread.sleep(100);
 count++;


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



[tomcat] branch main updated: Fix typo

2023-05-10 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 f9366fb6c5 Fix typo
f9366fb6c5 is described below

commit f9366fb6c55ded9ca198cecc9aa31c2acf97e244
Author: lihan 
AuthorDate: Fri Apr 28 10:57:48 2023 +0800

Fix typo
---
 test/org/apache/catalina/filters/TestRateLimitFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/filters/TestRateLimitFilter.java 
b/test/org/apache/catalina/filters/TestRateLimitFilter.java
index b47e67ed60..ac418726ce 100644
--- a/test/org/apache/catalina/filters/TestRateLimitFilter.java
+++ b/test/org/apache/catalina/filters/TestRateLimitFilter.java
@@ -74,7 +74,7 @@ public class TestRateLimitFilter extends TomcatBaseTest {
 // Sleep for up to 10s for clients to complete
 int count = 0;
 while (count < 100 && (tc1.results[24] == 0 || tc2.results[49] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
-tc3.results[allowedRequests] == 0 || 
tc3.results[allowedRequests - 1] == 0 ||
+tc3.results[allowedRequests] == 0 || 
tc4.results[allowedRequests - 1] == 0 ||
 tc4.results[allowedRequests] == 0)) {
 Thread.sleep(100);
 count++;


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

2023-04-27 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 fc1e5951b4 Polish
fc1e5951b4 is described below

commit fc1e5951b4cbdbf1fcee422e084d5ee8bafda0ac
Author: lihan 
AuthorDate: Fri Apr 28 10:57:48 2023 +0800

Polish
---
 java/org/apache/catalina/core/ContainerBase.java   | 18 +++
 java/org/apache/catalina/core/StandardServer.java  | 26 +-
 .../apache/catalina/valves/JsonAccessLogValve.java |  2 +-
 3 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/java/org/apache/catalina/core/ContainerBase.java 
b/java/org/apache/catalina/core/ContainerBase.java
index 5275310ec8..7c96f5de5e 100644
--- a/java/org/apache/catalina/core/ContainerBase.java
+++ b/java/org/apache/catalina/core/ContainerBase.java
@@ -400,7 +400,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 this.cluster = cluster;
 
 // Stop the old component if necessary
-if (getState().isAvailable() && (oldCluster != null) && 
(oldCluster instanceof Lifecycle)) {
+if (getState().isAvailable() && (oldCluster instanceof Lifecycle)) 
{
 try {
 ((Lifecycle) oldCluster).stop();
 } catch (LifecycleException e) {
@@ -413,7 +413,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 cluster.setContainer(this);
 }
 
-if (getState().isAvailable() && (cluster != null) && (cluster 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (cluster instanceof Lifecycle)) {
 try {
 ((Lifecycle) cluster).start();
 } catch (LifecycleException e) {
@@ -603,7 +603,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 this.realm = realm;
 
 // Stop the old component if necessary
-if (getState().isAvailable() && (oldRealm != null) && (oldRealm 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (oldRealm instanceof Lifecycle)) {
 try {
 ((Lifecycle) oldRealm).stop();
 } catch (LifecycleException e) {
@@ -615,7 +615,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 if (realm != null) {
 realm.setContainer(this);
 }
-if (getState().isAvailable() && (realm != null) && (realm 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (realm instanceof Lifecycle)) {
 try {
 ((Lifecycle) realm).start();
 } catch (LifecycleException e) {
@@ -865,8 +865,8 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 // Start our child containers, if any
-Container children[] = findChildren();
-List> results = new ArrayList<>();
+Container[] children = findChildren();
+List> results = new ArrayList<>(children.length);
 for (Container child : children) {
 results.add(startStopExecutor.submit(new StartChild(child)));
 }
@@ -930,8 +930,8 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 // Stop our child containers, if any
-Container children[] = findChildren();
-List> results = new ArrayList<>();
+Container[] children = findChildren();
+List> results = new ArrayList<>(children.length);
 for (Container child : children) {
 results.add(startStopExecutor.submit(new StopChild(child)));
 }
@@ -1025,7 +1025,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 AccessLogAdapter adapter = null;
-Valve valves[] = getPipeline().getValves();
+Valve[] valves = getPipeline().getValves();
 for (Valve valve : valves) {
 if (valve instanceof AccessLog) {
 if (adapter == null) {
diff --git a/java/org/apache/catalina/core/StandardServer.java 
b/java/org/apache/catalina/core/StandardServer.java
index 0bf371020c..8db5d8f05a 100644
--- a/java/org/apache/catalina/core/StandardServer.java
+++ b/java/org/apache/catalina/core/StandardServer.java
@@ -140,7 +140,7 @@ public final class StandardServer extends 
LifecycleMBeanBase implements Server {
 /**
  * The set of Services associated with this Server.
  */
-private Service services[] = new Service[0];
+private Service[] services = new Service[0];
 private final Object se

[tomcat] branch 10.1.x updated: Polish

2023-04-27 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 d41f3d03d8 Polish
d41f3d03d8 is described below

commit d41f3d03d86bde44d0180d67a713dfa774c69a92
Author: lihan 
AuthorDate: Fri Apr 28 10:57:48 2023 +0800

Polish
---
 java/org/apache/catalina/core/ContainerBase.java   | 18 +++
 java/org/apache/catalina/core/StandardServer.java  | 26 +-
 .../apache/catalina/valves/JsonAccessLogValve.java |  2 +-
 3 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/java/org/apache/catalina/core/ContainerBase.java 
b/java/org/apache/catalina/core/ContainerBase.java
index 5275310ec8..7c96f5de5e 100644
--- a/java/org/apache/catalina/core/ContainerBase.java
+++ b/java/org/apache/catalina/core/ContainerBase.java
@@ -400,7 +400,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 this.cluster = cluster;
 
 // Stop the old component if necessary
-if (getState().isAvailable() && (oldCluster != null) && 
(oldCluster instanceof Lifecycle)) {
+if (getState().isAvailable() && (oldCluster instanceof Lifecycle)) 
{
 try {
 ((Lifecycle) oldCluster).stop();
 } catch (LifecycleException e) {
@@ -413,7 +413,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 cluster.setContainer(this);
 }
 
-if (getState().isAvailable() && (cluster != null) && (cluster 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (cluster instanceof Lifecycle)) {
 try {
 ((Lifecycle) cluster).start();
 } catch (LifecycleException e) {
@@ -603,7 +603,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 this.realm = realm;
 
 // Stop the old component if necessary
-if (getState().isAvailable() && (oldRealm != null) && (oldRealm 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (oldRealm instanceof Lifecycle)) {
 try {
 ((Lifecycle) oldRealm).stop();
 } catch (LifecycleException e) {
@@ -615,7 +615,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 if (realm != null) {
 realm.setContainer(this);
 }
-if (getState().isAvailable() && (realm != null) && (realm 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (realm instanceof Lifecycle)) {
 try {
 ((Lifecycle) realm).start();
 } catch (LifecycleException e) {
@@ -865,8 +865,8 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 // Start our child containers, if any
-Container children[] = findChildren();
-List> results = new ArrayList<>();
+Container[] children = findChildren();
+List> results = new ArrayList<>(children.length);
 for (Container child : children) {
 results.add(startStopExecutor.submit(new StartChild(child)));
 }
@@ -930,8 +930,8 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 // Stop our child containers, if any
-Container children[] = findChildren();
-List> results = new ArrayList<>();
+Container[] children = findChildren();
+List> results = new ArrayList<>(children.length);
 for (Container child : children) {
 results.add(startStopExecutor.submit(new StopChild(child)));
 }
@@ -1025,7 +1025,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 AccessLogAdapter adapter = null;
-Valve valves[] = getPipeline().getValves();
+Valve[] valves = getPipeline().getValves();
 for (Valve valve : valves) {
 if (valve instanceof AccessLog) {
 if (adapter == null) {
diff --git a/java/org/apache/catalina/core/StandardServer.java 
b/java/org/apache/catalina/core/StandardServer.java
index 9c6f4b2173..5f4637153b 100644
--- a/java/org/apache/catalina/core/StandardServer.java
+++ b/java/org/apache/catalina/core/StandardServer.java
@@ -136,7 +136,7 @@ public final class StandardServer extends 
LifecycleMBeanBase implements Server {
 /**
  * The set of Services associated with this Server.
  */
-private Service services[] = new Service[0];
+private Service[] services = new Service[0];
 private final Object se

[tomcat] branch main updated: Polish

2023-04-27 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 fa0b2b196d Polish
fa0b2b196d is described below

commit fa0b2b196d8525a662e9edec258650865da465ed
Author: lihan 
AuthorDate: Fri Apr 28 10:57:48 2023 +0800

Polish
---
 java/org/apache/catalina/core/ContainerBase.java   | 18 +++
 java/org/apache/catalina/core/StandardServer.java  | 26 +-
 .../apache/catalina/valves/JsonAccessLogValve.java |  2 +-
 3 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/java/org/apache/catalina/core/ContainerBase.java 
b/java/org/apache/catalina/core/ContainerBase.java
index 9dc018be15..784c9032ef 100644
--- a/java/org/apache/catalina/core/ContainerBase.java
+++ b/java/org/apache/catalina/core/ContainerBase.java
@@ -377,7 +377,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 this.cluster = cluster;
 
 // Stop the old component if necessary
-if (getState().isAvailable() && (oldCluster != null) && 
(oldCluster instanceof Lifecycle)) {
+if (getState().isAvailable() && (oldCluster instanceof Lifecycle)) 
{
 try {
 ((Lifecycle) oldCluster).stop();
 } catch (LifecycleException e) {
@@ -390,7 +390,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 cluster.setContainer(this);
 }
 
-if (getState().isAvailable() && (cluster != null) && (cluster 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (cluster instanceof Lifecycle)) {
 try {
 ((Lifecycle) cluster).start();
 } catch (LifecycleException e) {
@@ -580,7 +580,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 this.realm = realm;
 
 // Stop the old component if necessary
-if (getState().isAvailable() && (oldRealm != null) && (oldRealm 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (oldRealm instanceof Lifecycle)) {
 try {
 ((Lifecycle) oldRealm).stop();
 } catch (LifecycleException e) {
@@ -592,7 +592,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 if (realm != null) {
 realm.setContainer(this);
 }
-if (getState().isAvailable() && (realm != null) && (realm 
instanceof Lifecycle)) {
+if (getState().isAvailable() && (realm instanceof Lifecycle)) {
 try {
 ((Lifecycle) realm).start();
 } catch (LifecycleException e) {
@@ -832,8 +832,8 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 // Start our child containers, if any
-Container children[] = findChildren();
-List> results = new ArrayList<>();
+Container[] children = findChildren();
+List> results = new ArrayList<>(children.length);
 for (Container child : children) {
 results.add(startStopExecutor.submit(new StartChild(child)));
 }
@@ -897,8 +897,8 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 // Stop our child containers, if any
-Container children[] = findChildren();
-List> results = new ArrayList<>();
+Container[] children = findChildren();
+List> results = new ArrayList<>(children.length);
 for (Container child : children) {
 results.add(startStopExecutor.submit(new StopChild(child)));
 }
@@ -992,7 +992,7 @@ public abstract class ContainerBase extends 
LifecycleMBeanBase implements Contai
 }
 
 AccessLogAdapter adapter = null;
-Valve valves[] = getPipeline().getValves();
+Valve[] valves = getPipeline().getValves();
 for (Valve valve : valves) {
 if (valve instanceof AccessLog) {
 if (adapter == null) {
diff --git a/java/org/apache/catalina/core/StandardServer.java 
b/java/org/apache/catalina/core/StandardServer.java
index eb5e91e932..09a223fa80 100644
--- a/java/org/apache/catalina/core/StandardServer.java
+++ b/java/org/apache/catalina/core/StandardServer.java
@@ -135,7 +135,7 @@ public final class StandardServer extends 
LifecycleMBeanBase implements Server {
 /**
  * The set of Services associated with this Server.
  */
-private Service services[] = new Service[0];
+private Service[] services = new Service[0];
 private final Object se

[tomcat] branch 8.5.x updated: Ensure brackets are closed in PoolProperties.toString

2023-04-24 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 ccdb4995cd Ensure brackets are closed in PoolProperties.toString
ccdb4995cd is described below

commit ccdb4995cdf98362732664b4a5077af53926d2c6
Author: Magnus Reftel 
AuthorDate: Mon Apr 24 12:41:51 2023 +0200

Ensure brackets are closed in PoolProperties.toString
---
 .../apache/tomcat/jdbc/pool/PoolProperties.java|  1 +
 .../tomcat/jdbc/pool/PoolPropertiesTest.java   | 39 ++
 2 files changed, 40 insertions(+)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
index f333c3de59..73479e250c 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
@@ -848,6 +848,7 @@ public class PoolProperties implements PoolConfiguration, 
Cloneable, Serializabl
 break;
 }
 }
+buf.append(']');
 }catch (Exception x) {
 //shouldn't happen
 log.debug("toString() call failed", x);
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
new file mode 100644
index 00..b475d64f23
--- /dev/null
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
@@ -0,0 +1,39 @@
+package org.apache.tomcat.jdbc.pool;
+
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PoolPropertiesTest {
+private static final String DEFAULT_USER = "username_def";
+private static final String DEFAULT_PASSWD = "password_def";
+@Test
+public void toStringOutputShouldHaveBalancedBrackets() {
+PoolProperties properties = new PoolProperties();
+properties.setUsername(DEFAULT_USER);
+properties.setPassword(DEFAULT_PASSWD);
+properties.setAlternateUsernameAllowed(true);
+properties.setInitialSize(0);
+properties.setRemoveAbandoned(false);
+properties.setTimeBetweenEvictionRunsMillis(-1);
+
+String asString = properties.toString();
+
+List stack = new ArrayList<>();
+for (char c : asString.toCharArray()) {
+switch (c) {
+case '{':
+case '(':
+case '[': stack.add(c); break;
+case '}': Assert.assertEquals('{', stack.remove(stack.size() - 
1).charValue()); break;
+case ')': Assert.assertEquals('(', stack.remove(stack.size() - 
1).charValue()); break;
+case ']': Assert.assertEquals('[', stack.remove(stack.size() - 
1).charValue()); break;
+default: break;
+}
+}
+Assert.assertEquals("All brackets should have been closed", 0, 
stack.size());
+}
+}


-
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: Ensure brackets are closed in PoolProperties.toString

2023-04-24 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 8908c58089 Ensure brackets are closed in PoolProperties.toString
8908c58089 is described below

commit 8908c5808987a071a0afb6da8ebff506bb1424e0
Author: Magnus Reftel 
AuthorDate: Mon Apr 24 12:41:51 2023 +0200

Ensure brackets are closed in PoolProperties.toString
---
 .../apache/tomcat/jdbc/pool/PoolProperties.java|  1 +
 .../tomcat/jdbc/pool/PoolPropertiesTest.java   | 39 ++
 2 files changed, 40 insertions(+)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
index e9c9c09b69..3aff37fa53 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
@@ -848,6 +848,7 @@ public class PoolProperties implements PoolConfiguration, 
Cloneable, Serializabl
 break;
 }
 }
+buf.append(']');
 }catch (Exception x) {
 //shouldn't happen
 log.debug("toString() call failed", x);
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
new file mode 100644
index 00..b475d64f23
--- /dev/null
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
@@ -0,0 +1,39 @@
+package org.apache.tomcat.jdbc.pool;
+
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PoolPropertiesTest {
+private static final String DEFAULT_USER = "username_def";
+private static final String DEFAULT_PASSWD = "password_def";
+@Test
+public void toStringOutputShouldHaveBalancedBrackets() {
+PoolProperties properties = new PoolProperties();
+properties.setUsername(DEFAULT_USER);
+properties.setPassword(DEFAULT_PASSWD);
+properties.setAlternateUsernameAllowed(true);
+properties.setInitialSize(0);
+properties.setRemoveAbandoned(false);
+properties.setTimeBetweenEvictionRunsMillis(-1);
+
+String asString = properties.toString();
+
+List stack = new ArrayList<>();
+for (char c : asString.toCharArray()) {
+switch (c) {
+case '{':
+case '(':
+case '[': stack.add(c); break;
+case '}': Assert.assertEquals('{', stack.remove(stack.size() - 
1).charValue()); break;
+case ')': Assert.assertEquals('(', stack.remove(stack.size() - 
1).charValue()); break;
+case ']': Assert.assertEquals('[', stack.remove(stack.size() - 
1).charValue()); break;
+default: break;
+}
+}
+Assert.assertEquals("All brackets should have been closed", 0, 
stack.size());
+}
+}


-
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: Ensure brackets are closed in PoolProperties.toString

2023-04-24 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 7e93ea8206 Ensure brackets are closed in PoolProperties.toString
7e93ea8206 is described below

commit 7e93ea82066868f1a08431ba7778376dd8773a0c
Author: Magnus Reftel 
AuthorDate: Mon Apr 24 12:41:51 2023 +0200

Ensure brackets are closed in PoolProperties.toString
---
 .../apache/tomcat/jdbc/pool/PoolProperties.java|  1 +
 .../tomcat/jdbc/pool/PoolPropertiesTest.java   | 39 ++
 2 files changed, 40 insertions(+)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
index e9c9c09b69..3aff37fa53 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
@@ -848,6 +848,7 @@ public class PoolProperties implements PoolConfiguration, 
Cloneable, Serializabl
 break;
 }
 }
+buf.append(']');
 }catch (Exception x) {
 //shouldn't happen
 log.debug("toString() call failed", x);
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
new file mode 100644
index 00..b475d64f23
--- /dev/null
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
@@ -0,0 +1,39 @@
+package org.apache.tomcat.jdbc.pool;
+
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PoolPropertiesTest {
+private static final String DEFAULT_USER = "username_def";
+private static final String DEFAULT_PASSWD = "password_def";
+@Test
+public void toStringOutputShouldHaveBalancedBrackets() {
+PoolProperties properties = new PoolProperties();
+properties.setUsername(DEFAULT_USER);
+properties.setPassword(DEFAULT_PASSWD);
+properties.setAlternateUsernameAllowed(true);
+properties.setInitialSize(0);
+properties.setRemoveAbandoned(false);
+properties.setTimeBetweenEvictionRunsMillis(-1);
+
+String asString = properties.toString();
+
+List stack = new ArrayList<>();
+for (char c : asString.toCharArray()) {
+switch (c) {
+case '{':
+case '(':
+case '[': stack.add(c); break;
+case '}': Assert.assertEquals('{', stack.remove(stack.size() - 
1).charValue()); break;
+case ')': Assert.assertEquals('(', stack.remove(stack.size() - 
1).charValue()); break;
+case ']': Assert.assertEquals('[', stack.remove(stack.size() - 
1).charValue()); break;
+default: break;
+}
+}
+Assert.assertEquals("All brackets should have been closed", 0, 
stack.size());
+}
+}


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



[tomcat] branch main updated: Ensure brackets are closed in PoolProperties.toString

2023-04-24 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 a3671d2e99 Ensure brackets are closed in PoolProperties.toString
a3671d2e99 is described below

commit a3671d2e99c1526e9943a16efede6cb8f2b8057a
Author: Magnus Reftel 
AuthorDate: Mon Apr 24 12:41:51 2023 +0200

Ensure brackets are closed in PoolProperties.toString
---
 .../apache/tomcat/jdbc/pool/PoolProperties.java|  1 +
 .../tomcat/jdbc/pool/PoolPropertiesTest.java   | 39 ++
 2 files changed, 40 insertions(+)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
index e9c9c09b69..3aff37fa53 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java
@@ -848,6 +848,7 @@ public class PoolProperties implements PoolConfiguration, 
Cloneable, Serializabl
 break;
 }
 }
+buf.append(']');
 }catch (Exception x) {
 //shouldn't happen
 log.debug("toString() call failed", x);
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
new file mode 100644
index 00..b475d64f23
--- /dev/null
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java
@@ -0,0 +1,39 @@
+package org.apache.tomcat.jdbc.pool;
+
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PoolPropertiesTest {
+private static final String DEFAULT_USER = "username_def";
+private static final String DEFAULT_PASSWD = "password_def";
+@Test
+public void toStringOutputShouldHaveBalancedBrackets() {
+PoolProperties properties = new PoolProperties();
+properties.setUsername(DEFAULT_USER);
+properties.setPassword(DEFAULT_PASSWD);
+properties.setAlternateUsernameAllowed(true);
+properties.setInitialSize(0);
+properties.setRemoveAbandoned(false);
+properties.setTimeBetweenEvictionRunsMillis(-1);
+
+String asString = properties.toString();
+
+List stack = new ArrayList<>();
+for (char c : asString.toCharArray()) {
+switch (c) {
+case '{':
+case '(':
+case '[': stack.add(c); break;
+case '}': Assert.assertEquals('{', stack.remove(stack.size() - 
1).charValue()); break;
+case ')': Assert.assertEquals('(', stack.remove(stack.size() - 
1).charValue()); break;
+case ']': Assert.assertEquals('[', stack.remove(stack.size() - 
1).charValue()); break;
+default: break;
+}
+}
+Assert.assertEquals("All brackets should have been closed", 0, 
stack.size());
+}
+}


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

2023-03-14 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 cbb08b1be3 Fix changelog entry
cbb08b1be3 is described below

commit cbb08b1be39e7c4db468a5df54328084ff98dec7
Author: lihan 
AuthorDate: Wed Mar 15 10:58:34 2023 +0800

Fix changelog entry
---
 webapps/docs/changelog.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 9b8b070a20..fe5ef0abc2 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -131,6 +131,7 @@
   
 66524 Correct eviction ordering in WebResource cache to
 by LRU as intended. (schultz)
+  
 
   
   


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

2023-03-14 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 cd2566a28c Fix changelog entry
cd2566a28c is described below

commit cd2566a28cfab43cbba19aa600b56f4d5cb3e533
Author: lihan 
AuthorDate: Wed Mar 15 10:58:34 2023 +0800

Fix changelog entry
---
 webapps/docs/changelog.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 5cbbdfaebb..39c4d6707f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -131,6 +131,7 @@
   
 66524 Correct eviction ordering in WebResource cache to
 by LRU as intended. (schultz)
+  
 
   
   


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



[tomcat] branch 10.1.x updated: Fix changelog entry

2023-03-14 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 3cf7c5fdc9 Fix changelog entry
3cf7c5fdc9 is described below

commit 3cf7c5fdc98b09e5dcf13db933f23c8cad3b3be5
Author: lihan 
AuthorDate: Wed Mar 15 10:58:34 2023 +0800

Fix changelog entry
---
 webapps/docs/changelog.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index d0470c6b74..c574b05f88 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -131,6 +131,7 @@
   
 66524 Correct eviction ordering in WebResource cache to
 by LRU as intended. (schultz)
+  
 
   
   


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



[tomcat] branch main updated: Fix changelog entry

2023-03-14 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 f28f12e5b6 Fix changelog entry
f28f12e5b6 is described below

commit f28f12e5b639a40c3cef4278ee55738d14a62111
Author: lihan 
AuthorDate: Wed Mar 15 10:58:34 2023 +0800

Fix changelog entry
---
 webapps/docs/changelog.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 6eb73d1c60..46b8da05be 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -155,6 +155,7 @@
   
 66524 Correct eviction ordering in WebResource cache to
 by LRU as intended. (schultz)
+  
 
   
   


-
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: Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

2023-03-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 3f01b8bdec Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)
3f01b8bdec is described below

commit 3f01b8bdec0663c6f8f815225a1100900c1d9708
Author: lihan 
AuthorDate: Fri Mar 10 15:22:50 2023 +0800

Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

Submitted by Andrei Briukhov
---
 conf/web.xml  | 4 ++--
 java/org/apache/catalina/servlets/CGIServlet.java | 4 ++--
 test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java | 2 +-
 webapps/docs/cgi-howto.xml| 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/conf/web.xml b/conf/web.xml
index 86777073bb..01eacede64 100644
--- a/conf/web.xml
+++ b/conf/web.xml
@@ -356,7 +356,7 @@
   
   
   
-  
+  
   
   
   
@@ -367,7 +367,7 @@
   
   
   
-  
+  
   
   
   
diff --git a/java/org/apache/catalina/servlets/CGIServlet.java 
b/java/org/apache/catalina/servlets/CGIServlet.java
index a80c5d1911..a406a4a756 100644
--- a/java/org/apache/catalina/servlets/CGIServlet.java
+++ b/java/org/apache/catalina/servlets/CGIServlet.java
@@ -254,7 +254,7 @@ public final class CGIServlet extends HttpServlet {
 DEFAULT_SUPER_METHODS.add("TRACE");
 
 if (JrePlatform.IS_WINDOWS) {
-DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 } else {
 // No restrictions
 DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = null;
@@ -323,7 +323,7 @@ public final class CGIServlet extends HttpServlet {
  * Uses \Q...\E to avoid individual quoting.
  */
 private Pattern cmdLineArgumentsEncodedPattern =
-Pattern.compile("[a-zA-Z0-9\\Q%;/?:@&,$-_.!~*'()\\E]+");
+Pattern.compile("[\\w\\Q%;/?:@&,$-.!~*'()\\E]+");
 
 /**
  * Limits the decoded form of individual command line arguments. Default
diff --git 
a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java 
b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
index c2bbae3bee..37e241f5a4 100755
--- a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
+++ b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
@@ -41,7 +41,7 @@ public class TestCGIServletCmdLineArguments {
  * here. This was chosen as it is simple and the tests are run on
  * Windows as part of every release cycle.
  */
-defaultDecodedPatternWindows = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+defaultDecodedPatternWindows = Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 
 if (JrePlatform.IS_WINDOWS) {
 Pattern p = null;
diff --git a/webapps/docs/cgi-howto.xml b/webapps/docs/cgi-howto.xml
index e00faf0a19..b3b76937f9 100644
--- a/webapps/docs/cgi-howto.xml
+++ b/webapps/docs/cgi-howto.xml
@@ -116,7 +116,7 @@ by Daniel Colascione.
 are enabled (via enableCmdLineArguments) individual encoded
 command line argument must match this pattern else the request will be 
rejected.
 The default matches the allowed values defined by RFC3875 and is
-[a-zA-Z0-9\Q%;/?:@,$-_.!~*'()\E]+
+[\w\Q%;/?:@,$-.!~*'()\E]+
 enableCmdLineArguments - Are command line arguments
 generated from the query string as per section 4.4 of 3875 RFC? The default is
 false.


-
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: Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

2023-03-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 6918c28c77 Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)
6918c28c77 is described below

commit 6918c28c776c7b7d2104b26b9768b46eeb4352a0
Author: lihan 
AuthorDate: Fri Mar 10 15:22:50 2023 +0800

Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

Submitted by Andrei Briukhov
---
 conf/web.xml  | 4 ++--
 java/org/apache/catalina/servlets/CGIServlet.java | 4 ++--
 test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java | 2 +-
 webapps/docs/cgi-howto.xml| 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/conf/web.xml b/conf/web.xml
index ddabd5efa9..0b8b1edfe7 100644
--- a/conf/web.xml
+++ b/conf/web.xml
@@ -363,7 +363,7 @@
   
   
   
-  
+  
   
   
   
@@ -374,7 +374,7 @@
   
   
   
-  
+  
   
   
   
diff --git a/java/org/apache/catalina/servlets/CGIServlet.java 
b/java/org/apache/catalina/servlets/CGIServlet.java
index 1c01714ff7..2c03cf7601 100644
--- a/java/org/apache/catalina/servlets/CGIServlet.java
+++ b/java/org/apache/catalina/servlets/CGIServlet.java
@@ -254,7 +254,7 @@ public final class CGIServlet extends HttpServlet {
 DEFAULT_SUPER_METHODS.add("TRACE");
 
 if (JrePlatform.IS_WINDOWS) {
-DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 } else {
 // No restrictions
 DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = null;
@@ -323,7 +323,7 @@ public final class CGIServlet extends HttpServlet {
  * Uses \Q...\E to avoid individual quoting.
  */
 private Pattern cmdLineArgumentsEncodedPattern =
-Pattern.compile("[a-zA-Z0-9\\Q%;/?:@&,$-_.!~*'()\\E]+");
+Pattern.compile("[\\w\\Q%;/?:@&,$-.!~*'()\\E]+");
 
 /**
  * Limits the decoded form of individual command line arguments. Default
diff --git 
a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java 
b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
index c2bbae3bee..37e241f5a4 100755
--- a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
+++ b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
@@ -41,7 +41,7 @@ public class TestCGIServletCmdLineArguments {
  * here. This was chosen as it is simple and the tests are run on
  * Windows as part of every release cycle.
  */
-defaultDecodedPatternWindows = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+defaultDecodedPatternWindows = Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 
 if (JrePlatform.IS_WINDOWS) {
 Pattern p = null;
diff --git a/webapps/docs/cgi-howto.xml b/webapps/docs/cgi-howto.xml
index e00faf0a19..b3b76937f9 100644
--- a/webapps/docs/cgi-howto.xml
+++ b/webapps/docs/cgi-howto.xml
@@ -116,7 +116,7 @@ by Daniel Colascione.
 are enabled (via enableCmdLineArguments) individual encoded
 command line argument must match this pattern else the request will be 
rejected.
 The default matches the allowed values defined by RFC3875 and is
-[a-zA-Z0-9\Q%;/?:@,$-_.!~*'()\E]+
+[\w\Q%;/?:@,$-.!~*'()\E]+
 enableCmdLineArguments - Are command line arguments
 generated from the query string as per section 4.4 of 3875 RFC? The default is
 false.


-
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: Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

2023-03-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 7ed9261493 Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)
7ed9261493 is described below

commit 7ed92614933fcaecacf647e6bfbe8064e34adca1
Author: lihan 
AuthorDate: Fri Mar 10 15:22:50 2023 +0800

Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

Submitted by Andrei Briukhov
---
 conf/web.xml  | 4 ++--
 java/org/apache/catalina/servlets/CGIServlet.java | 4 ++--
 test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java | 2 +-
 webapps/docs/cgi-howto.xml| 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/conf/web.xml b/conf/web.xml
index 123a9257ee..8f706c8290 100644
--- a/conf/web.xml
+++ b/conf/web.xml
@@ -363,7 +363,7 @@
   
   
   
-  
+  
   
   
   
@@ -374,7 +374,7 @@
   
   
   
-  
+  
   
   
   
diff --git a/java/org/apache/catalina/servlets/CGIServlet.java 
b/java/org/apache/catalina/servlets/CGIServlet.java
index d0755c6fdd..e1cda7bb97 100644
--- a/java/org/apache/catalina/servlets/CGIServlet.java
+++ b/java/org/apache/catalina/servlets/CGIServlet.java
@@ -255,7 +255,7 @@ public final class CGIServlet extends HttpServlet {
 DEFAULT_SUPER_METHODS.add("TRACE");
 
 if (JrePlatform.IS_WINDOWS) {
-DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 } else {
 // No restrictions
 DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = null;
@@ -324,7 +324,7 @@ public final class CGIServlet extends HttpServlet {
  * Uses \Q...\E to avoid individual quoting.
  */
 private Pattern cmdLineArgumentsEncodedPattern =
-Pattern.compile("[a-zA-Z0-9\\Q%;/?:@&,$-_.!~*'()\\E]+");
+Pattern.compile("[\\w\\Q%;/?:@&,$-.!~*'()\\E]+");
 
 /**
  * Limits the decoded form of individual command line arguments. Default
diff --git 
a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java 
b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
index c2bbae3bee..37e241f5a4 100755
--- a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
+++ b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
@@ -41,7 +41,7 @@ public class TestCGIServletCmdLineArguments {
  * here. This was chosen as it is simple and the tests are run on
  * Windows as part of every release cycle.
  */
-defaultDecodedPatternWindows = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+defaultDecodedPatternWindows = Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 
 if (JrePlatform.IS_WINDOWS) {
 Pattern p = null;
diff --git a/webapps/docs/cgi-howto.xml b/webapps/docs/cgi-howto.xml
index e00faf0a19..b3b76937f9 100644
--- a/webapps/docs/cgi-howto.xml
+++ b/webapps/docs/cgi-howto.xml
@@ -116,7 +116,7 @@ by Daniel Colascione.
 are enabled (via enableCmdLineArguments) individual encoded
 command line argument must match this pattern else the request will be 
rejected.
 The default matches the allowed values defined by RFC3875 and is
-[a-zA-Z0-9\Q%;/?:@,$-_.!~*'()\E]+
+[\w\Q%;/?:@,$-.!~*'()\E]+
 enableCmdLineArguments - Are command line arguments
 generated from the query string as per section 4.4 of 3875 RFC? The default is
 false.


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



[tomcat] branch main updated: Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

2023-03-09 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 c8fba3264d Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)
c8fba3264d is described below

commit c8fba3264d0c75637a44eb403d10b163384981e7
Author: lihan 
AuthorDate: Fri Mar 10 15:22:50 2023 +0800

Improved regexp performance: "a-zA-Z0-9_" -> "\w" (#592)

Submitted by Andrei Briukhov
---
 conf/web.xml  | 4 ++--
 java/org/apache/catalina/servlets/CGIServlet.java | 4 ++--
 test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java | 2 +-
 webapps/docs/cgi-howto.xml| 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/conf/web.xml b/conf/web.xml
index 00acceb763..1a5cbfecd0 100644
--- a/conf/web.xml
+++ b/conf/web.xml
@@ -359,7 +359,7 @@
   
   
   
-  
+  
   
   
   
@@ -370,7 +370,7 @@
   
   
   
-  
+  
   
   
   
diff --git a/java/org/apache/catalina/servlets/CGIServlet.java 
b/java/org/apache/catalina/servlets/CGIServlet.java
index d0755c6fdd..e1cda7bb97 100644
--- a/java/org/apache/catalina/servlets/CGIServlet.java
+++ b/java/org/apache/catalina/servlets/CGIServlet.java
@@ -255,7 +255,7 @@ public final class CGIServlet extends HttpServlet {
 DEFAULT_SUPER_METHODS.add("TRACE");
 
 if (JrePlatform.IS_WINDOWS) {
-DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = 
Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 } else {
 // No restrictions
 DEFAULT_CMD_LINE_ARGUMENTS_DECODED_PATTERN = null;
@@ -324,7 +324,7 @@ public final class CGIServlet extends HttpServlet {
  * Uses \Q...\E to avoid individual quoting.
  */
 private Pattern cmdLineArgumentsEncodedPattern =
-Pattern.compile("[a-zA-Z0-9\\Q%;/?:@&,$-_.!~*'()\\E]+");
+Pattern.compile("[\\w\\Q%;/?:@&,$-.!~*'()\\E]+");
 
 /**
  * Limits the decoded form of individual command line arguments. Default
diff --git 
a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java 
b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
index c2bbae3bee..37e241f5a4 100755
--- a/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
+++ b/test/org/apache/catalina/servlets/TestCGIServletCmdLineArguments.java
@@ -41,7 +41,7 @@ public class TestCGIServletCmdLineArguments {
  * here. This was chosen as it is simple and the tests are run on
  * Windows as part of every release cycle.
  */
-defaultDecodedPatternWindows = 
Pattern.compile("[a-zA-Z0-9\\Q-_.\\/:\\E]+");
+defaultDecodedPatternWindows = Pattern.compile("[\\w\\Q-.\\/:\\E]+");
 
 if (JrePlatform.IS_WINDOWS) {
 Pattern p = null;
diff --git a/webapps/docs/cgi-howto.xml b/webapps/docs/cgi-howto.xml
index d1f3e0d0c9..cc5befa5d5 100644
--- a/webapps/docs/cgi-howto.xml
+++ b/webapps/docs/cgi-howto.xml
@@ -115,7 +115,7 @@ by Daniel Colascione.
 are enabled (via enableCmdLineArguments) individual encoded
 command line argument must match this pattern else the request will be 
rejected.
 The default matches the allowed values defined by RFC3875 and is
-[a-zA-Z0-9\Q%;/?:@,$-_.!~*'()\E]+
+[\w\Q%;/?:@,$-.!~*'()\E]+
 enableCmdLineArguments - Are command line arguments
 generated from the query string as per section 4.4 of 3875 RFC? The default is
 false.


-
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 a changelog entry.

2023-03-07 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 c41187f75e Add a changelog entry.
c41187f75e is described below

commit c41187f75e88eec0d0dfb35f6b06b8f9f7e6080a
Author: lihan 
AuthorDate: Tue Mar 7 17:12:19 2023 +0800

Add a changelog entry.
---
 webapps/docs/changelog.xml | 5 +
 1 file changed, 5 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8494481a8d..affc066fa7 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -152,6 +152,11 @@
 Refactor code using MD5Encoder to use
 HexUtils.toHexString(). (markt)
   
+  
+66507: Fix a bug that $JAVA_OPTS is not passed
+to the jvm in catalina.sh when calling 
version.
+Patch suggested by Eric Hamilton. (lihan)
+  
 
   
 


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



[tomcat] branch 9.0.x updated: Add a changelog entry.

2023-03-07 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 9e14971e48 Add a changelog entry.
9e14971e48 is described below

commit 9e14971e4874a979c93cb6c10faf583f385f9cc6
Author: lihan 
AuthorDate: Tue Mar 7 17:12:19 2023 +0800

Add a changelog entry.
---
 webapps/docs/changelog.xml | 5 +
 1 file changed, 5 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index a8ae064e76..f9e1d61715 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -152,6 +152,11 @@
 Refactor code using MD5Encoder to use
 HexUtils.toHexString(). (markt)
   
+  
+66507: Fix a bug that $JAVA_OPTS is not passed
+to the jvm in catalina.sh when calling 
version.
+Patch suggested by Eric Hamilton. (lihan)
+  
 
   
 


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



[tomcat] branch 10.1.x updated: Add a changelog entry.

2023-03-07 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 43cf5dc73c Add a changelog entry.
43cf5dc73c is described below

commit 43cf5dc73c86a6e2a037a7ee068d5654455ef0e1
Author: lihan 
AuthorDate: Tue Mar 7 17:12:19 2023 +0800

Add a changelog entry.
---
 webapps/docs/changelog.xml | 5 +
 1 file changed, 5 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f2718b42d0..3018a49ad2 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -152,6 +152,11 @@
 Refactor code using MD5Encoder to use
 HexUtils.toHexString(). (markt)
   
+  
+66507: Fix a bug that $JAVA_OPTS is not passed
+to the jvm in catalina.sh when calling 
version.
+Patch suggested by Eric Hamilton. (lihan)
+  
 
   
 


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



[tomcat] branch main updated: Add a changelog entry.

2023-03-07 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 b189ac03df Add a changelog entry.
b189ac03df is described below

commit b189ac03df02e00d44001c8181886466ead62eb4
Author: lihan 
AuthorDate: Tue Mar 7 17:12:19 2023 +0800

Add a changelog entry.
---
 webapps/docs/changelog.xml | 5 +
 1 file changed, 5 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 0bcbfc81d9..7efb35c2e1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -162,6 +162,11 @@
 Refactor code using MD5Encoder to use
 HexUtils.toHexString(). (markt)
   
+  
+66507: Fix a bug that $JAVA_OPTS is not passed
+to the jvm in catalina.sh when calling 
version.
+Patch suggested by Eric Hamilton. (lihan)
+  
 
   
 


-
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 wrong exception message.#595

2023-03-07 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 c3bc80cebf Fix wrong exception message.#595
c3bc80cebf is described below

commit c3bc80cebf12b2425562a042aed3c9d58ee99448
Author: lihan 
AuthorDate: Tue Mar 7 16:47:29 2023 +0800

Fix wrong exception message.#595
---
 java/javax/servlet/http/HttpFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/javax/servlet/http/HttpFilter.java 
b/java/javax/servlet/http/HttpFilter.java
index 40394a6343..11ad7a2326 100644
--- a/java/javax/servlet/http/HttpFilter.java
+++ b/java/javax/servlet/http/HttpFilter.java
@@ -48,7 +48,7 @@ public abstract class HttpFilter extends GenericFilter {
 throw new ServletException(request + " not HttpServletRequest");
 }
 if (!(response instanceof HttpServletResponse)) {
-throw new ServletException(request + " not HttpServletResponse");
+throw new ServletException(response + " not HttpServletResponse");
 }
 doFilter((HttpServletRequest) request, (HttpServletResponse) response, 
chain);
 }


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



[tomcat] branch main updated (e020b669a5 -> 154fdc5636)

2023-03-07 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


from e020b669a5 Revert "Align with spec"
 add 154fdc5636 Fix wrong exception message.#595

No new revisions were added by this update.

Summary of changes:
 java/jakarta/servlet/http/HttpFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


-
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 wrong exception message.#595

2023-03-07 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 4958e268c1 Fix wrong exception message.#595
4958e268c1 is described below

commit 4958e268c16bd6fc49e71db23f202f72b935ed3d
Author: lihan 
AuthorDate: Tue Mar 7 16:47:29 2023 +0800

Fix wrong exception message.#595
---
 java/jakarta/servlet/http/HttpFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/jakarta/servlet/http/HttpFilter.java 
b/java/jakarta/servlet/http/HttpFilter.java
index 4c7154bea6..b02a306dbf 100644
--- a/java/jakarta/servlet/http/HttpFilter.java
+++ b/java/jakarta/servlet/http/HttpFilter.java
@@ -48,7 +48,7 @@ public abstract class HttpFilter extends GenericFilter {
 throw new ServletException(request + " not HttpServletRequest");
 }
 if (!(response instanceof HttpServletResponse)) {
-throw new ServletException(request + " not HttpServletResponse");
+throw new ServletException(response + " not HttpServletResponse");
 }
 doFilter((HttpServletRequest) request, (HttpServletResponse) response, 
chain);
 }


-
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: Revert "Align with spec"

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 1f81fd0367 Revert "Align with spec"
1f81fd0367 is described below

commit 1f81fd0367cd2a304873d5290e54dfbd2be447e7
Author: lihan 
AuthorDate: Tue Mar 7 15:22:39 2023 +0800

Revert "Align with spec"

This reverts commit e6cb59c0
---
 java/javax/servlet/http/HttpFilter.java | 130 +++-
 1 file changed, 44 insertions(+), 86 deletions(-)

diff --git a/java/javax/servlet/http/HttpFilter.java 
b/java/javax/servlet/http/HttpFilter.java
index f9b37eb635..40394a6343 100644
--- a/java/javax/servlet/http/HttpFilter.java
+++ b/java/javax/servlet/http/HttpFilter.java
@@ -25,105 +25,63 @@ import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
 /**
- *
- * 
- * Provides an abstract class to be subclassed to create an HTTP filter 
suitable for a Web site. A subclass of
- * HttpFilter should override
- * {@link #doFilter(javax.servlet.http.HttpServletRequest, 
javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) }.
- * 
- *
- * 
- * Filters typically run on multithreaded servers, so be aware that a filter 
must handle concurrent requests and be
- * careful to synchronize access to shared resources. Shared resources include 
in-memory data such as instance or class
- * variables and external objects such as files, database connections, and 
network connections. See the
- * https://docs.oracle.com/javase/tutorial/essential/concurrency/;> 
Java Tutorial on Multithreaded
- * Programming for more information on handling multiple threads in a Java 
program.
- *
- * @author Various
- *
- * @since Servlet 4.0
+ * Provides a base class that implements the Filter interface and ensures that 
the Request and Response are of type
+ * HttpServletRequest and HttpServletResponse respectively.
  */
 public abstract class HttpFilter extends GenericFilter {
 
-private static final long serialVersionUID = 7478463438252262094L;
-
-/**
- * 
- * Does nothing, because this is an abstract class.
- * 
- *
- * @since Servlet 4.0
- */
-public HttpFilter() {
-}
+private static final long serialVersionUID = 1L;
 
 /**
+ * {@inheritDoc} This implementation tests the request and response to see 
if they are instances of
+ * {@link HttpServletRequest} and {@link HttpServletResponse} 
respectively. If they are then they are passed to
+ * {@link #doFilter(HttpServletRequest, HttpServletResponse, 
FilterChain)}. If not, a {@link ServletException} is
+ * thrown.
  *
- * 
- * The doFilter method of the Filter is called by the 
container each time a request/response pair is passed
- * through the chain due to a client request for a resource at the end of 
the chain. The FilterChain passed in to this
- * method allows the Filter to pass on the request and response to the 
next entity in the chain. There's no need to
- * override this method.
- * 
- *
- * 
- * The default implementation inspects the incoming {@code req} and {@code 
res} objects to determine if they are
- * instances of {@link HttpServletRequest} and {@link 
HttpServletResponse}, respectively. If not, a
- * {@link ServletException} is thrown. Otherwise, the protected
- * {@link #doFilter(javax.servlet.http.HttpServletRequest, 
javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain)}
- * method is called.
- * 
- *
- * @param req a {@link ServletRequest} object that contains the request 
the client has made of the filter
- *
- * @param res a {@link ServletResponse} object that contains the response 
the filter sends to the client
- *
- * @param chain the FilterChain for invoking the next filter 
or the resource
- *
- * @throws IOException if an input or output error is detected when the 
filter handles the request
- *
- * @throws ServletException if the request for the could not be handled or 
either parameter is not an instance of the
- * respective {@link HttpServletRequest} or {@link HttpServletResponse}.
- *
- * @since Servlet 4.0
+ * @throws ServletException If either the request or response are not of 
the expected types or any other error
+ *  occurs
  */
 @Override
-public void doFilter(ServletRequest req, ServletResponse res, FilterChain 
chain)
-throws IOException, ServletException {
-if (!(req instanceof HttpServletRequest && res instanceof 
HttpServletResponse)) {
-throw new ServletException("non-HTTP request or response");
+public void doFilter(ServletRequest request, ServletResponse response, 
FilterChain chain)
+throws IOException, ServletExce

[tomcat] branch 10.1.x updated: Revert "Align with spec"

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 7e7f1f98e7 Revert "Align with spec"
7e7f1f98e7 is described below

commit 7e7f1f98e7d5717feaa2dae169d34374cb3cea53
Author: lihan 
AuthorDate: Tue Mar 7 15:20:13 2023 +0800

Revert "Align with spec"

This reverts commit 5f0a1b92f685b86c00ce6ca18b779b42e562f517.
---
 java/jakarta/servlet/http/HttpFilter.java | 130 ++
 1 file changed, 44 insertions(+), 86 deletions(-)

diff --git a/java/jakarta/servlet/http/HttpFilter.java 
b/java/jakarta/servlet/http/HttpFilter.java
index 14d14b35b0..4c7154bea6 100644
--- a/java/jakarta/servlet/http/HttpFilter.java
+++ b/java/jakarta/servlet/http/HttpFilter.java
@@ -25,105 +25,63 @@ import jakarta.servlet.ServletRequest;
 import jakarta.servlet.ServletResponse;
 
 /**
- *
- * 
- * Provides an abstract class to be subclassed to create an HTTP filter 
suitable for a Web site. A subclass of
- * HttpFilter should override
- * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain) }.
- * 
- *
- * 
- * Filters typically run on multithreaded servers, so be aware that a filter 
must handle concurrent requests and be
- * careful to synchronize access to shared resources. Shared resources include 
in-memory data such as instance or class
- * variables and external objects such as files, database connections, and 
network connections. See the
- * https://docs.oracle.com/javase/tutorial/essential/concurrency/;> 
Java Tutorial on Multithreaded
- * Programming for more information on handling multiple threads in a Java 
program.
- *
- * @author Various
- *
- * @since Servlet 4.0
+ * Provides a base class that implements the Filter interface and ensures that 
the Request and Response are of type
+ * HttpServletRequest and HttpServletResponse respectively.
  */
 public abstract class HttpFilter extends GenericFilter {
 
-private static final long serialVersionUID = 7478463438252262094L;
-
-/**
- * 
- * Does nothing, because this is an abstract class.
- * 
- *
- * @since Servlet 4.0
- */
-public HttpFilter() {
-}
+private static final long serialVersionUID = 1L;
 
 /**
+ * {@inheritDoc} This implementation tests the request and response to see 
if they are instances of
+ * {@link HttpServletRequest} and {@link HttpServletResponse} 
respectively. If they are then they are passed to
+ * {@link #doFilter(HttpServletRequest, HttpServletResponse, 
FilterChain)}. If not, a {@link ServletException} is
+ * thrown.
  *
- * 
- * The doFilter method of the Filter is called by the 
container each time a request/response pair is passed
- * through the chain due to a client request for a resource at the end of 
the chain. The FilterChain passed in to this
- * method allows the Filter to pass on the request and response to the 
next entity in the chain. There's no need to
- * override this method.
- * 
- *
- * 
- * The default implementation inspects the incoming {@code req} and {@code 
res} objects to determine if they are
- * instances of {@link HttpServletRequest} and {@link 
HttpServletResponse}, respectively. If not, a
- * {@link ServletException} is thrown. Otherwise, the protected
- * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain)}
- * method is called.
- * 
- *
- * @param req a {@link ServletRequest} object that contains the request 
the client has made of the filter
- *
- * @param res a {@link ServletResponse} object that contains the response 
the filter sends to the client
- *
- * @param chain the FilterChain for invoking the next filter 
or the resource
- *
- * @throws IOException if an input or output error is detected when the 
filter handles the request
- *
- * @throws ServletException if the request for the could not be handled or 
either parameter is not an instance of the
- * respective {@link HttpServletRequest} or {@link HttpServletResponse}.
- *
- * @since Servlet 4.0
+ * @throws ServletException If either the request or response are not of 
the expected types or any other error
+ *  occurs
  */
 @Override
-public void doFilter(ServletRequest req, ServletResponse res, FilterChain 
chain)
-throws IOException, ServletException {
-if (!(req instanceof HttpServletRequest && res instanceof 
HttpServletResponse)) {
-throw new ServletException("non-HTTP request or response");
+public void doFilter(ServletRequest request, ServletResponse response, 
FilterCha

[tomcat] branch main updated: Revert "Align with spec"

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 e020b669a5 Revert "Align with spec"
e020b669a5 is described below

commit e020b669a5792a64c79eedb75751907aee2aa4d3
Author: lihan 
AuthorDate: Tue Mar 7 15:18:10 2023 +0800

Revert "Align with spec"

This reverts commit 1fc4b7c95dce1db3d86db9393c78023b93725f63.
---
 java/jakarta/servlet/http/HttpFilter.java | 130 ++
 1 file changed, 44 insertions(+), 86 deletions(-)

diff --git a/java/jakarta/servlet/http/HttpFilter.java 
b/java/jakarta/servlet/http/HttpFilter.java
index 14d14b35b0..4c7154bea6 100644
--- a/java/jakarta/servlet/http/HttpFilter.java
+++ b/java/jakarta/servlet/http/HttpFilter.java
@@ -25,105 +25,63 @@ import jakarta.servlet.ServletRequest;
 import jakarta.servlet.ServletResponse;
 
 /**
- *
- * 
- * Provides an abstract class to be subclassed to create an HTTP filter 
suitable for a Web site. A subclass of
- * HttpFilter should override
- * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain) }.
- * 
- *
- * 
- * Filters typically run on multithreaded servers, so be aware that a filter 
must handle concurrent requests and be
- * careful to synchronize access to shared resources. Shared resources include 
in-memory data such as instance or class
- * variables and external objects such as files, database connections, and 
network connections. See the
- * https://docs.oracle.com/javase/tutorial/essential/concurrency/;> 
Java Tutorial on Multithreaded
- * Programming for more information on handling multiple threads in a Java 
program.
- *
- * @author Various
- *
- * @since Servlet 4.0
+ * Provides a base class that implements the Filter interface and ensures that 
the Request and Response are of type
+ * HttpServletRequest and HttpServletResponse respectively.
  */
 public abstract class HttpFilter extends GenericFilter {
 
-private static final long serialVersionUID = 7478463438252262094L;
-
-/**
- * 
- * Does nothing, because this is an abstract class.
- * 
- *
- * @since Servlet 4.0
- */
-public HttpFilter() {
-}
+private static final long serialVersionUID = 1L;
 
 /**
+ * {@inheritDoc} This implementation tests the request and response to see 
if they are instances of
+ * {@link HttpServletRequest} and {@link HttpServletResponse} 
respectively. If they are then they are passed to
+ * {@link #doFilter(HttpServletRequest, HttpServletResponse, 
FilterChain)}. If not, a {@link ServletException} is
+ * thrown.
  *
- * 
- * The doFilter method of the Filter is called by the 
container each time a request/response pair is passed
- * through the chain due to a client request for a resource at the end of 
the chain. The FilterChain passed in to this
- * method allows the Filter to pass on the request and response to the 
next entity in the chain. There's no need to
- * override this method.
- * 
- *
- * 
- * The default implementation inspects the incoming {@code req} and {@code 
res} objects to determine if they are
- * instances of {@link HttpServletRequest} and {@link 
HttpServletResponse}, respectively. If not, a
- * {@link ServletException} is thrown. Otherwise, the protected
- * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain)}
- * method is called.
- * 
- *
- * @param req a {@link ServletRequest} object that contains the request 
the client has made of the filter
- *
- * @param res a {@link ServletResponse} object that contains the response 
the filter sends to the client
- *
- * @param chain the FilterChain for invoking the next filter 
or the resource
- *
- * @throws IOException if an input or output error is detected when the 
filter handles the request
- *
- * @throws ServletException if the request for the could not be handled or 
either parameter is not an instance of the
- * respective {@link HttpServletRequest} or {@link HttpServletResponse}.
- *
- * @since Servlet 4.0
+ * @throws ServletException If either the request or response are not of 
the expected types or any other error
+ *  occurs
  */
 @Override
-public void doFilter(ServletRequest req, ServletResponse res, FilterChain 
chain)
-throws IOException, ServletException {
-if (!(req instanceof HttpServletRequest && res instanceof 
HttpServletResponse)) {
-throw new ServletException("non-HTTP request or response");
+public void doFilter(ServletRequest request, ServletResponse response, 
FilterCha

[tomcat] branch 9.0.x updated: Fix wrong namespace.

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 32a7fe4ea4 Fix wrong namespace.
32a7fe4ea4 is described below

commit 32a7fe4ea481b9630ddda9df78f593bb33e57638
Author: lihan 
AuthorDate: Tue Mar 7 14:28:13 2023 +0800

Fix wrong namespace.
---
 java/javax/servlet/http/HttpFilter.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/javax/servlet/http/HttpFilter.java 
b/java/javax/servlet/http/HttpFilter.java
index f1db79c090..f9b37eb635 100644
--- a/java/javax/servlet/http/HttpFilter.java
+++ b/java/javax/servlet/http/HttpFilter.java
@@ -29,7 +29,7 @@ import javax.servlet.ServletResponse;
  * 
  * Provides an abstract class to be subclassed to create an HTTP filter 
suitable for a Web site. A subclass of
  * HttpFilter should override
- * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain) }.
+ * {@link #doFilter(javax.servlet.http.HttpServletRequest, 
javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) }.
  * 
  *
  * 
@@ -70,7 +70,7 @@ public abstract class HttpFilter extends GenericFilter {
  * The default implementation inspects the incoming {@code req} and {@code 
res} objects to determine if they are
  * instances of {@link HttpServletRequest} and {@link 
HttpServletResponse}, respectively. If not, a
  * {@link ServletException} is thrown. Otherwise, the protected
- * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain)}
+ * {@link #doFilter(javax.servlet.http.HttpServletRequest, 
javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain)}
  * method is called.
  * 
  *


-
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: Align with spec

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 e6cb59c0a7 Align with spec
e6cb59c0a7 is described below

commit e6cb59c0a730d4a5974f8a2e4c1a02946a1be793
Author: lihan 
AuthorDate: Tue Mar 7 14:16:53 2023 +0800

Align with spec
---
 java/javax/servlet/http/HttpFilter.java | 130 +---
 1 file changed, 86 insertions(+), 44 deletions(-)

diff --git a/java/javax/servlet/http/HttpFilter.java 
b/java/javax/servlet/http/HttpFilter.java
index 40394a6343..f1db79c090 100644
--- a/java/javax/servlet/http/HttpFilter.java
+++ b/java/javax/servlet/http/HttpFilter.java
@@ -25,63 +25,105 @@ import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
 /**
- * Provides a base class that implements the Filter interface and ensures that 
the Request and Response are of type
- * HttpServletRequest and HttpServletResponse respectively.
+ *
+ * 
+ * Provides an abstract class to be subclassed to create an HTTP filter 
suitable for a Web site. A subclass of
+ * HttpFilter should override
+ * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain) }.
+ * 
+ *
+ * 
+ * Filters typically run on multithreaded servers, so be aware that a filter 
must handle concurrent requests and be
+ * careful to synchronize access to shared resources. Shared resources include 
in-memory data such as instance or class
+ * variables and external objects such as files, database connections, and 
network connections. See the
+ * https://docs.oracle.com/javase/tutorial/essential/concurrency/;> 
Java Tutorial on Multithreaded
+ * Programming for more information on handling multiple threads in a Java 
program.
+ *
+ * @author Various
+ *
+ * @since Servlet 4.0
  */
 public abstract class HttpFilter extends GenericFilter {
 
-private static final long serialVersionUID = 1L;
+private static final long serialVersionUID = 7478463438252262094L;
+
+/**
+ * 
+ * Does nothing, because this is an abstract class.
+ * 
+ *
+ * @since Servlet 4.0
+ */
+public HttpFilter() {
+}
 
 /**
- * {@inheritDoc} This implementation tests the request and response to see 
if they are instances of
- * {@link HttpServletRequest} and {@link HttpServletResponse} 
respectively. If they are then they are passed to
- * {@link #doFilter(HttpServletRequest, HttpServletResponse, 
FilterChain)}. If not, a {@link ServletException} is
- * thrown.
  *
- * @throws ServletException If either the request or response are not of 
the expected types or any other error
- *  occurs
+ * 
+ * The doFilter method of the Filter is called by the 
container each time a request/response pair is passed
+ * through the chain due to a client request for a resource at the end of 
the chain. The FilterChain passed in to this
+ * method allows the Filter to pass on the request and response to the 
next entity in the chain. There's no need to
+ * override this method.
+ * 
+ *
+ * 
+ * The default implementation inspects the incoming {@code req} and {@code 
res} objects to determine if they are
+ * instances of {@link HttpServletRequest} and {@link 
HttpServletResponse}, respectively. If not, a
+ * {@link ServletException} is thrown. Otherwise, the protected
+ * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain)}
+ * method is called.
+ * 
+ *
+ * @param req a {@link ServletRequest} object that contains the request 
the client has made of the filter
+ *
+ * @param res a {@link ServletResponse} object that contains the response 
the filter sends to the client
+ *
+ * @param chain the FilterChain for invoking the next filter 
or the resource
+ *
+ * @throws IOException if an input or output error is detected when the 
filter handles the request
+ *
+ * @throws ServletException if the request for the could not be handled or 
either parameter is not an instance of the
+ * respective {@link HttpServletRequest} or {@link HttpServletResponse}.
+ *
+ * @since Servlet 4.0
  */
 @Override
-public void doFilter(ServletRequest request, ServletResponse response, 
FilterChain chain)
-throws IOException, ServletException {
-if (!(request instanceof HttpServletRequest)) {
-throw new ServletException(request + " not HttpServletRequest");
-}
-if (!(response instanceof HttpServletResponse)) {
-throw new ServletException(request + " not HttpServletResponse");
+public void doFilter(ServletRequest req, ServletResponse res, FilterChain 

[tomcat] branch 10.1.x updated: Align with spec

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 5f0a1b92f6 Align with spec
5f0a1b92f6 is described below

commit 5f0a1b92f685b86c00ce6ca18b779b42e562f517
Author: lihan 
AuthorDate: Tue Mar 7 14:16:53 2023 +0800

Align with spec
---
 java/jakarta/servlet/http/HttpFilter.java | 130 --
 1 file changed, 86 insertions(+), 44 deletions(-)

diff --git a/java/jakarta/servlet/http/HttpFilter.java 
b/java/jakarta/servlet/http/HttpFilter.java
index 4c7154bea6..14d14b35b0 100644
--- a/java/jakarta/servlet/http/HttpFilter.java
+++ b/java/jakarta/servlet/http/HttpFilter.java
@@ -25,63 +25,105 @@ import jakarta.servlet.ServletRequest;
 import jakarta.servlet.ServletResponse;
 
 /**
- * Provides a base class that implements the Filter interface and ensures that 
the Request and Response are of type
- * HttpServletRequest and HttpServletResponse respectively.
+ *
+ * 
+ * Provides an abstract class to be subclassed to create an HTTP filter 
suitable for a Web site. A subclass of
+ * HttpFilter should override
+ * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain) }.
+ * 
+ *
+ * 
+ * Filters typically run on multithreaded servers, so be aware that a filter 
must handle concurrent requests and be
+ * careful to synchronize access to shared resources. Shared resources include 
in-memory data such as instance or class
+ * variables and external objects such as files, database connections, and 
network connections. See the
+ * https://docs.oracle.com/javase/tutorial/essential/concurrency/;> 
Java Tutorial on Multithreaded
+ * Programming for more information on handling multiple threads in a Java 
program.
+ *
+ * @author Various
+ *
+ * @since Servlet 4.0
  */
 public abstract class HttpFilter extends GenericFilter {
 
-private static final long serialVersionUID = 1L;
+private static final long serialVersionUID = 7478463438252262094L;
+
+/**
+ * 
+ * Does nothing, because this is an abstract class.
+ * 
+ *
+ * @since Servlet 4.0
+ */
+public HttpFilter() {
+}
 
 /**
- * {@inheritDoc} This implementation tests the request and response to see 
if they are instances of
- * {@link HttpServletRequest} and {@link HttpServletResponse} 
respectively. If they are then they are passed to
- * {@link #doFilter(HttpServletRequest, HttpServletResponse, 
FilterChain)}. If not, a {@link ServletException} is
- * thrown.
  *
- * @throws ServletException If either the request or response are not of 
the expected types or any other error
- *  occurs
+ * 
+ * The doFilter method of the Filter is called by the 
container each time a request/response pair is passed
+ * through the chain due to a client request for a resource at the end of 
the chain. The FilterChain passed in to this
+ * method allows the Filter to pass on the request and response to the 
next entity in the chain. There's no need to
+ * override this method.
+ * 
+ *
+ * 
+ * The default implementation inspects the incoming {@code req} and {@code 
res} objects to determine if they are
+ * instances of {@link HttpServletRequest} and {@link 
HttpServletResponse}, respectively. If not, a
+ * {@link ServletException} is thrown. Otherwise, the protected
+ * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain)}
+ * method is called.
+ * 
+ *
+ * @param req a {@link ServletRequest} object that contains the request 
the client has made of the filter
+ *
+ * @param res a {@link ServletResponse} object that contains the response 
the filter sends to the client
+ *
+ * @param chain the FilterChain for invoking the next filter 
or the resource
+ *
+ * @throws IOException if an input or output error is detected when the 
filter handles the request
+ *
+ * @throws ServletException if the request for the could not be handled or 
either parameter is not an instance of the
+ * respective {@link HttpServletRequest} or {@link HttpServletResponse}.
+ *
+ * @since Servlet 4.0
  */
 @Override
-public void doFilter(ServletRequest request, ServletResponse response, 
FilterChain chain)
-throws IOException, ServletException {
-if (!(request instanceof HttpServletRequest)) {
-throw new ServletException(request + " not HttpServletRequest");
-}
-if (!(response instanceof HttpServletResponse)) {
-throw new ServletException(request + " not HttpServletResponse");
+public void doFilter(ServletRequest req, ServletResponse 

[tomcat] branch main updated: Align with spec

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 1fc4b7c95d Align with spec
1fc4b7c95d is described below

commit 1fc4b7c95dce1db3d86db9393c78023b93725f63
Author: lihan 
AuthorDate: Tue Mar 7 14:16:53 2023 +0800

Align with spec
---
 java/jakarta/servlet/http/HttpFilter.java | 130 --
 1 file changed, 86 insertions(+), 44 deletions(-)

diff --git a/java/jakarta/servlet/http/HttpFilter.java 
b/java/jakarta/servlet/http/HttpFilter.java
index 4c7154bea6..14d14b35b0 100644
--- a/java/jakarta/servlet/http/HttpFilter.java
+++ b/java/jakarta/servlet/http/HttpFilter.java
@@ -25,63 +25,105 @@ import jakarta.servlet.ServletRequest;
 import jakarta.servlet.ServletResponse;
 
 /**
- * Provides a base class that implements the Filter interface and ensures that 
the Request and Response are of type
- * HttpServletRequest and HttpServletResponse respectively.
+ *
+ * 
+ * Provides an abstract class to be subclassed to create an HTTP filter 
suitable for a Web site. A subclass of
+ * HttpFilter should override
+ * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain) }.
+ * 
+ *
+ * 
+ * Filters typically run on multithreaded servers, so be aware that a filter 
must handle concurrent requests and be
+ * careful to synchronize access to shared resources. Shared resources include 
in-memory data such as instance or class
+ * variables and external objects such as files, database connections, and 
network connections. See the
+ * https://docs.oracle.com/javase/tutorial/essential/concurrency/;> 
Java Tutorial on Multithreaded
+ * Programming for more information on handling multiple threads in a Java 
program.
+ *
+ * @author Various
+ *
+ * @since Servlet 4.0
  */
 public abstract class HttpFilter extends GenericFilter {
 
-private static final long serialVersionUID = 1L;
+private static final long serialVersionUID = 7478463438252262094L;
+
+/**
+ * 
+ * Does nothing, because this is an abstract class.
+ * 
+ *
+ * @since Servlet 4.0
+ */
+public HttpFilter() {
+}
 
 /**
- * {@inheritDoc} This implementation tests the request and response to see 
if they are instances of
- * {@link HttpServletRequest} and {@link HttpServletResponse} 
respectively. If they are then they are passed to
- * {@link #doFilter(HttpServletRequest, HttpServletResponse, 
FilterChain)}. If not, a {@link ServletException} is
- * thrown.
  *
- * @throws ServletException If either the request or response are not of 
the expected types or any other error
- *  occurs
+ * 
+ * The doFilter method of the Filter is called by the 
container each time a request/response pair is passed
+ * through the chain due to a client request for a resource at the end of 
the chain. The FilterChain passed in to this
+ * method allows the Filter to pass on the request and response to the 
next entity in the chain. There's no need to
+ * override this method.
+ * 
+ *
+ * 
+ * The default implementation inspects the incoming {@code req} and {@code 
res} objects to determine if they are
+ * instances of {@link HttpServletRequest} and {@link 
HttpServletResponse}, respectively. If not, a
+ * {@link ServletException} is thrown. Otherwise, the protected
+ * {@link #doFilter(jakarta.servlet.http.HttpServletRequest, 
jakarta.servlet.http.HttpServletResponse, jakarta.servlet.FilterChain)}
+ * method is called.
+ * 
+ *
+ * @param req a {@link ServletRequest} object that contains the request 
the client has made of the filter
+ *
+ * @param res a {@link ServletResponse} object that contains the response 
the filter sends to the client
+ *
+ * @param chain the FilterChain for invoking the next filter 
or the resource
+ *
+ * @throws IOException if an input or output error is detected when the 
filter handles the request
+ *
+ * @throws ServletException if the request for the could not be handled or 
either parameter is not an instance of the
+ * respective {@link HttpServletRequest} or {@link HttpServletResponse}.
+ *
+ * @since Servlet 4.0
  */
 @Override
-public void doFilter(ServletRequest request, ServletResponse response, 
FilterChain chain)
-throws IOException, ServletException {
-if (!(request instanceof HttpServletRequest)) {
-throw new ServletException(request + " not HttpServletRequest");
-}
-if (!(response instanceof HttpServletResponse)) {
-throw new ServletException(request + " not HttpServletResponse");
+public void doFilter(ServletRequest req, ServletResponse 

[tomcat] branch 8.5.x updated: Fix BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 04174d9307 Fix BZ 66507 - Catalina version command not honoring 
JAVA_OPTS variable
04174d9307 is described below

commit 04174d9307893cf4cdda8e0761a62e71758edd0f
Author: lihan 
AuthorDate: Tue Mar 7 11:38:51 2023 +0800

Fix BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

Patch suggested by Eric Hamilton
https://bz.apache.org/bugzilla/show_bug.cgi?id=66507
---
 bin/catalina.bat | 2 +-
 bin/catalina.sh  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/catalina.bat b/bin/catalina.bat
index 282aefcfd2..84a5f39b48 100755
--- a/bin/catalina.bat
+++ b/bin/catalina.bat
@@ -356,7 +356,7 @@ set CATALINA_OPTS=
 goto execCmd
 
 :doVersion
-%_EXECJAVA% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
+%_EXECJAVA% %JAVA_OPTS% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
 goto end
 
 
diff --git a/bin/catalina.sh b/bin/catalina.sh
index d738853938..3a2ffdafa0 100755
--- a/bin/catalina.sh
+++ b/bin/catalina.sh
@@ -656,9 +656,9 @@ elif [ "$1" = "configtest" ] ; then
 
 elif [ "$1" = "version" ] ; then
 
-"$_RUNJAVA"   \
-  -classpath "$CATALINA_HOME/lib/catalina.jar" \
-  org.apache.catalina.util.ServerInfo
+   eval "\"$_RUNJAVA\"" "$JAVA_OPTS" \
+ -classpath "\"$CATALINA_HOME/lib/catalina.jar\"" \
+ org.apache.catalina.util.ServerInfo
 
 else
 


-
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 BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 33b47cf5eb Fix BZ 66507 - Catalina version command not honoring 
JAVA_OPTS variable
33b47cf5eb is described below

commit 33b47cf5ebcbcfbc91e2923e82d3f5aeae423aa3
Author: lihan 
AuthorDate: Tue Mar 7 11:38:51 2023 +0800

Fix BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

Patch suggested by Eric Hamilton
https://bz.apache.org/bugzilla/show_bug.cgi?id=66507
---
 bin/catalina.bat | 2 +-
 bin/catalina.sh  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/catalina.bat b/bin/catalina.bat
index 282aefcfd2..84a5f39b48 100755
--- a/bin/catalina.bat
+++ b/bin/catalina.bat
@@ -356,7 +356,7 @@ set CATALINA_OPTS=
 goto execCmd
 
 :doVersion
-%_EXECJAVA% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
+%_EXECJAVA% %JAVA_OPTS% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
 goto end
 
 
diff --git a/bin/catalina.sh b/bin/catalina.sh
index d738853938..3a2ffdafa0 100755
--- a/bin/catalina.sh
+++ b/bin/catalina.sh
@@ -656,9 +656,9 @@ elif [ "$1" = "configtest" ] ; then
 
 elif [ "$1" = "version" ] ; then
 
-"$_RUNJAVA"   \
-  -classpath "$CATALINA_HOME/lib/catalina.jar" \
-  org.apache.catalina.util.ServerInfo
+   eval "\"$_RUNJAVA\"" "$JAVA_OPTS" \
+ -classpath "\"$CATALINA_HOME/lib/catalina.jar\"" \
+ org.apache.catalina.util.ServerInfo
 
 else
 


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



[tomcat] branch 10.1.x updated: Fix BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 c4acd4faa9 Fix BZ 66507 - Catalina version command not honoring 
JAVA_OPTS variable
c4acd4faa9 is described below

commit c4acd4faa9b297dfffecc82df0b1a4dc4479d067
Author: lihan 
AuthorDate: Tue Mar 7 11:38:51 2023 +0800

Fix BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

Patch suggested by Eric Hamilton
https://bz.apache.org/bugzilla/show_bug.cgi?id=66507
---
 bin/catalina.bat | 2 +-
 bin/catalina.sh  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/catalina.bat b/bin/catalina.bat
index 824773b460..a5cf1a92f6 100755
--- a/bin/catalina.bat
+++ b/bin/catalina.bat
@@ -324,7 +324,7 @@ set CATALINA_OPTS=
 goto execCmd
 
 :doVersion
-%_EXECJAVA% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
+%_EXECJAVA% %JAVA_OPTS% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
 goto end
 
 
diff --git a/bin/catalina.sh b/bin/catalina.sh
index a15accbdb5..32f87ffb6f 100755
--- a/bin/catalina.sh
+++ b/bin/catalina.sh
@@ -614,9 +614,9 @@ elif [ "$1" = "configtest" ] ; then
 
 elif [ "$1" = "version" ] ; then
 
-"$_RUNJAVA"   \
-  -classpath "$CATALINA_HOME/lib/catalina.jar" \
-  org.apache.catalina.util.ServerInfo
+   eval "\"$_RUNJAVA\"" "$JAVA_OPTS" \
+ -classpath "\"$CATALINA_HOME/lib/catalina.jar\"" \
+ org.apache.catalina.util.ServerInfo
 
 else
 


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



[tomcat] branch main updated: Fix BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

2023-03-06 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 2ee1135c46 Fix BZ 66507 - Catalina version command not honoring 
JAVA_OPTS variable
2ee1135c46 is described below

commit 2ee1135c46654ff366b50077ef0bce7090666dfa
Author: lihan 
AuthorDate: Tue Mar 7 11:38:51 2023 +0800

Fix BZ 66507 - Catalina version command not honoring JAVA_OPTS variable

Patch suggested by Eric Hamilton
https://bz.apache.org/bugzilla/show_bug.cgi?id=66507
---
 bin/catalina.bat | 2 +-
 bin/catalina.sh  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/catalina.bat b/bin/catalina.bat
index 068cd283bc..6350932852 100755
--- a/bin/catalina.bat
+++ b/bin/catalina.bat
@@ -304,7 +304,7 @@ set CATALINA_OPTS=
 goto execCmd
 
 :doVersion
-%_EXECJAVA% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
+%_EXECJAVA% %JAVA_OPTS% -classpath "%CATALINA_HOME%\lib\catalina.jar" 
org.apache.catalina.util.ServerInfo
 goto end
 
 
diff --git a/bin/catalina.sh b/bin/catalina.sh
index a7b14b6957..33649fac27 100755
--- a/bin/catalina.sh
+++ b/bin/catalina.sh
@@ -562,9 +562,9 @@ elif [ "$1" = "configtest" ] ; then
 
 elif [ "$1" = "version" ] ; then
 
-"$_RUNJAVA"   \
-  -classpath "$CATALINA_HOME/lib/catalina.jar" \
-  org.apache.catalina.util.ServerInfo
+   eval "\"$_RUNJAVA\"" "$JAVA_OPTS" \
+ -classpath "\"$CATALINA_HOME/lib/catalina.jar\"" \
+ org.apache.catalina.util.ServerInfo
 
 else
 


-
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 a bug that memory allocation is larger than limit in SynchronizedStack to reduce memory footprint.

2023-02-27 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 dadd323662 Fix a bug that memory allocation is larger than limit in 
SynchronizedStack to reduce memory footprint.
dadd323662 is described below

commit dadd323662a52e4ef7d7c0f37cac477fb106502e
Author: lihan 
AuthorDate: Mon Feb 27 16:29:31 2023 +0800

Fix a bug that memory allocation is larger than limit in SynchronizedStack 
to reduce memory footprint.
---
 java/org/apache/tomcat/util/collections/SynchronizedStack.java | 2 +-
 webapps/docs/changelog.xml | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/collections/SynchronizedStack.java 
b/java/org/apache/tomcat/util/collections/SynchronizedStack.java
index f178b02048..526c44cef5 100644
--- a/java/org/apache/tomcat/util/collections/SynchronizedStack.java
+++ b/java/org/apache/tomcat/util/collections/SynchronizedStack.java
@@ -52,7 +52,7 @@ public class SynchronizedStack {
 this.size = size;
 }
 this.limit = limit;
-stack = new Object[size];
+stack = new Object[this.size];
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index da9612398f..27095f5b27 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,14 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+Fix a bug that memory allocation is larger than limit in
+SynchronizedStack to reduce memory footprint. (lihan)
+  
+
+  
   
 
   


-
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 a bug that memory allocation is larger than limit in SynchronizedStack to reduce memory footprint.

2023-02-27 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 9b02ef12d9 Fix a bug that memory allocation is larger than limit in 
SynchronizedStack to reduce memory footprint.
9b02ef12d9 is described below

commit 9b02ef12d9507716228cf7df9e7b3e568d76d1b8
Author: lihan 
AuthorDate: Mon Feb 27 16:28:33 2023 +0800

Fix a bug that memory allocation is larger than limit in SynchronizedStack 
to reduce memory footprint.
---
 java/org/apache/tomcat/util/collections/SynchronizedStack.java | 2 +-
 webapps/docs/changelog.xml | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/collections/SynchronizedStack.java 
b/java/org/apache/tomcat/util/collections/SynchronizedStack.java
index f178b02048..526c44cef5 100644
--- a/java/org/apache/tomcat/util/collections/SynchronizedStack.java
+++ b/java/org/apache/tomcat/util/collections/SynchronizedStack.java
@@ -52,7 +52,7 @@ public class SynchronizedStack {
 this.size = size;
 }
 this.limit = limit;
-stack = new Object[size];
+stack = new Object[this.size];
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index ff565d2628..96c55f827a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,14 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+Fix a bug that memory allocation is larger than limit in
+SynchronizedStack to reduce memory footprint. (lihan)
+  
+
+  
   
 
   


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



  1   2   3   >