buildbot success in on tomcat-7.0.x

2021-05-27 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-7.0.x while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-7.0.x/builds/2

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-7.0-commit' 
triggered this build
Build Source Stamp: [branch 7.0.x] 9ddb734b7d981d68d268759a3de244f4d7d02e98
Blamelist: Mark Thomas 

Build succeeded!

Sincerely,
 -The Buildbot




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



[tomcat-native] branch main updated (8c22932 -> 353f2c0)

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 8c22932  Update changelog
 new ac54a20  Increment version number ready for next development cycle
 new 353f2c0  Add best guess for 1.2.29 release date

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 build.properties.default  | 2 +-
 native/include/tcn_version.h  | 2 +-
 native/os/win32/libtcnative.rc| 6 +++---
 xdocs/index.xml   | 4 ++--
 xdocs/miscellaneous/changelog.xml | 2 ++
 xdocs/news/2021.xml   | 7 +--
 6 files changed, 14 insertions(+), 9 deletions(-)

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



[tomcat-native] 02/02: Add best guess for 1.2.29 release date

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git

commit 353f2c05a0b1030f6caa2f6f9717408e5e3b580d
Author: Mark Thomas 
AuthorDate: Thu May 27 17:44:51 2021 +0100

Add best guess for 1.2.29 release date
---
 xdocs/index.xml | 4 ++--
 xdocs/news/2021.xml | 7 +--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/xdocs/index.xml b/xdocs/index.xml
index 239a392..1c0640d 100644
--- a/xdocs/index.xml
+++ b/xdocs/index.xml
@@ -60,10 +60,10 @@
 
 
 
-6 Apr 2021 - TC-Native-1.2.28
+1 Jun 2021 - TC-Native-1.2.29
 released
 The Apache Tomcat team is proud to announce the immediate availability of
-Tomcat Native 1.2.28 Stable.
+Tomcat Native 1.2.29 Stable.
 
 The sources and the binaries for selected platforms are available from the
 Download page.
diff --git a/xdocs/news/2021.xml b/xdocs/news/2021.xml
index 3fc92f8..2582f5d 100644
--- a/xdocs/news/2021.xml
+++ b/xdocs/news/2021.xml
@@ -29,13 +29,16 @@
 
 
 
+ 
+  The Apache Tomcat team is proud to announce the immediate availability of
+  Tomcat Native 1.2.29. This is a bugfix release.
+  
+ 
  
   The Apache Tomcat team is proud to announce the immediate availability of
   Tomcat Native 1.2.28. This is a bugfix release.
   
  
-
-
  
   The Apache Tomcat team is proud to announce the immediate availability of
   Tomcat Native 1.2.27. This is a bugfix release.

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



[tomcat-native] 01/02: Increment version number ready for next development cycle

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git

commit ac54a20919300b27e75a1a1a0bf49b8a14e7374a
Author: Mark Thomas 
AuthorDate: Thu May 27 17:44:35 2021 +0100

Increment version number ready for next development cycle
---
 build.properties.default  | 2 +-
 native/include/tcn_version.h  | 2 +-
 native/os/win32/libtcnative.rc| 6 +++---
 xdocs/miscellaneous/changelog.xml | 2 ++
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/build.properties.default b/build.properties.default
index 6a447f6..f9dcfb9 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -18,7 +18,7 @@
 # - Version Control Flags -
 version.major=1
 version.minor=2
-version.build=29
+version.build=30
 version.patch=0
 version.suffix=-dev
 
diff --git a/native/include/tcn_version.h b/native/include/tcn_version.h
index 7b45855..a44bae4 100644
--- a/native/include/tcn_version.h
+++ b/native/include/tcn_version.h
@@ -63,7 +63,7 @@ extern "C" {
 #define TCN_MINOR_VERSION   2
 
 /** patch level */
-#define TCN_PATCH_VERSION   29
+#define TCN_PATCH_VERSION   30
 
 /**
  *  This symbol is defined for internal, "development" copies of TCN. This
diff --git a/native/os/win32/libtcnative.rc b/native/os/win32/libtcnative.rc
index 17c9ddf..4727a3f 100644
--- a/native/os/win32/libtcnative.rc
+++ b/native/os/win32/libtcnative.rc
@@ -20,7 +20,7 @@ LANGUAGE 0x9,0x1
  "See the License for the specific language governing " \
  "permissions and limitations under the License."
 
-#define TCN_VERSION "1.2.29"
+#define TCN_VERSION "1.2.30"
 1000 ICON "apache.ico"
 
 1001 DIALOGEX 0, 0, 252, 51
@@ -36,8 +36,8 @@ BEGIN
 END
 
 1 VERSIONINFO
- FILEVERSION 1,2,29,0
- PRODUCTVERSION 1,2,29,0
+ FILEVERSION 1,2,30,0
+ PRODUCTVERSION 1,2,30,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index 6defb6a..483bdf0 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -34,6 +34,8 @@
   This is the Changelog for Tomcat Native 1.2.
   
 
+
+
 
   
 

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



[tomcat-native] 01/01: Tag 1.2.29

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to tag 1.2.29
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git

commit c7166f321fe275676dcc2990fe9232c1fcc67f5f
Author: Mark Thomas 
AuthorDate: Thu May 27 17:39:03 2021 +0100

Tag 1.2.29
---
 build.properties.default | 2 +-
 native/include/tcn_version.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/build.properties.default b/build.properties.default
index 6a447f6..35bf22f 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -20,7 +20,7 @@ version.major=1
 version.minor=2
 version.build=29
 version.patch=0
-version.suffix=-dev
+version.suffix=
 
 # - Default Base Path for Dependent Packages -
 # Please note this path must be absolute, not relative,
diff --git a/native/include/tcn_version.h b/native/include/tcn_version.h
index 7b45855..ec4295e 100644
--- a/native/include/tcn_version.h
+++ b/native/include/tcn_version.h
@@ -69,7 +69,7 @@ extern "C" {
  *  This symbol is defined for internal, "development" copies of TCN. This
  *  symbol will be #undef'd for releases.
  */
-#define TCN_IS_DEV_VERSION  1
+#define TCN_IS_DEV_VERSION  0
 
 
 /** The formatted string of APU's version */

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



[tomcat-native] tag 1.2.29 created (now c7166f3)

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to tag 1.2.29
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git.


  at c7166f3  (commit)
This tag includes the following new commits:

 new c7166f3  Tag 1.2.29

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


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



[GitHub] [tomcat-native] michael-o edited a comment on pull request #9: Simplify Address#getInfo() native implementation

2021-05-27 Thread GitBox


michael-o edited a comment on pull request #9:
URL: https://github.com/apache/tomcat-native/pull/9#issuecomment-849773816


   > 
   > 
   > This changes behaviour so it would need to wait until 1.3 (if there ever 
is such a version).
   > Note that the current plan is that the code being discussed here would be 
removed in 2.0.
   
   For a transition phase, I would favor to remove everything in 1.3 which 
isn't used by Tomcat at all. In 2.0 remove APR. 1.3 can contain cleanups like 
this.
   
   OR do 2.0 and then 3.0 which support OpenSSL 1.1.1 and 3.0.0.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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



[tomcat-native] branch main updated: Update changelog

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git


The following commit(s) were added to refs/heads/main by this push:
 new 8c22932  Update changelog
8c22932 is described below

commit 8c22932312ed4114879e74e8f1c211feb16195b8
Author: Mark Thomas 
AuthorDate: Thu May 27 16:50:38 2021 +0100

Update changelog
---
 xdocs/miscellaneous/changelog.xml | 8 
 1 file changed, 8 insertions(+)

diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index 9f35b6e..6defb6a 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -35,6 +35,14 @@
   
 
 
+  
+
+  Add a patch for APR that fixes an issue where some Windows systems in 
some
+  configurations would only listen on IPv6 addresses on dual stack systems
+  even though configured to listen on both IPv6 and IPv4 addresses.
+  (michaelo)
+
+  
 
 
   

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



[Bug 65302] Add support for setting com.sun.jndi.ldap.tls.cbtype

2021-05-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65302

--- Comment #7 from Michael Osipov  ---
(In reply to Mike Millson from comment #6)
> (In reply to Michael Osipov from comment #1)
> > The only SASL mech supporting this is GSSAPI and you can
> > request GSS-API to completely encrypt your traffic with Kerberos
> > (auth-conf), no TLS necessary.
> 
> Do you have an example of a configuration that does this that I could
> propose as an alternative?

Yes, see my DirContextSource [1] which I have been using the last eight years.
Works pefectly in Tomcat also.
In production:
ldap://ad.example.com:3268";
auth="gssapi" loginEntryName="tomcat-initiate" referral="ignore"
qop="auth-conf"
additionalProperties="com.sun.jndi.ldap.connect.timeout=1000;com.sun.jndi.ldap.read.timeout=1000"
/>

In the world's largest forest.


[1] http://dirctxsrc.sourceforge.net/dircontextsourcefactory.html

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat-native] michael-o commented on pull request #9: Simplify Address#getInfo() native implementation

2021-05-27 Thread GitBox


michael-o commented on pull request #9:
URL: https://github.com/apache/tomcat-native/pull/9#issuecomment-849773816


   > 
   > 
   > This changes behaviour so it would need to wait until 1.3 (if there ever 
is such a version).
   > Note that the current plan is that the code being discussed here would be 
removed in 2.0.
   
   For a transition phase, I would favor to remove everything in 1.3 which 
isn't used by Tomcat at all. In 2.0 remove APR. 1.3 can contain cleanups like 
this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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



[GitHub] [tomcat-native] markt-asf commented on pull request #9: Simplify Address#getInfo() native implementation

2021-05-27 Thread GitBox


markt-asf commented on pull request #9:
URL: https://github.com/apache/tomcat-native/pull/9#issuecomment-849750902


   This changes behaviour so it would need to wait until 1.3 (if there ever is 
such a version).
   Note that the current plan is that the code being discussed here would be 
removed in 2.0.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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



[Bug 65302] Add support for setting com.sun.jndi.ldap.tls.cbtype

2021-05-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65302

--- Comment #6 from Mike Millson  ---
(In reply to Michael Osipov from comment #1)
> The only SASL mech supporting this is GSSAPI and you can
> request GSS-API to completely encrypt your traffic with Kerberos
> (auth-conf), no TLS necessary.

Do you have an example of a configuration that does this that I could propose
as an alternative?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat-native] 02/03: Tweak patch so it can be applied with git apply

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git

commit e3259817ba2b18fc69376f6734ba01a05175a7d7
Author: Mark Thomas 
AuthorDate: Thu May 27 16:35:35 2021 +0100

Tweak patch so it can be applied with git apply
---
 native/srclib/apr/apr-enable-ipv6.patch | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/native/srclib/apr/apr-enable-ipv6.patch 
b/native/srclib/apr/apr-enable-ipv6.patch
index 26257ed..a58721c 100644
--- a/native/srclib/apr/apr-enable-ipv6.patch
+++ b/native/srclib/apr/apr-enable-ipv6.patch
@@ -1,5 +1,5 @@
 include/apr.hw
-+++ include/apr.hw
+--- /include/apr.hw
 /include/apr.hw
 @@ -367,7 +367,7 @@
  /* If we have a TCP implementation that can be "corked", what flag
   * do we use?

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



[tomcat-native] 03/03: Remove diff for CHANGES file from patch

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git

commit 33a5ef3ef0028ae05618fd0689a4c44c63733107
Author: Mark Thomas 
AuthorDate: Thu May 27 16:36:46 2021 +0100

Remove diff for CHANGES file from patch
---
 native/srclib/apr/win-ipv6.patch | 16 
 1 file changed, 16 deletions(-)

diff --git a/native/srclib/apr/win-ipv6.patch b/native/srclib/apr/win-ipv6.patch
index 5469a6e..1039872 100644
--- a/native/srclib/apr/win-ipv6.patch
+++ b/native/srclib/apr/win-ipv6.patch
@@ -1,19 +1,3 @@
-Index: apr/apr/branches/1.7.x/CHANGES
-===
 apr/apr/branches/1.7.x/CHANGES (revision 1890229)
-+++ apr/apr/branches/1.7.x/CHANGES (revision 1890230)
-@@ -47,6 +47,11 @@
-  events are emitted on pool clear/destroy for proper accounting.
-  [Brane Čibej]
- 
-+  *) apr_socket_listen: Allow larger listen backlog values on Windows 8+.
-+ [Evgeny Kotkov ]
-+
-+  *) Fixed: apr_get_oslevel() was returning APR_WIN_XP on Windows 10
-+
- Changes for APR 1.7.0
- 
-   *) apr_dir_read: [Unix] Dropped the preference of the dirread_r() flavor
 Index: apr/apr/branches/1.7.x/include/arch/win32/apr_arch_misc.h
 ===
 --- apr/apr/branches/1.7.x/include/arch/win32/apr_arch_misc.h  (revision 
1890229)

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



[tomcat-native] 01/03: Add patch for APR 1.7.0 to address binding issue in Windows

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git

commit 8ca30e9707f0a4db5d9ad56e9db49cf892a4fd78
Author: Mark Thomas 
AuthorDate: Thu May 27 14:02:24 2021 +0100

Add patch for APR 1.7.0 to address binding issue in Windows
---
 native/srclib/apr/win-ipv6.patch | 141 +++
 1 file changed, 141 insertions(+)

diff --git a/native/srclib/apr/win-ipv6.patch b/native/srclib/apr/win-ipv6.patch
new file mode 100644
index 000..5469a6e
--- /dev/null
+++ b/native/srclib/apr/win-ipv6.patch
@@ -0,0 +1,141 @@
+Index: apr/apr/branches/1.7.x/CHANGES
+===
+--- apr/apr/branches/1.7.x/CHANGES (revision 1890229)
 apr/apr/branches/1.7.x/CHANGES (revision 1890230)
+@@ -47,6 +47,11 @@
+  events are emitted on pool clear/destroy for proper accounting.
+  [Brane Čibej]
+ 
++  *) apr_socket_listen: Allow larger listen backlog values on Windows 8+.
++ [Evgeny Kotkov ]
++
++  *) Fixed: apr_get_oslevel() was returning APR_WIN_XP on Windows 10
++
+ Changes for APR 1.7.0
+ 
+   *) apr_dir_read: [Unix] Dropped the preference of the dirread_r() flavor
+Index: apr/apr/branches/1.7.x/include/arch/win32/apr_arch_misc.h
+===
+--- apr/apr/branches/1.7.x/include/arch/win32/apr_arch_misc.h  (revision 
1890229)
 apr/apr/branches/1.7.x/include/arch/win32/apr_arch_misc.h  (revision 
1890230)
+@@ -110,7 +110,11 @@
+ APR_WIN_XP_SP2 =   62,
+ APR_WIN_2003 = 70,
+ APR_WIN_VISTA =80,
+-APR_WIN_7 =90
++APR_WIN_7 =90,
++APR_WIN_7_SP1 =91,
++APR_WIN_8  =   100,
++APR_WIN_8_1 =  110,
++APR_WIN_10 =   120
+ } apr_oslevel_e;
+ 
+ extern APR_DECLARE_DATA apr_oslevel_e apr_os_level;
+Index: apr/apr/branches/1.7.x/misc/win32/misc.c
+===
+--- apr/apr/branches/1.7.x/misc/win32/misc.c   (revision 1890229)
 apr/apr/branches/1.7.x/misc/win32/misc.c   (revision 1890230)
+@@ -27,25 +27,15 @@
+ {
+ if (apr_os_level == APR_WIN_UNK) 
+ {
+-static OSVERSIONINFO oslev;
+-oslev.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+-GetVersionEx(&oslev);
++OSVERSIONINFOEXW oslev;
++oslev.dwOSVersionInfoSize = sizeof(oslev);
++if (!GetVersionExW((OSVERSIONINFOW*) &oslev)) {
++return apr_get_os_error();
++}
+ 
+ if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) 
+ {
+-static unsigned int servpack = 0;
+-TCHAR *pservpack;
+-if ((pservpack = oslev.szCSDVersion)) {
+-while (*pservpack && !apr_isdigit(*pservpack)) {
+-pservpack++;
+-}
+-if (*pservpack)
+-#ifdef _UNICODE
+-servpack = _wtoi(pservpack);
+-#else
+-servpack = atoi(pservpack);
+-#endif
+-}
++unsigned int servpack = oslev.wServicePackMajor;
+ 
+ if (oslev.dwMajorVersion < 3) {
+ apr_os_level = APR_WIN_UNSUP;
+@@ -99,11 +89,19 @@
+ else if (oslev.dwMajorVersion == 6) {
+ if (oslev.dwMinorVersion == 0)
+ apr_os_level = APR_WIN_VISTA;
++else if (oslev.dwMinorVersion == 1) {
++if (servpack < 1)
++apr_os_level = APR_WIN_7;
++else
++apr_os_level = APR_WIN_7_SP1;
++}
++else if (oslev.dwMinorVersion == 2)
++apr_os_level = APR_WIN_8;
+ else
+-apr_os_level = APR_WIN_7;
++apr_os_level = APR_WIN_8_1;
+ }
+ else {
+-apr_os_level = APR_WIN_XP;
++apr_os_level = APR_WIN_10;
+ }
+ }
+ #ifndef WINNT
+@@ -151,7 +149,7 @@
+ 
+ *level = apr_os_level;
+ 
+-if (apr_os_level < APR_WIN_UNSUP) {
++if (apr_os_level <= APR_WIN_UNSUP) {
+ return APR_EGENERAL;
+ }
+ 
+Index: apr/apr/branches/1.7.x/network_io/win32/sockets.c
+===
+--- apr/apr/branches/1.7.x/network_io/win32/sockets.c  (revision 1890229)
 apr/apr/branches/1.7.x/network_io/win32/sockets.c  (revision 1890230)
+@@ -24,6 +24,13 @@
+ #include "apr_arch_inherit.h"
+ #include "apr_arch_misc.h"
+ 
++/* Borrow the definition of SOMAXCONN_HINT() from Windows SDK 8,
++ * in case the SDK we are building against doesn't have it.
++ */
++#ifndef SOMAXCONN_HINT
++#define SOMAXCONN_HINT(b) (-(b))
++#endif
++
+ static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */
+ 
+ static apr_status_t socket_cleanup(void *sock)
+@@ -223,7 +230

[tomcat-native] branch main updated (73c347b -> 33a5ef3)

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 73c347b  Revert "Simplify Address#getInfo() native implementation"
 new 8ca30e9  Add patch for APR 1.7.0 to address binding issue in Windows
 new e325981  Tweak patch so it can be applied with git apply
 new 33a5ef3  Remove diff for CHANGES file from patch

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 native/srclib/apr/apr-enable-ipv6.patch |   4 +-
 native/srclib/apr/win-ipv6.patch| 125 
 2 files changed, 127 insertions(+), 2 deletions(-)
 create mode 100644 native/srclib/apr/win-ipv6.patch

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



Re: APR connector on Windows 8+ fails to listen on all addresses

2021-05-27 Thread Michael Osipov

Am 2021-05-27 um 15:41 schrieb Mark Thomas:

On 27/05/2021 13:24, Mark Thomas wrote:

On 27/05/2021 11:12, Michael Osipov wrote:

Am 2021-05-27 um 11:52 schrieb Mark Thomas:

Michael,

I think we need to step back a bit.

I am unable to recreate the issue you describe. I am using:

- Windows Server 2019
- IPv6 enabled (and IPv4 and both have addresses)
- Apache Tomcat 9.0.46
- Apache Tomcat Native 1.2.28
- AprLifecycleListener is enabled
- No address configured for Connector
- Logs confirm http-apr-8080

I can access the default home page via both IPv4 and IPv6 from both 
the local machine and remotely.




Please try my simple program from this gist: 
https://gist.github.com/michael-o/dfb86df472f62d2b2dff6ef12ee3758e





Does this help?


Thanks. That helped me narrow down where the differences where. If you 
run Tomcat as a service it binds both 0.0.0.0:8080 and [::]:8080. If 
you run it from the command line, it only binds [::]:8080.


I'll take a look at the proposed APR patch next.


I can confirm that the patch to APR fixes the issue for me too.

With the original 1.2.28 DLL, starting Tomcat on the command line only 
binds to IPv6.


With a patched 1.2.29-dev DLL, starting Tomcat on the command line binds 
to IPv6 and IPv4.


Pefect!


I'll tag and start the release process for Tomcat Native shortly.


Before you do, I'd like to settle 
https://github.com/apache/tomcat-native/pull/9


This aligns with the NIO connectors for obtaining addresses by relying 
on the OS. Please have a look and share your opinion.


M

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



[tomcat] branch 7.0.x updated: Clean up

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new 9ddb734  Clean up
9ddb734 is described below

commit 9ddb734b7d981d68d268759a3de244f4d7d02e98
Author: Mark Thomas 
AuthorDate: Thu May 27 16:22:41 2021 +0100

Clean up
---
 .../javax/annotation/sql/DataSourceDefinition.java | 72 ++
 1 file changed, 72 insertions(+)

diff --git a/java/javax/annotation/sql/DataSourceDefinition.java 
b/java/javax/annotation/sql/DataSourceDefinition.java
index feb0758..a779b21 100644
--- a/java/javax/annotation/sql/DataSourceDefinition.java
+++ b/java/javax/annotation/sql/DataSourceDefinition.java
@@ -27,22 +27,94 @@ import java.lang.annotation.Target;
 @Target(ElementType.TYPE)
 @Retention(RetentionPolicy.RUNTIME)
 public @interface DataSourceDefinition {
+
+/**
+ * @return the className
+ */
 String className();
+
+/**
+ * @return the name
+ */
 String name();
+
+/**
+ * @return the description
+ */
 String description() default "";
+
+/**
+ * @return the url
+ */
 String url() default "";
+
+/**
+ * @return the user
+ */
 String user() default "";
+
+/**
+ * @return the password
+ */
 String password() default "";
+
+/**
+ * @return database name
+ */
 String databaseName() default "";
+
+/**
+ * @return the port number
+ */
 int portNumber() default -1;
+
+/**
+ * @return the server name
+ */
 String serverName() default "localhost";
+
+/**
+ * @return the isolation level
+ */
 int isolationLevel() default -1;
+
+/**
+ * @return true if the data source is transactional
+ */
 boolean transactional() default true;
+
+/**
+ * @return the initial pool size
+ */
 int initialPoolSize() default -1;
+
+/**
+ * @return the max pool size
+ */
 int maxPoolSize() default -1;
+
+/**
+ * @return the min pool size
+ */
 int minPoolSize() default -1;
+
+/**
+ * @return the max idle time
+ */
 int maxIdleTime() default -1;
+
+/**
+ * @return the max statements
+ */
 int maxStatements() default -1;
+
+/**
+ * @return a String[] with the properties
+ */
 String[] properties() default {};
+
+/**
+ * @return the login timeout
+ */
 int loginTimeout() default 0;
 }

-
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: Clean up

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 3c0dd7b  Clean up
3c0dd7b is described below

commit 3c0dd7b9c8b0edf1c66590f08b1d3f644fc70bb9
Author: Mark Thomas 
AuthorDate: Thu May 27 16:22:23 2021 +0100

Clean up
---
 java/javax/annotation/sql/DataSourceDefinition.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/java/javax/annotation/sql/DataSourceDefinition.java 
b/java/javax/annotation/sql/DataSourceDefinition.java
index 3d4cd7e..a779b21 100644
--- a/java/javax/annotation/sql/DataSourceDefinition.java
+++ b/java/javax/annotation/sql/DataSourceDefinition.java
@@ -117,5 +117,4 @@ public @interface DataSourceDefinition {
  * @return the login timeout
  */
 int loginTimeout() default 0;
-
 }

-
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: Clean up

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new d959253  Clean up
d959253 is described below

commit d959253fe1d43cfe173877e5278bf59cb58c8ec1
Author: Mark Thomas 
AuthorDate: Thu May 27 16:22:05 2021 +0100

Clean up
---
 java/javax/annotation/sql/DataSourceDefinition.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/java/javax/annotation/sql/DataSourceDefinition.java 
b/java/javax/annotation/sql/DataSourceDefinition.java
index 3d4cd7e..a779b21 100644
--- a/java/javax/annotation/sql/DataSourceDefinition.java
+++ b/java/javax/annotation/sql/DataSourceDefinition.java
@@ -117,5 +117,4 @@ public @interface DataSourceDefinition {
  * @return the login timeout
  */
 int loginTimeout() default 0;
-
 }

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



[tomcat] branch 10.0.x updated: Clean up

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 84e7d58  Clean up
84e7d58 is described below

commit 84e7d587dcc6d162ff7dafa796b30cb2b06687a4
Author: Mark Thomas 
AuthorDate: Thu May 27 16:21:44 2021 +0100

Clean up
---
 java/jakarta/annotation/sql/DataSourceDefinition.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/java/jakarta/annotation/sql/DataSourceDefinition.java 
b/java/jakarta/annotation/sql/DataSourceDefinition.java
index d93b920..cfbf7f6 100644
--- a/java/jakarta/annotation/sql/DataSourceDefinition.java
+++ b/java/jakarta/annotation/sql/DataSourceDefinition.java
@@ -117,5 +117,4 @@ public @interface DataSourceDefinition {
  * @return the login timeout
  */
 int loginTimeout() default 0;
-
 }

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



[tomcat] branch main updated: Clean up

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 6776cb6  Clean up
6776cb6 is described below

commit 6776cb6f3213af953ec350f37084c6370acf3732
Author: Mark Thomas 
AuthorDate: Thu May 27 16:21:22 2021 +0100

Clean up
---
 java/jakarta/annotation/sql/DataSourceDefinition.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/java/jakarta/annotation/sql/DataSourceDefinition.java 
b/java/jakarta/annotation/sql/DataSourceDefinition.java
index d93b920..cfbf7f6 100644
--- a/java/jakarta/annotation/sql/DataSourceDefinition.java
+++ b/java/jakarta/annotation/sql/DataSourceDefinition.java
@@ -117,5 +117,4 @@ public @interface DataSourceDefinition {
  * @return the login timeout
  */
 int loginTimeout() default 0;
-
 }

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



buildbot failure in on tomcat-7.0.x

2021-05-27 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-7.0.x while building 
tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-7.0.x/builds/1

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-7.0-commit' 
triggered this build
Build Source Stamp: [branch 7.0.x] d651c3eab8a05fc1fd4a661fed8e63971ffcc1a7
Blamelist: Mark Thomas 

BUILD FAILED: failed

Sincerely,
 -The Buildbot




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



[tomcat] branch 7.0.x updated: Add Javadoc. Align with 8.5.x. Trivial commit to trigger CI.

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new d651c3e  Add Javadoc. Align with 8.5.x. Trivial commit to trigger CI.
d651c3e is described below

commit d651c3eab8a05fc1fd4a661fed8e63971ffcc1a7
Author: Mark Thomas 
AuthorDate: Thu May 27 14:56:43 2021 +0100

Add Javadoc. Align with 8.5.x. Trivial commit to trigger CI.
---
 java/javax/annotation/security/DeclareRoles.java | 4 
 java/javax/annotation/security/RolesAllowed.java | 4 
 java/javax/annotation/security/RunAs.java| 4 
 3 files changed, 12 insertions(+)

diff --git a/java/javax/annotation/security/DeclareRoles.java 
b/java/javax/annotation/security/DeclareRoles.java
index d50e30d..7bf21e5 100644
--- a/java/javax/annotation/security/DeclareRoles.java
+++ b/java/javax/annotation/security/DeclareRoles.java
@@ -29,5 +29,9 @@ import java.lang.annotation.Target;
 @Target(ElementType.TYPE)
 @Retention(RetentionPolicy.RUNTIME)
 public @interface DeclareRoles {
+
+/**
+ * @return a String[] with the roles
+ */
 public String[] value();
 }
diff --git a/java/javax/annotation/security/RolesAllowed.java 
b/java/javax/annotation/security/RolesAllowed.java
index f916b6d..202b184 100644
--- a/java/javax/annotation/security/RolesAllowed.java
+++ b/java/javax/annotation/security/RolesAllowed.java
@@ -29,5 +29,9 @@ import java.lang.annotation.Target;
 @Target({ElementType.TYPE, ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
 public @interface RolesAllowed {
+
+/**
+ * @return a String[] of the allowed roles
+ */
 public String[] value();
 }
diff --git a/java/javax/annotation/security/RunAs.java 
b/java/javax/annotation/security/RunAs.java
index 8a366e2..1484fee 100644
--- a/java/javax/annotation/security/RunAs.java
+++ b/java/javax/annotation/security/RunAs.java
@@ -29,5 +29,9 @@ import java.lang.annotation.Target;
 @Target(ElementType.TYPE)
 @Retention(RetentionPolicy.RUNTIME)
 public @interface RunAs {
+
+/**
+ * @return a String with the value for RunAs
+ */
 public String value();
 }

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



Re: APR connector on Windows 8+ fails to listen on all addresses

2021-05-27 Thread Mark Thomas

On 27/05/2021 13:24, Mark Thomas wrote:

On 27/05/2021 11:12, Michael Osipov wrote:

Am 2021-05-27 um 11:52 schrieb Mark Thomas:

Michael,

I think we need to step back a bit.

I am unable to recreate the issue you describe. I am using:

- Windows Server 2019
- IPv6 enabled (and IPv4 and both have addresses)
- Apache Tomcat 9.0.46
- Apache Tomcat Native 1.2.28
- AprLifecycleListener is enabled
- No address configured for Connector
- Logs confirm http-apr-8080

I can access the default home page via both IPv4 and IPv6 from both 
the local machine and remotely.




Please try my simple program from this gist: 
https://gist.github.com/michael-o/dfb86df472f62d2b2dff6ef12ee3758e





Does this help?


Thanks. That helped me narrow down where the differences where. If you 
run Tomcat as a service it binds both 0.0.0.0:8080 and [::]:8080. If you 
run it from the command line, it only binds [::]:8080.


I'll take a look at the proposed APR patch next.


I can confirm that the patch to APR fixes the issue for me too.

With the original 1.2.28 DLL, starting Tomcat on the command line only 
binds to IPv6.


With a patched 1.2.29-dev DLL, starting Tomcat on the command line binds 
to IPv6 and IPv4.


I'll tag and start the release process for Tomcat Native shortly.

Mark

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



Re: APR connector on Windows 8+ fails to listen on all addresses

2021-05-27 Thread Mark Thomas

On 27/05/2021 11:12, Michael Osipov wrote:

Am 2021-05-27 um 11:52 schrieb Mark Thomas:

Michael,

I think we need to step back a bit.

I am unable to recreate the issue you describe. I am using:

- Windows Server 2019
- IPv6 enabled (and IPv4 and both have addresses)
- Apache Tomcat 9.0.46
- Apache Tomcat Native 1.2.28
- AprLifecycleListener is enabled
- No address configured for Connector
- Logs confirm http-apr-8080

I can access the default home page via both IPv4 and IPv6 from both 
the local machine and remotely.




Please try my simple program from this gist: 
https://gist.github.com/michael-o/dfb86df472f62d2b2dff6ef12ee3758e





Does this help?


Thanks. That helped me narrow down where the differences where. If you 
run Tomcat as a service it binds both 0.0.0.0:8080 and [::]:8080. If you 
run it from the command line, it only binds [::]:8080.


I'll take a look at the proposed APR patch next.

Mark

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



Re: APR connector on Windows 8+ fails to listen on all addresses

2021-05-27 Thread Michael Osipov

Prefences in the OS:

PS C:\Users\osipovmi> netsh interface ipv6 show prefixpolicies
Der aktive Status wird abgefragt...

Vorgänger   Label  Präfix
--  -  
50  0  :::0:0/96
40  1  ::1/128
30  2  ::/0
20  3  2002::/16
 5  5  2001::/32
 3 13  fc00::/7
 1 11  fec0::/10
 1 12  3ffe::/16
 1  4  ::/96


Taken from https://superuser.com/a/436944/222550



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



Re: APR connector on Windows 8+ fails to listen on all addresses

2021-05-27 Thread Michael Osipov

Am 2021-05-27 um 11:52 schrieb Mark Thomas:

Michael,

I think we need to step back a bit.

I am unable to recreate the issue you describe. I am using:

- Windows Server 2019
- IPv6 enabled (and IPv4 and both have addresses)
- Apache Tomcat 9.0.46
- Apache Tomcat Native 1.2.28
- AprLifecycleListener is enabled
- No address configured for Connector
- Logs confirm http-apr-8080

I can access the default home page via both IPv4 and IPv6 from both the 
local machine and remotely.




On 25/05/2021 18:23, Michael Osipov wrote: >>> * Windows 8+ or 
Windows Server 2016/2019
* Have at least IPv6 available, no IP addresses necessary, ::1 is 
sufficient
* Any Tomcat with libtcnative 1.2.28 with the DLL compiled by Mark 
Thomas.
* Start Tomcat with the AprLifecycleListener and make sure that no 
address (hostname) is set.


I think I have replicated the above but obviously I have missed 
something. What do I need to do to recreate your results?


Please try my simple program from this gist: 
https://gist.github.com/michael-o/dfb86df472f62d2b2dff6ef12ee3758e


Vanilla DLL on Windows 10:

PS Z:\> java "-cp" 
".;C:\Entwicklung\Projekte\tomcat-native\dist\tomcat-native-1.2.29-dev.jar" 
"-Djava.library.path=C:\Entwicklung\Programme\apache-tomcat-9.0.46\bin" AprTest
libtcnative version: 1.2.28, libapr version 1.7.0
hostname: null, family: 2, next: 522994096
setsockopt IPV6_V6ONLY status: 70023
socket bind status: 0
socket listen status: 0


An IPv6 only socket is bound because default is 1 on the socket option 
and one cannot set to 0:

PS C:\Users\osipovmi> netstat -a  | Select-String -Pattern 

  TCP[::]:  md2pcvtc:0 ABHÖREN



then compiled with patches:

PS Z:\> java "-cp" 
".;C:\Entwicklung\Projekte\tomcat-native\dist\tomcat-native-1.2.29-dev.jar" 
"-Djava.library.path=C:\Entwicklung\Projekte\tomcat-native\native\WIN7_X64_DLL_RELEASE" AprTest
libtcnative version: 1.2.29-dev, libapr version 1.7.1-dev
hostname: null, family: 2, next: 523321776
setsockopt IPV6_V6ONLY status: 0
socket bind status: 0
socket listen status: 0


An IPv6 socket with dual-stack has been bound:

PS C:\Users\osipovmi> netstat -a  | Select-String -Pattern 

  TCP0.0.0.0:   md2pcvtc:0 ABHÖREN
  TCP[::]:  md2pcvtc:0 ABHÖREN



Please note that I have IPv6 enabled, but no IP addresses configured. By 
default only ::1 is present.


Addresses:

PS C:\Users\osipovmi> Get-NetIPAddress | Format-Table

ifIndex IPAddress   PrefixLength 
PrefixOrigin SuffixOrigin AddressState PolicyStore
--- -    
   ---
1   ::1  128 WellKnown  
  WellKnownPreferredActiveStore
20  169.254.228.218   16 WellKnown  
  Link TentativeActiveStore
32  192.168.58.19328 Manual 
  Manual   PreferredActiveStore
15  169.254.26.74 16 WellKnown  
  Link TentativeActiveStore
18  169.254.76.82 16 WellKnown  
  Link TentativeActiveStore
22  169.254.155.142   16 WellKnown  
  Link TentativeActiveStore
21  192.168.1.23  24 Dhcp   
  Dhcp PreferredActiveStore
1   127.0.0.1  8 WellKnown  
  WellKnownPreferredActiveStore


Does this help?

M


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



Re: APR connector on Windows 8+ fails to listen on all addresses

2021-05-27 Thread Mark Thomas

Michael,

I think we need to step back a bit.

I am unable to recreate the issue you describe. I am using:

- Windows Server 2019
- IPv6 enabled (and IPv4 and both have addresses)
- Apache Tomcat 9.0.46
- Apache Tomcat Native 1.2.28
- AprLifecycleListener is enabled
- No address configured for Connector
- Logs confirm http-apr-8080

I can access the default home page via both IPv4 and IPv6 from both the 
local machine and remotely.





On 25/05/2021 18:23, Michael Osipov wrote: >>> * Windows 8+ or Windows Server 
2016/2019
* Have at least IPv6 available, no IP addresses necessary, ::1 is 
sufficient
* Any Tomcat with libtcnative 1.2.28 with the DLL compiled by Mark 
Thomas.
* Start Tomcat with the AprLifecycleListener and make sure that no 
address (hostname) is set.


I think I have replicated the above but obviously I have missed 
something. What do I need to do to recreate your results?


Mark

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



Re: APR connector on Windows 8+ fails to listen on all addresses

2021-05-27 Thread Michael Osipov

Am 2021-05-27 um 07:39 schrieb Mladen Turk:

APR has to be compiled with -D_WIN32_WINNT=0x0600 -DWINVER=0x0600
Same with Tomcat Native

Use apr-1.6.x


Both don't work out for the following reasons:
* Your setenv.bat sets WINVER=0x0601 which fails for the NMakefile which 
in turn requires a symbolic name instead of a hex value, I have to pass 
WINVER=WIN7 anyway, then the rest works.
* Even if I do, the check in APR is performed at runtime for the OS 
version, therefore setting the socket option fails.
* How is 1.6.x going me to help here if it does not now anything about 
Windows 8, 10?


This [1] is what you need to make it work.

Kindly respond to my PR.

M

[1] 
https://github.com/apache/apr/commit/2bcd4b3ddb108d16f1c758c00a45de9aef57aa3a



On 25/05/2021 18:23, Michael Osipov wrote:

Folks,

we needed to deploy Tomcat 9.0.x on a Windows server (no jokes, 
please), but the contractor wasn't able to configure the APR connector 
to accept on external interfaces even after a day.
After my analysis it turned out be a subtile bug in libapr which 
affects Windows users only. I am also surprised why no one complained 
before.


Setup:
* Windows 8+ or Windows Server 2016/2019
* Have at least IPv6 available, no IP addresses necessary, ::1 is 
sufficient
* Any Tomcat with libtcnative 1.2.28 with the DLL compiled by Mark 
Thomas.
* Start Tomcat with the AprLifecycleListener and make sure that no 
address (hostname) is set.


To make a long investigation story 
short:http://svn.apache.org/viewvc?rev=1889037&view=rev

libapr, thus libtcnative suffer from a very subtile bug only visible
on dual-stack systems. Since on INET6 sockets IPV6_V6ONLY is 1 by 
default on Windows, no IPv4 addresses are bound. In the case above, 
Tomcat is only accessible on ::1. APR is supposed to set 
IPV6_V6ONLhttp://svn.apache.org/viewvc?rev=1889037&view=revY to 0 by 
default, but this fails because APR 1.7.x does not recognise anything 
above Windows 7 and assumes it to be Windows XP by default. As you 
might know Vista was the first Windows with true IPv6 an dual-sockets. 
When setsockopt is invoked APR gives you 70023, not implemented.


I was able, according to Mark's instructions, to compile OpenSSL, APR 
and Tomcat Native on Windows 10 and deploy on Windows Server 2019.

I'd like to push
* https://github.com/michael-o/tomcat/compare/main...clean-bind
* https://github.com/michael-o/tomcat-native/compare/main...clean-bind
as well as the real fix in APR 1.7.x: 
https://github.com/michael-o/apr/compare/1.7.x...1.7.x-windows


I ran all unit tests (main) with those modifications on these platforms:
* Windows 10, APR 1.7.0, 1.7.1-dev
* Windows Server 2019, APR 1.7.0, 1.7.1-dev
* FreeBSD 12-STABLE, APR 1.7.0, 1.7.1-dev
* RHEL 7, APR 1.4.8
* HP-UX 11i, APR 1.6.6

Some hosts are dual-stack, some IPv4 only. Moreover, I wrote a simple 
program which binds the socket for tracing only: 
https://gist.github.com/michael-o/dfb86df472f62d2b2dff6ef12ee3758e
It runs as expected on the above platforms, even with zone id on 
link-local addresses.


If no one objects, I'll merge soon.

Mark, I don't know when the next APR release will happen, but I 
consider this to be very annoying. Maybe it makes sense to push 1.2.29 
with APR 1.7.1-dev to please Windows users?


Michael

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






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



Re: APR connector on Windows 8+ fails to listen on all addresses

2021-05-27 Thread Michael Osipov

Am 2021-05-26 um 15:25 schrieb Mark Thomas:

On 25/05/2021 17:23, Michael Osipov wrote:



Nice research.

Mark, I don't know when the next APR release will happen, but I 
consider this to be very annoying. Maybe it makes sense to push 1.2.29 
with APR 1.7.1-dev to please Windows users?


I'd prefer to use a released version of APR but failing that we can 
provide a patch against 1.7.0. If you can add the appropriate patch here:

https://github.com/apache/tomcat-native/tree/main/native/srclib/apr

I can include it in the next release.


The change has been committed to apr-1.7.x, here [1] is the changeset, 
compiled for me nicely several times. Would be good if you could also 
check at your end.

I will inquire on dev@apr.a.o if someone is willing to perform 1.7.1 soon.

We are close to starting the June releases so if we move quickly on a 
Tomcat-Native release now, we can included a fixed version of Tomcat 
Native in the next set of Tomcat releases.


I have also applied by changes (simplifcations) to Tomcat Native, but 
Mladen objected [2] and asked me to move to a PR to discuss [3], but I 
am still waiting for an explanation of his objection.
The purpose of the change was to simplify and have consistency with the 
Java code where we don't do such things.

Hopefully we can setttle this before 1.2.29.

M

[1] 
https://github.com/apache/apr/commit/2bcd4b3ddb108d16f1c758c00a45de9aef57aa3a
[2] 
https://github.com/apache/tomcat-native/commit/420cd1c159e4f27bb5d2a873dbd1fb7ea5d3473c

[3] https://github.com/apache/tomcat-native/pull/9

-
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: Optimized selector handling for Java 11

2021-05-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 9535eb3  Optimized selector handling for Java 11
9535eb3 is described below

commit 9535eb304d5b359c8e23ae87eb6b4612e9bb608d
Author: remm 
AuthorDate: Thu May 27 10:55:55 2021 +0200

Optimized selector handling for Java 11

Hopefully well tested with Tomcat 10.
---
 java/org/apache/tomcat/util/net/NioEndpoint.java | 42 +++-
 webapps/docs/changelog.xml   |  3 ++
 2 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index e8b017b..234747c 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -739,23 +739,28 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 }
 
 public void cancelledKey(SelectionKey sk, 
SocketWrapperBase socketWrapper) {
-try {
-// If is important to cancel the key first, otherwise a 
deadlock may occur between the
-// poller select and the socket channel close which would 
cancel the key
-if (sk != null) {
-sk.attach(null);
-if (sk.isValid()) {
-sk.cancel();
+if (JreCompat.isJre11Available() && socketWrapper != null) {
+socketWrapper.close();
+} else {
+try {
+// If is important to cancel the key first, otherwise a 
deadlock may occur between the
+// poller select and the socket channel close which would 
cancel the key
+// This workaround is not needed on Java 11+
+if (sk != null) {
+sk.attach(null);
+if (sk.isValid()) {
+sk.cancel();
+}
+}
+} catch (Throwable e) {
+ExceptionUtils.handleThrowable(e);
+if (log.isDebugEnabled()) {
+
log.error(sm.getString("endpoint.debug.channelCloseFail"), e);
+}
+} finally {
+if (socketWrapper != null) {
+socketWrapper.close();
 }
-}
-} catch (Throwable e) {
-ExceptionUtils.handleThrowable(e);
-if (log.isDebugEnabled()) {
-log.error(sm.getString("endpoint.debug.channelCloseFail"), 
e);
-}
-} finally {
-if (socketWrapper != null) {
-socketWrapper.close();
 }
 }
 }
@@ -1746,6 +1751,11 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 }
 
 private SelectionKey getSelectionKey() {
+// Shortcut for Java 11 onwards
+if (JreCompat.isJre11Available()) {
+return null;
+}
+
 SocketChannel socketChannel = 
socketWrapper.getSocket().getIOChannel();
 if (socketChannel == null) {
 return null;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 91731c9..6a2f068 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -174,6 +174,9 @@
 Add back simplification of NIO block read and write, now better
 validated in Tomcat 10. (remm)
   
+  
+Optimize NIO selector handling for Java 11. (remm)
+  
 
   
   

-
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: Simplify NIO block read and write

2021-05-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 500b2a4  Simplify NIO block read and write
500b2a4 is described below

commit 500b2a4114142335789babce4e42e0fae330dea8
Author: remm 
AuthorDate: Thu May 27 10:44:23 2021 +0200

Simplify NIO block read and write

Now better validated with Tomcat 10.
---
 .../catalina/security/SecurityClassLoad.java   |   3 -
 .../apache/tomcat/util/net/LocalStrings.properties |   5 -
 .../tomcat/util/net/LocalStrings_fr.properties |   5 -
 .../tomcat/util/net/LocalStrings_ja.properties |   5 -
 .../tomcat/util/net/LocalStrings_ko.properties |   5 -
 .../tomcat/util/net/LocalStrings_zh_CN.properties  |   5 -
 .../tomcat/util/net/NioBlockingSelector.java   | 535 -
 java/org/apache/tomcat/util/net/NioEndpoint.java   | 237 -
 .../apache/tomcat/util/net/NioSelectorPool.java| 348 --
 .../apache/tomcat/util/net/SecureNioChannel.java   |  28 +-
 webapps/docs/changelog.xml |   4 +
 webapps/docs/config/http.xml   |  35 --
 12 files changed, 128 insertions(+), 1087 deletions(-)

diff --git a/java/org/apache/catalina/security/SecurityClassLoad.java 
b/java/org/apache/catalina/security/SecurityClassLoad.java
index 141a1d3..19b9c21 100644
--- a/java/org/apache/catalina/security/SecurityClassLoad.java
+++ b/java/org/apache/catalina/security/SecurityClassLoad.java
@@ -187,9 +187,6 @@ public final class SecurityClassLoad {
 // net
 loader.loadClass(basePackage + "util.net.Constants");
 loader.loadClass(basePackage + "util.net.DispatchType");
-loader.loadClass(basePackage + 
"util.net.NioBlockingSelector$BlockPoller$RunnableAdd");
-loader.loadClass(basePackage + 
"util.net.NioBlockingSelector$BlockPoller$RunnableCancel");
-loader.loadClass(basePackage + 
"util.net.NioBlockingSelector$BlockPoller$RunnableRemove");
 loader.loadClass(basePackage + 
"util.net.AprEndpoint$AprSocketWrapper$AprOperationState");
 loader.loadClass(basePackage + 
"util.net.NioEndpoint$NioSocketWrapper$NioOperationState");
 loader.loadClass(basePackage + 
"util.net.Nio2Endpoint$Nio2SocketWrapper$Nio2OperationState");
diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties 
b/java/org/apache/tomcat/util/net/LocalStrings.properties
index b1e5c2a..f3f1619 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings.properties
@@ -142,11 +142,6 @@ endpoint.warn.noRemotePort=Unable to determine remote port 
for socket [{0}]
 endpoint.warn.noUtilityExecutor=No utility executor was set, creating one
 endpoint.warn.unlockAcceptorFailed=Acceptor thread [{0}] failed to unlock. 
Forcing hard socket shutdown.
 
-nioBlockingSelector.keyNotRegistered=Key no longer registered
-nioBlockingSelector.possibleLeak=Possible key leak, cancelling key in the 
finalizer
-nioBlockingSelector.processingError=Error processing selection key operations
-nioBlockingSelector.selectError=Error selecting key
-
 sniExtractor.clientHelloInvalid=The ClientHello message was not correctly 
formatted
 sniExtractor.clientHelloTooBig=The ClientHello was not presented in a single 
TLS record so no SNI information could be extracted
 sniExtractor.tooEarly=It is illegal to call this method before the client 
hello has been parsed
diff --git a/java/org/apache/tomcat/util/net/LocalStrings_fr.properties 
b/java/org/apache/tomcat/util/net/LocalStrings_fr.properties
index 626ccae..11c19fd 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings_fr.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings_fr.properties
@@ -142,11 +142,6 @@ endpoint.warn.noRemotePort=Impossible de déterminer le 
port distant pour le soc
 endpoint.warn.noUtilityExecutor=Aucun exécuteur utilitaire configuré, un 
nouveau sera crée
 endpoint.warn.unlockAcceptorFailed=Le thread qui accepte les sockets [{0}] 
n''a pu être débloqué, arrêt forcé su socket serveur
 
-nioBlockingSelector.keyNotRegistered=La clé n'est plus enregistrée
-nioBlockingSelector.possibleLeak=Une fuite de mémoire sur la clé a pu se 
produire, la clé est annulée dans le finalizer
-nioBlockingSelector.processingError=Erreur lors du traitement des opérations 
de sélection des clés
-nioBlockingSelector.selectError=Erreur lors de la sélection de clés
-
 sniExtractor.clientHelloInvalid=Le message ClientHello n'était pas formaté 
correctement
 sniExtractor.clientHelloTooBig=Le ClientHello n'a pas été présenté dans un 
seul enregistrement TLS donc l'information SNI n'a pu être extraite
 sniExtractor.tooEarly=Il est illégal d'appeler cette méthode avant que le 
hello du client ait été traité
diff --git a/java/org/apache/tomcat/util/net/LocalStrings_ja.properties 
b/java/org/

[tomcat] branch 10.0.x updated: Remove unused translations (also removed from poeditor.com)

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new c99569b  Remove unused translations (also removed from poeditor.com)
c99569b is described below

commit c99569bb7e20db8f04c733a2a9462e00e5c012ed
Author: Mark Thomas 
AuthorDate: Thu May 27 09:33:01 2021 +0100

Remove unused translations (also removed from poeditor.com)
---
 java/org/apache/tomcat/util/net/LocalStrings_fr.properties| 5 -
 java/org/apache/tomcat/util/net/LocalStrings_ja.properties| 5 -
 java/org/apache/tomcat/util/net/LocalStrings_ko.properties| 5 -
 java/org/apache/tomcat/util/net/LocalStrings_zh_CN.properties | 5 -
 4 files changed, 20 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/LocalStrings_fr.properties 
b/java/org/apache/tomcat/util/net/LocalStrings_fr.properties
index 626ccae..11c19fd 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings_fr.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings_fr.properties
@@ -142,11 +142,6 @@ endpoint.warn.noRemotePort=Impossible de déterminer le 
port distant pour le soc
 endpoint.warn.noUtilityExecutor=Aucun exécuteur utilitaire configuré, un 
nouveau sera crée
 endpoint.warn.unlockAcceptorFailed=Le thread qui accepte les sockets [{0}] 
n''a pu être débloqué, arrêt forcé su socket serveur
 
-nioBlockingSelector.keyNotRegistered=La clé n'est plus enregistrée
-nioBlockingSelector.possibleLeak=Une fuite de mémoire sur la clé a pu se 
produire, la clé est annulée dans le finalizer
-nioBlockingSelector.processingError=Erreur lors du traitement des opérations 
de sélection des clés
-nioBlockingSelector.selectError=Erreur lors de la sélection de clés
-
 sniExtractor.clientHelloInvalid=Le message ClientHello n'était pas formaté 
correctement
 sniExtractor.clientHelloTooBig=Le ClientHello n'a pas été présenté dans un 
seul enregistrement TLS donc l'information SNI n'a pu être extraite
 sniExtractor.tooEarly=Il est illégal d'appeler cette méthode avant que le 
hello du client ait été traité
diff --git a/java/org/apache/tomcat/util/net/LocalStrings_ja.properties 
b/java/org/apache/tomcat/util/net/LocalStrings_ja.properties
index 690a2f0..4f69f18 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings_ja.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings_ja.properties
@@ -142,11 +142,6 @@ endpoint.warn.noRemotePort=ソケット[{0}] のリモートポート番号を
 endpoint.warn.noUtilityExecutor=ユーティリティエグゼキュターが構成されていません。新たに作成します。
 endpoint.warn.unlockAcceptorFailed=Acceptor スレッド[{0}]のロックを解除できませんでした。 
強制的にハードソケットをシャットダウンします。
 
-nioBlockingSelector.keyNotRegistered=セレクタにキーが登録されていません。
-nioBlockingSelector.possibleLeak=潜在的なキーのリークです。finalizer でキーをキャンセルします。
-nioBlockingSelector.processingError=選択キー操作の処理中のエラー
-nioBlockingSelector.selectError=キー・セットの選択中のエラー
-
 sniExtractor.clientHelloInvalid=ClientHelloメッセージが正しくフォーマットされていません。
 
sniExtractor.clientHelloTooBig=ClientHelloは単一のTLSレコードには表示されないため、SNI情報は抽出できませんでした
 sniExtractor.tooEarly=クライアントのhelloが解析される前にこのメソッドを呼び出すことは違法です
diff --git a/java/org/apache/tomcat/util/net/LocalStrings_ko.properties 
b/java/org/apache/tomcat/util/net/LocalStrings_ko.properties
index f08c4e2..6fae3c6 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings_ko.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings_ko.properties
@@ -142,11 +142,6 @@ endpoint.warn.noRemotePort=소켓 [{0}]을(를) 위한 원격 포트를 결정
 endpoint.warn.noUtilityExecutor=UtilityExecutor가 설정되지 않아, 새로 생성합니다.
 endpoint.warn.unlockAcceptorFailed=Acceptor 쓰레드 [{0}]이(가) 잠금을 풀지 못했습니다. 강제로 
소켓을 셧다운합니다.
 
-nioBlockingSelector.keyNotRegistered=키가 더 이상 등록되어 있지 않습니다.
-nioBlockingSelector.possibleLeak=키 누수가 가능한 상황입니다. finalize()에서 키를 취소합니다.
-nioBlockingSelector.processingError=Selection 키 오퍼레이션들을 처리 중 오류 발생
-nioBlockingSelector.selectError=키를 select하는 중 오류 발생
-
 sniExtractor.clientHelloInvalid=ClientHello 메시지가 정확히 포맷되지 않았습니다.
 sniExtractor.clientHelloTooBig=ClientHello가 단일 TLS 레코드에 존재하지 않았기에, SNI 정보를 추출할 
수 없었습니다.
 sniExtractor.tooEarly=클라이언트 헬로 메시지가 파싱되기 전에 이 메소드를 호출하는 것은 허용되지 않습니다.
diff --git a/java/org/apache/tomcat/util/net/LocalStrings_zh_CN.properties 
b/java/org/apache/tomcat/util/net/LocalStrings_zh_CN.properties
index 6d50b76..6f33320 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings_zh_CN.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings_zh_CN.properties
@@ -140,11 +140,6 @@ endpoint.warn.noRemotePort=无法确定 socket [{0}] 的远程端口
 endpoint.warn.noUtilityExecutor=没有公共的executor 被设置时,创建一个.
 endpoint.warn.unlockAcceptorFailed=接收器线程[{0}]解锁失败。强制硬套接字关闭。
 
-nioBlockingSelector.keyNotRegistered=密钥不再注册
-nioBlockingSelector.possibleLeak=可能的密钥泄漏,正在取消终结器中的密钥
-nioBlockingSelector.processingError=处理选择键操作时出错
-nioBlockingSelector.selectError=选择键时出错
-
 sniExtractor.clientHelloInvalid=ClientHello信息未正常格式化
 sniExtractor.clientHelloTooBig=):ClientHello 没有出现在单个TLS记录中,因此无法提取SNI信息
 sniExtractor.tooEar

[tomcat] branch main updated: Remove unused translations (also removed from poeditor.com)

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 39665c7  Remove unused translations (also removed from poeditor.com)
39665c7 is described below

commit 39665c75e474488362398d83784dcf0fc8acfb30
Author: Mark Thomas 
AuthorDate: Thu May 27 09:33:01 2021 +0100

Remove unused translations (also removed from poeditor.com)
---
 java/org/apache/tomcat/util/net/LocalStrings_fr.properties| 5 -
 java/org/apache/tomcat/util/net/LocalStrings_ja.properties| 5 -
 java/org/apache/tomcat/util/net/LocalStrings_ko.properties| 5 -
 java/org/apache/tomcat/util/net/LocalStrings_zh_CN.properties | 5 -
 4 files changed, 20 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/LocalStrings_fr.properties 
b/java/org/apache/tomcat/util/net/LocalStrings_fr.properties
index 626ccae..11c19fd 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings_fr.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings_fr.properties
@@ -142,11 +142,6 @@ endpoint.warn.noRemotePort=Impossible de déterminer le 
port distant pour le soc
 endpoint.warn.noUtilityExecutor=Aucun exécuteur utilitaire configuré, un 
nouveau sera crée
 endpoint.warn.unlockAcceptorFailed=Le thread qui accepte les sockets [{0}] 
n''a pu être débloqué, arrêt forcé su socket serveur
 
-nioBlockingSelector.keyNotRegistered=La clé n'est plus enregistrée
-nioBlockingSelector.possibleLeak=Une fuite de mémoire sur la clé a pu se 
produire, la clé est annulée dans le finalizer
-nioBlockingSelector.processingError=Erreur lors du traitement des opérations 
de sélection des clés
-nioBlockingSelector.selectError=Erreur lors de la sélection de clés
-
 sniExtractor.clientHelloInvalid=Le message ClientHello n'était pas formaté 
correctement
 sniExtractor.clientHelloTooBig=Le ClientHello n'a pas été présenté dans un 
seul enregistrement TLS donc l'information SNI n'a pu être extraite
 sniExtractor.tooEarly=Il est illégal d'appeler cette méthode avant que le 
hello du client ait été traité
diff --git a/java/org/apache/tomcat/util/net/LocalStrings_ja.properties 
b/java/org/apache/tomcat/util/net/LocalStrings_ja.properties
index 690a2f0..4f69f18 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings_ja.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings_ja.properties
@@ -142,11 +142,6 @@ endpoint.warn.noRemotePort=ソケット[{0}] のリモートポート番号を
 endpoint.warn.noUtilityExecutor=ユーティリティエグゼキュターが構成されていません。新たに作成します。
 endpoint.warn.unlockAcceptorFailed=Acceptor スレッド[{0}]のロックを解除できませんでした。 
強制的にハードソケットをシャットダウンします。
 
-nioBlockingSelector.keyNotRegistered=セレクタにキーが登録されていません。
-nioBlockingSelector.possibleLeak=潜在的なキーのリークです。finalizer でキーをキャンセルします。
-nioBlockingSelector.processingError=選択キー操作の処理中のエラー
-nioBlockingSelector.selectError=キー・セットの選択中のエラー
-
 sniExtractor.clientHelloInvalid=ClientHelloメッセージが正しくフォーマットされていません。
 
sniExtractor.clientHelloTooBig=ClientHelloは単一のTLSレコードには表示されないため、SNI情報は抽出できませんでした
 sniExtractor.tooEarly=クライアントのhelloが解析される前にこのメソッドを呼び出すことは違法です
diff --git a/java/org/apache/tomcat/util/net/LocalStrings_ko.properties 
b/java/org/apache/tomcat/util/net/LocalStrings_ko.properties
index f08c4e2..6fae3c6 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings_ko.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings_ko.properties
@@ -142,11 +142,6 @@ endpoint.warn.noRemotePort=소켓 [{0}]을(를) 위한 원격 포트를 결정
 endpoint.warn.noUtilityExecutor=UtilityExecutor가 설정되지 않아, 새로 생성합니다.
 endpoint.warn.unlockAcceptorFailed=Acceptor 쓰레드 [{0}]이(가) 잠금을 풀지 못했습니다. 강제로 
소켓을 셧다운합니다.
 
-nioBlockingSelector.keyNotRegistered=키가 더 이상 등록되어 있지 않습니다.
-nioBlockingSelector.possibleLeak=키 누수가 가능한 상황입니다. finalize()에서 키를 취소합니다.
-nioBlockingSelector.processingError=Selection 키 오퍼레이션들을 처리 중 오류 발생
-nioBlockingSelector.selectError=키를 select하는 중 오류 발생
-
 sniExtractor.clientHelloInvalid=ClientHello 메시지가 정확히 포맷되지 않았습니다.
 sniExtractor.clientHelloTooBig=ClientHello가 단일 TLS 레코드에 존재하지 않았기에, SNI 정보를 추출할 
수 없었습니다.
 sniExtractor.tooEarly=클라이언트 헬로 메시지가 파싱되기 전에 이 메소드를 호출하는 것은 허용되지 않습니다.
diff --git a/java/org/apache/tomcat/util/net/LocalStrings_zh_CN.properties 
b/java/org/apache/tomcat/util/net/LocalStrings_zh_CN.properties
index 6d50b76..6f33320 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings_zh_CN.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings_zh_CN.properties
@@ -140,11 +140,6 @@ endpoint.warn.noRemotePort=无法确定 socket [{0}] 的远程端口
 endpoint.warn.noUtilityExecutor=没有公共的executor 被设置时,创建一个.
 endpoint.warn.unlockAcceptorFailed=接收器线程[{0}]解锁失败。强制硬套接字关闭。
 
-nioBlockingSelector.keyNotRegistered=密钥不再注册
-nioBlockingSelector.possibleLeak=可能的密钥泄漏,正在取消终结器中的密钥
-nioBlockingSelector.processingError=处理选择键操作时出错
-nioBlockingSelector.selectError=选择键时出错
-
 sniExtractor.clientHelloInvalid=ClientHello信息未正常格式化
 sniExtractor.clientHelloTooBig=):ClientHello 没有出现在单个TLS记录中,因此无法提取SNI信息
 sniExtractor.tooEarly=在

[tomcat] branch 10.0.x updated: Remove useless strings

2021-05-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 6a6acf7  Remove useless strings
6a6acf7 is described below

commit 6a6acf7f062dc8a64ce3315ddf1f3d28b5c46916
Author: remm 
AuthorDate: Thu May 27 10:18:13 2021 +0200

Remove useless strings
---
 java/org/apache/tomcat/util/net/LocalStrings.properties | 5 -
 1 file changed, 5 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties 
b/java/org/apache/tomcat/util/net/LocalStrings.properties
index b1e5c2a..f3f1619 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings.properties
@@ -142,11 +142,6 @@ endpoint.warn.noRemotePort=Unable to determine remote port 
for socket [{0}]
 endpoint.warn.noUtilityExecutor=No utility executor was set, creating one
 endpoint.warn.unlockAcceptorFailed=Acceptor thread [{0}] failed to unlock. 
Forcing hard socket shutdown.
 
-nioBlockingSelector.keyNotRegistered=Key no longer registered
-nioBlockingSelector.possibleLeak=Possible key leak, cancelling key in the 
finalizer
-nioBlockingSelector.processingError=Error processing selection key operations
-nioBlockingSelector.selectError=Error selecting key
-
 sniExtractor.clientHelloInvalid=The ClientHello message was not correctly 
formatted
 sniExtractor.clientHelloTooBig=The ClientHello was not presented in a single 
TLS record so no SNI information could be extracted
 sniExtractor.tooEarly=It is illegal to call this method before the client 
hello has been parsed

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



[tomcat] branch main updated: Remove useless strings

2021-05-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new e5b6556  Remove useless strings
e5b6556 is described below

commit e5b65565768ab74b563c21be413ad481a9d97512
Author: remm 
AuthorDate: Thu May 27 10:18:13 2021 +0200

Remove useless strings
---
 java/org/apache/tomcat/util/net/LocalStrings.properties | 5 -
 1 file changed, 5 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties 
b/java/org/apache/tomcat/util/net/LocalStrings.properties
index b1e5c2a..f3f1619 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings.properties
@@ -142,11 +142,6 @@ endpoint.warn.noRemotePort=Unable to determine remote port 
for socket [{0}]
 endpoint.warn.noUtilityExecutor=No utility executor was set, creating one
 endpoint.warn.unlockAcceptorFailed=Acceptor thread [{0}] failed to unlock. 
Forcing hard socket shutdown.
 
-nioBlockingSelector.keyNotRegistered=Key no longer registered
-nioBlockingSelector.possibleLeak=Possible key leak, cancelling key in the 
finalizer
-nioBlockingSelector.processingError=Error processing selection key operations
-nioBlockingSelector.selectError=Error selecting key
-
 sniExtractor.clientHelloInvalid=The ClientHello message was not correctly 
formatted
 sniExtractor.clientHelloTooBig=The ClientHello was not presented in a single 
TLS record so no SNI information could be extracted
 sniExtractor.tooEarly=It is illegal to call this method before the client 
hello has been parsed

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



Re: Renamings with APR removal in 10.1.x

2021-05-27 Thread Michael Osipov

Am 2021-05-26 um 15:29 schrieb Mark Thomas:

On 25/05/2021 17:27, Michael Osipov wrote:

Mark,

since you are going to remove all bits soon, will you rename Java 
items with still carry the APR substring? E.g., AprLifecycleListener 
will be a misleading name for obvious reasons.


I hadn't considered that but it seems like a good opportunity to remove 
some of the confusion that that naming has caused. I think a switch to 
TomcatNativeLifecylcleListener would work.


My expectation is that in the early milestone releases for 10.1.x that 
the listener looks for Tomcat Native 1.2.x but at some point before the 
first stable release it switches to Tomcat Native 2.0.x. That assumes we 
find the time to create Tomcat Native 2.0.x. Given that it will mostly 
be deleting code, that should be doable.


Have also a look at build.xml: test.apr.loc should also be renamed to 
test.tomcat-native.loc.


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



[tomcat] branch 10.0.x updated: Need unique name for log files else they overwrite each other

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 1f15ad2  Need unique name for log files else they overwrite each other
1f15ad2 is described below

commit 1f15ad2a0e3a98755cc95860a6f75b06900a9da8
Author: Mark Thomas 
AuthorDate: Thu May 27 08:40:18 2021 +0100

Need unique name for log files else they overwrite each other
---
 .github/workflows/ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b3079ef..8ae5eb4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -50,6 +50,6 @@ jobs:
 - name: Upload logs
   uses: actions/upload-artifact@v2
   with:
-name: logs
+name: JDK${{ matrix.java }}-${{ matrix.os }}-logs
 path: output/build/logs/TEST*.txt
 retention-days: 7

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



[tomcat] branch main updated: Need unique name for log files else they overwrite each other

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 91262f2  Need unique name for log files else they overwrite each other
91262f2 is described below

commit 91262f2d9c99d39ab9ca14c83d910674dbcef666
Author: Mark Thomas 
AuthorDate: Thu May 27 08:40:18 2021 +0100

Need unique name for log files else they overwrite each other
---
 .github/workflows/ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b3079ef..8ae5eb4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -50,6 +50,6 @@ jobs:
 - name: Upload logs
   uses: actions/upload-artifact@v2
   with:
-name: logs
+name: JDK${{ matrix.java }}-${{ matrix.os }}-logs
 path: output/build/logs/TEST*.txt
 retention-days: 7

-
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: Code clean-up. Remove unnecessary code.

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 0e7b871  Code clean-up. Remove unnecessary code.
0e7b871 is described below

commit 0e7b8712c4decdc11994679d9d4e93746a45ab9a
Author: Mark Thomas 
AuthorDate: Thu May 27 08:22:28 2021 +0100

Code clean-up. Remove unnecessary code.
---
 java/javax/servlet/http/HttpUtils.java  | 2 +-
 java/org/apache/catalina/ha/session/JvmRouteBinderValve.java| 3 +--
 java/org/apache/catalina/valves/rewrite/Substitution.java   | 2 +-
 .../apache/catalina/webresources/AbstractArchiveResourceSet.java| 2 +-
 java/org/apache/jasper/compiler/JspUtil.java| 4 ++--
 test/org/apache/tomcat/util/buf/TestUtf8.java   | 6 +++---
 webapps/examples/WEB-INF/classes/util/CookieFilter.java | 2 +-
 7 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/java/javax/servlet/http/HttpUtils.java 
b/java/javax/servlet/http/HttpUtils.java
index 405ab83..3305cd1 100644
--- a/java/javax/servlet/http/HttpUtils.java
+++ b/java/javax/servlet/http/HttpUtils.java
@@ -99,7 +99,7 @@ public class HttpUtils {
 throw new IllegalArgumentException();
 }
 String key = parseName(pair.substring(0, pos), sb);
-String val = parseName(pair.substring(pos+1, pair.length()), sb);
+String val = parseName(pair.substring(pos+1), sb);
 if (ht.containsKey(key)) {
 String oldVals[] = ht.get(key);
 valArray = Arrays.copyOf(oldVals, oldVals.length + 1);
diff --git a/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java 
b/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java
index 055fa74..bfde34a 100644
--- a/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java
+++ b/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java
@@ -273,8 +273,7 @@ public class JvmRouteBinderValve extends ValveBase 
implements ClusterValve {
 String requestJvmRoute = null;
 int index = sessionId.indexOf('.');
 if (index > 0) {
-requestJvmRoute = sessionId
-.substring(index + 1, sessionId.length());
+requestJvmRoute = sessionId.substring(index + 1);
 }
 if (requestJvmRoute != null && !requestJvmRoute.equals(localJvmRoute)) 
{
 if (log.isDebugEnabled()) {
diff --git a/java/org/apache/catalina/valves/rewrite/Substitution.java 
b/java/org/apache/catalina/valves/rewrite/Substitution.java
index 50d78db..2fa3e8d 100644
--- a/java/org/apache/catalina/valves/rewrite/Substitution.java
+++ b/java/org/apache/catalina/valves/rewrite/Substitution.java
@@ -143,7 +143,7 @@ public class Substitution {
 if (percentPos == -1 && dollarPos == -1 && backslashPos == -1) {
 // Static text
 StaticElement newElement = new StaticElement();
-newElement.value = sub.substring(pos, sub.length());
+newElement.value = sub.substring(pos);
 pos = sub.length();
 elements.add(newElement);
 } else if (isFirstPos(backslashPos, dollarPos, percentPos)) {
diff --git 
a/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java 
b/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
index 23adb9a..1b80cc8 100644
--- a/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
+++ b/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
@@ -232,7 +232,7 @@ public abstract class AbstractArchiveResourceSet extends 
AbstractResourceSet {
 
 if (path.startsWith(webAppMount)) {
 String pathInJar = getInternalPath() + path.substring(
-webAppMount.length(), path.length());
+webAppMount.length());
 // Always strip off the leading '/' to get the JAR path
 if (pathInJar.length() > 0 && pathInJar.charAt(0) == '/') {
 pathInJar = pathInJar.substring(1);
diff --git a/java/org/apache/jasper/compiler/JspUtil.java 
b/java/org/apache/jasper/compiler/JspUtil.java
index 9d723e9..1b45ae4 100644
--- a/java/org/apache/jasper/compiler/JspUtil.java
+++ b/java/org/apache/jasper/compiler/JspUtil.java
@@ -667,7 +667,7 @@ public class JspUtil {
 InputStream in = null;
 
 if (jar != null) {
-String jarEntryName = fname.substring(1, fname.length());
+String jarEntryName = fname.substring(1);
 in = jar.getInputStream(jarEntryName);
 } else {
 in = ctxt.getResourceAsStream(fname);
@@ -685,7 +685,7 @@ public class JspUtil {
 throws IOException {
 InputSource source;
 if (jar != null) {
-String jarEntryName = fname.subs

[tomcat] branch 9.0.x updated: Code clean-up. Remove unnecessary code.

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new ac5642d  Code clean-up. Remove unnecessary code.
ac5642d is described below

commit ac5642d89bb9c320b17d4a93df34fa92295dee93
Author: Mark Thomas 
AuthorDate: Thu May 27 08:22:28 2021 +0100

Code clean-up. Remove unnecessary code.
---
 java/javax/servlet/http/HttpUtils.java  | 2 +-
 java/org/apache/catalina/ha/session/JvmRouteBinderValve.java| 3 +--
 java/org/apache/catalina/valves/rewrite/Substitution.java   | 2 +-
 .../apache/catalina/webresources/AbstractArchiveResourceSet.java| 2 +-
 java/org/apache/jasper/compiler/JspUtil.java| 4 ++--
 test/org/apache/tomcat/util/buf/TestUtf8.java   | 6 +++---
 webapps/examples/WEB-INF/classes/util/CookieFilter.java | 2 +-
 7 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/java/javax/servlet/http/HttpUtils.java 
b/java/javax/servlet/http/HttpUtils.java
index f7a0fac..833f166 100644
--- a/java/javax/servlet/http/HttpUtils.java
+++ b/java/javax/servlet/http/HttpUtils.java
@@ -99,7 +99,7 @@ public class HttpUtils {
 throw new IllegalArgumentException();
 }
 String key = parseName(pair.substring(0, pos), sb);
-String val = parseName(pair.substring(pos+1, pair.length()), sb);
+String val = parseName(pair.substring(pos+1), sb);
 if (ht.containsKey(key)) {
 String oldVals[] = ht.get(key);
 valArray = Arrays.copyOf(oldVals, oldVals.length + 1);
diff --git a/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java 
b/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java
index 055fa74..bfde34a 100644
--- a/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java
+++ b/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java
@@ -273,8 +273,7 @@ public class JvmRouteBinderValve extends ValveBase 
implements ClusterValve {
 String requestJvmRoute = null;
 int index = sessionId.indexOf('.');
 if (index > 0) {
-requestJvmRoute = sessionId
-.substring(index + 1, sessionId.length());
+requestJvmRoute = sessionId.substring(index + 1);
 }
 if (requestJvmRoute != null && !requestJvmRoute.equals(localJvmRoute)) 
{
 if (log.isDebugEnabled()) {
diff --git a/java/org/apache/catalina/valves/rewrite/Substitution.java 
b/java/org/apache/catalina/valves/rewrite/Substitution.java
index 50d78db..2fa3e8d 100644
--- a/java/org/apache/catalina/valves/rewrite/Substitution.java
+++ b/java/org/apache/catalina/valves/rewrite/Substitution.java
@@ -143,7 +143,7 @@ public class Substitution {
 if (percentPos == -1 && dollarPos == -1 && backslashPos == -1) {
 // Static text
 StaticElement newElement = new StaticElement();
-newElement.value = sub.substring(pos, sub.length());
+newElement.value = sub.substring(pos);
 pos = sub.length();
 elements.add(newElement);
 } else if (isFirstPos(backslashPos, dollarPos, percentPos)) {
diff --git 
a/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java 
b/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
index 2236491..04a4fe4 100644
--- a/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
+++ b/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
@@ -238,7 +238,7 @@ public abstract class AbstractArchiveResourceSet extends 
AbstractResourceSet {
 
 if (path.startsWith(webAppMount)) {
 String pathInJar = getInternalPath() + path.substring(
-webAppMount.length(), path.length());
+webAppMount.length());
 // Always strip off the leading '/' to get the JAR path
 if (pathInJar.length() > 0 && pathInJar.charAt(0) == '/') {
 pathInJar = pathInJar.substring(1);
diff --git a/java/org/apache/jasper/compiler/JspUtil.java 
b/java/org/apache/jasper/compiler/JspUtil.java
index 44a332d..6cfb761 100644
--- a/java/org/apache/jasper/compiler/JspUtil.java
+++ b/java/org/apache/jasper/compiler/JspUtil.java
@@ -639,7 +639,7 @@ public class JspUtil {
 InputStream in = null;
 
 if (jar != null) {
-String jarEntryName = fname.substring(1, fname.length());
+String jarEntryName = fname.substring(1);
 in = jar.getInputStream(jarEntryName);
 } else {
 in = ctxt.getResourceAsStream(fname);
@@ -657,7 +657,7 @@ public class JspUtil {
 throws IOException {
 InputSource source;
 if (jar != null) {
-String jarEntryName = fname.subs

[tomcat] branch 10.0.x updated: Code clean-up. Remove unnecessary code.

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 65cc45a  Code clean-up. Remove unnecessary code.
65cc45a is described below

commit 65cc45aea6801ad2080b50343e4199888443d891
Author: Mark Thomas 
AuthorDate: Thu May 27 08:22:28 2021 +0100

Code clean-up. Remove unnecessary code.
---
 java/jakarta/servlet/http/HttpUtils.java| 2 +-
 java/org/apache/catalina/ha/session/JvmRouteBinderValve.java| 3 +--
 java/org/apache/catalina/valves/rewrite/Substitution.java   | 2 +-
 .../apache/catalina/webresources/AbstractArchiveResourceSet.java| 2 +-
 java/org/apache/jasper/compiler/JspUtil.java| 4 ++--
 test/org/apache/tomcat/util/buf/TestUtf8.java   | 6 +++---
 webapps/examples/WEB-INF/classes/util/CookieFilter.java | 2 +-
 7 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/java/jakarta/servlet/http/HttpUtils.java 
b/java/jakarta/servlet/http/HttpUtils.java
index 279eb38..3903729 100644
--- a/java/jakarta/servlet/http/HttpUtils.java
+++ b/java/jakarta/servlet/http/HttpUtils.java
@@ -99,7 +99,7 @@ public class HttpUtils {
 throw new IllegalArgumentException();
 }
 String key = parseName(pair.substring(0, pos), sb);
-String val = parseName(pair.substring(pos+1, pair.length()), sb);
+String val = parseName(pair.substring(pos+1), sb);
 if (ht.containsKey(key)) {
 String oldVals[] = ht.get(key);
 valArray = Arrays.copyOf(oldVals, oldVals.length + 1);
diff --git a/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java 
b/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java
index 55201f6..c777d3e 100644
--- a/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java
+++ b/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java
@@ -273,8 +273,7 @@ public class JvmRouteBinderValve extends ValveBase 
implements ClusterValve {
 String requestJvmRoute = null;
 int index = sessionId.indexOf('.');
 if (index > 0) {
-requestJvmRoute = sessionId
-.substring(index + 1, sessionId.length());
+requestJvmRoute = sessionId.substring(index + 1);
 }
 if (requestJvmRoute != null && !requestJvmRoute.equals(localJvmRoute)) 
{
 if (log.isDebugEnabled()) {
diff --git a/java/org/apache/catalina/valves/rewrite/Substitution.java 
b/java/org/apache/catalina/valves/rewrite/Substitution.java
index 50d78db..2fa3e8d 100644
--- a/java/org/apache/catalina/valves/rewrite/Substitution.java
+++ b/java/org/apache/catalina/valves/rewrite/Substitution.java
@@ -143,7 +143,7 @@ public class Substitution {
 if (percentPos == -1 && dollarPos == -1 && backslashPos == -1) {
 // Static text
 StaticElement newElement = new StaticElement();
-newElement.value = sub.substring(pos, sub.length());
+newElement.value = sub.substring(pos);
 pos = sub.length();
 elements.add(newElement);
 } else if (isFirstPos(backslashPos, dollarPos, percentPos)) {
diff --git 
a/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java 
b/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
index 2236491..04a4fe4 100644
--- a/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
+++ b/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
@@ -238,7 +238,7 @@ public abstract class AbstractArchiveResourceSet extends 
AbstractResourceSet {
 
 if (path.startsWith(webAppMount)) {
 String pathInJar = getInternalPath() + path.substring(
-webAppMount.length(), path.length());
+webAppMount.length());
 // Always strip off the leading '/' to get the JAR path
 if (pathInJar.length() > 0 && pathInJar.charAt(0) == '/') {
 pathInJar = pathInJar.substring(1);
diff --git a/java/org/apache/jasper/compiler/JspUtil.java 
b/java/org/apache/jasper/compiler/JspUtil.java
index 6570983..447dc84 100644
--- a/java/org/apache/jasper/compiler/JspUtil.java
+++ b/java/org/apache/jasper/compiler/JspUtil.java
@@ -638,7 +638,7 @@ public class JspUtil {
 InputStream in = null;
 
 if (jar != null) {
-String jarEntryName = fname.substring(1, fname.length());
+String jarEntryName = fname.substring(1);
 in = jar.getInputStream(jarEntryName);
 } else {
 in = ctxt.getResourceAsStream(fname);
@@ -656,7 +656,7 @@ public class JspUtil {
 throws IOException {
 InputSource source;
 if (jar != null) {
-String jarEntryName = 

[tomcat] branch main updated: Code clean-up. Remove unnecessary code.

2021-05-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 029e975  Code clean-up. Remove unnecessary code.
029e975 is described below

commit 029e975c10d8052602c7b9fe1f4c2ec53b1d4cdc
Author: Mark Thomas 
AuthorDate: Thu May 27 08:22:28 2021 +0100

Code clean-up. Remove unnecessary code.
---
 java/jakarta/servlet/http/HttpUtils.java| 2 +-
 java/org/apache/catalina/ha/session/JvmRouteBinderValve.java| 3 +--
 java/org/apache/catalina/valves/rewrite/Substitution.java   | 2 +-
 .../apache/catalina/webresources/AbstractArchiveResourceSet.java| 2 +-
 java/org/apache/jasper/compiler/JspUtil.java| 4 ++--
 test/org/apache/tomcat/util/buf/TestUtf8.java   | 6 +++---
 webapps/examples/WEB-INF/classes/util/CookieFilter.java | 2 +-
 7 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/java/jakarta/servlet/http/HttpUtils.java 
b/java/jakarta/servlet/http/HttpUtils.java
index 279eb38..3903729 100644
--- a/java/jakarta/servlet/http/HttpUtils.java
+++ b/java/jakarta/servlet/http/HttpUtils.java
@@ -99,7 +99,7 @@ public class HttpUtils {
 throw new IllegalArgumentException();
 }
 String key = parseName(pair.substring(0, pos), sb);
-String val = parseName(pair.substring(pos+1, pair.length()), sb);
+String val = parseName(pair.substring(pos+1), sb);
 if (ht.containsKey(key)) {
 String oldVals[] = ht.get(key);
 valArray = Arrays.copyOf(oldVals, oldVals.length + 1);
diff --git a/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java 
b/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java
index 55201f6..c777d3e 100644
--- a/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java
+++ b/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java
@@ -273,8 +273,7 @@ public class JvmRouteBinderValve extends ValveBase 
implements ClusterValve {
 String requestJvmRoute = null;
 int index = sessionId.indexOf('.');
 if (index > 0) {
-requestJvmRoute = sessionId
-.substring(index + 1, sessionId.length());
+requestJvmRoute = sessionId.substring(index + 1);
 }
 if (requestJvmRoute != null && !requestJvmRoute.equals(localJvmRoute)) 
{
 if (log.isDebugEnabled()) {
diff --git a/java/org/apache/catalina/valves/rewrite/Substitution.java 
b/java/org/apache/catalina/valves/rewrite/Substitution.java
index 50d78db..2fa3e8d 100644
--- a/java/org/apache/catalina/valves/rewrite/Substitution.java
+++ b/java/org/apache/catalina/valves/rewrite/Substitution.java
@@ -143,7 +143,7 @@ public class Substitution {
 if (percentPos == -1 && dollarPos == -1 && backslashPos == -1) {
 // Static text
 StaticElement newElement = new StaticElement();
-newElement.value = sub.substring(pos, sub.length());
+newElement.value = sub.substring(pos);
 pos = sub.length();
 elements.add(newElement);
 } else if (isFirstPos(backslashPos, dollarPos, percentPos)) {
diff --git 
a/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java 
b/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
index 2236491..04a4fe4 100644
--- a/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
+++ b/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
@@ -238,7 +238,7 @@ public abstract class AbstractArchiveResourceSet extends 
AbstractResourceSet {
 
 if (path.startsWith(webAppMount)) {
 String pathInJar = getInternalPath() + path.substring(
-webAppMount.length(), path.length());
+webAppMount.length());
 // Always strip off the leading '/' to get the JAR path
 if (pathInJar.length() > 0 && pathInJar.charAt(0) == '/') {
 pathInJar = pathInJar.substring(1);
diff --git a/java/org/apache/jasper/compiler/JspUtil.java 
b/java/org/apache/jasper/compiler/JspUtil.java
index 6570983..447dc84 100644
--- a/java/org/apache/jasper/compiler/JspUtil.java
+++ b/java/org/apache/jasper/compiler/JspUtil.java
@@ -638,7 +638,7 @@ public class JspUtil {
 InputStream in = null;
 
 if (jar != null) {
-String jarEntryName = fname.substring(1, fname.length());
+String jarEntryName = fname.substring(1);
 in = jar.getInputStream(jarEntryName);
 } else {
 in = ctxt.getResourceAsStream(fname);
@@ -656,7 +656,7 @@ public class JspUtil {
 throws IOException {
 InputSource source;
 if (jar != null) {
-String jarEntryName = fnam