[tomcat] branch master updated: Security exception reading system property on JspRuntimeLibrary use

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

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


The following commit(s) were added to refs/heads/master by this push:
 new f913b0d  Security exception reading system property on 
JspRuntimeLibrary use
f913b0d is described below

commit f913b0d3452a1bccbfa11547ef929d380bfd5ef6
Author: remm 
AuthorDate: Thu Oct 8 09:09:36 2020 +0200

Security exception reading system property on JspRuntimeLibrary use

BZ 64794. Load the class more.
---
 java/org/apache/jasper/security/SecurityClassLoad.java | 5 +++--
 webapps/docs/changelog.xml | 8 
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/jasper/security/SecurityClassLoad.java 
b/java/org/apache/jasper/security/SecurityClassLoad.java
index 5240282..77a0d59 100644
--- a/java/org/apache/jasper/security/SecurityClassLoad.java
+++ b/java/org/apache/jasper/security/SecurityClassLoad.java
@@ -42,7 +42,8 @@ public final class SecurityClassLoad {
 loader.loadClass( basePackage + 
"runtime.JspFactoryImpl$PrivilegedGetPageContext");
 loader.loadClass( basePackage + 
"runtime.JspFactoryImpl$PrivilegedReleasePageContext");
 loader.loadClass( basePackage + "runtime.JspFragmentHelper");
-loader.loadClass( basePackage + "runtime.JspRuntimeLibrary");
+Class clazz = loader.loadClass( basePackage + 
"runtime.JspRuntimeLibrary");
+clazz.getConstructor().newInstance();
 loader.loadClass( basePackage + "runtime.PageContextImpl");
 loader.loadClass( basePackage + "runtime.ProtectedFunctionMapper");
 loader.loadClass( basePackage + 
"runtime.ServletResponseWrapperInclude");
@@ -52,7 +53,7 @@ public final class SecurityClassLoad {
 SecurityUtil.isPackageProtectionEnabled();
 
 loader.loadClass( basePackage + "servlet.JspServletWrapper");
-} catch (ClassNotFoundException ex) {
+} catch (Exception ex) {
 Log log = LogFactory.getLog(SecurityClassLoad.class);
 log.error(Localizer.getMessage("jsp.error.securityPreload"), ex);
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 1794c3f..043506d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -56,6 +56,14 @@
   
 
   
+  
+
+  
+64794: Security exception reading system property on
+JspRuntimeLibrary use. (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: Security exception reading system property on JspRuntimeLibrary use

2020-10-08 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 df7a2d2  Security exception reading system property on 
JspRuntimeLibrary use
df7a2d2 is described below

commit df7a2d2a399f8b7673983518cad89df2478dbef1
Author: remm 
AuthorDate: Thu Oct 8 09:09:36 2020 +0200

Security exception reading system property on JspRuntimeLibrary use

BZ 64794. Load the class more.
---
 java/org/apache/jasper/security/SecurityClassLoad.java | 5 +++--
 webapps/docs/changelog.xml | 8 
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/jasper/security/SecurityClassLoad.java 
b/java/org/apache/jasper/security/SecurityClassLoad.java
index 5240282..77a0d59 100644
--- a/java/org/apache/jasper/security/SecurityClassLoad.java
+++ b/java/org/apache/jasper/security/SecurityClassLoad.java
@@ -42,7 +42,8 @@ public final class SecurityClassLoad {
 loader.loadClass( basePackage + 
"runtime.JspFactoryImpl$PrivilegedGetPageContext");
 loader.loadClass( basePackage + 
"runtime.JspFactoryImpl$PrivilegedReleasePageContext");
 loader.loadClass( basePackage + "runtime.JspFragmentHelper");
-loader.loadClass( basePackage + "runtime.JspRuntimeLibrary");
+Class clazz = loader.loadClass( basePackage + 
"runtime.JspRuntimeLibrary");
+clazz.getConstructor().newInstance();
 loader.loadClass( basePackage + "runtime.PageContextImpl");
 loader.loadClass( basePackage + "runtime.ProtectedFunctionMapper");
 loader.loadClass( basePackage + 
"runtime.ServletResponseWrapperInclude");
@@ -52,7 +53,7 @@ public final class SecurityClassLoad {
 SecurityUtil.isPackageProtectionEnabled();
 
 loader.loadClass( basePackage + "servlet.JspServletWrapper");
-} catch (ClassNotFoundException ex) {
+} catch (Exception ex) {
 Log log = LogFactory.getLog(SecurityClassLoad.class);
 log.error(Localizer.getMessage("jsp.error.securityPreload"), ex);
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4175940..9ec9fca 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -56,6 +56,14 @@
   
 
   
+  
+
+  
+64794: Security exception reading system property on
+JspRuntimeLibrary use. (remm)
+  
+
+  
 
 
   


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



[Bug 64794] Missing PropertyPermission for "org.graalvm.nativeimage.imagecode"

2020-10-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64794

Remy Maucherat  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #2 from Remy Maucherat  ---
This will be in 10.0.0-M10 and 9.0.40.

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



buildbot success in on tomcat-9-trunk

2020-10-08 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-9-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-9-trunk/builds/486

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

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-9-commit' 
triggered this build
Build Source Stamp: [branch 9.0.x] df7a2d2a399f8b7673983518cad89df2478dbef1
Blamelist: remm 

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] branch master updated: Fix HTTP/2 window updates with zero padding. Found via CI tests

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 3e03cee  Fix HTTP/2 window updates with zero padding. Found via CI 
tests
3e03cee is described below

commit 3e03ceefd549684ba26b4af0e6cf738b2a1dd42e
Author: Mark Thomas 
AuthorDate: Thu Oct 8 14:20:53 2020 +0100

Fix HTTP/2 window updates with zero padding. Found via CI tests
---
 java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java |  5 +++--
 java/org/apache/coyote/http2/Http2UpgradeHandler.java  | 11 +--
 webapps/docs/changelog.xml |  9 +
 3 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
index defbb1c..b77fee6 100644
--- a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
@@ -229,14 +229,15 @@ public class Http2AsyncUpgradeHandler extends 
Http2UpgradeHandler {
 
 
 @Override
-void writeWindowUpdate(Stream stream, int increment, boolean 
applicationInitiated)
+void writeWindowUpdate(AbstractNonZeroStream stream, int increment, 
boolean applicationInitiated)
 throws IOException {
 // Build window update frame for stream 0
 byte[] frame = new byte[13];
 ByteUtil.setThreeBytes(frame, 0,  4);
 frame[3] = FrameType.WINDOW_UPDATE.getIdByte();
 ByteUtil.set31Bits(frame, 9, increment);
-if (stream.canWrite()) {
+// No need to send update from closed stream
+if  (stream instanceof Stream && ((Stream) stream).canWrite()) {
 // Change stream Id
 byte[] frame2 = new byte[13];
 ByteUtil.setThreeBytes(frame2, 0,  4);
diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 972a709..0307ece 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -802,7 +802,7 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
  * Needs to know if this was application initiated since that affects the
  * error handling.
  */
-void writeWindowUpdate(Stream stream, int increment, boolean 
applicationInitiated)
+void writeWindowUpdate(AbstractNonZeroStream stream, int increment, 
boolean applicationInitiated)
 throws IOException {
 synchronized (socketWrapper) {
 // Build window update frame for stream 0
@@ -811,7 +811,8 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 frame[3] = FrameType.WINDOW_UPDATE.getIdByte();
 ByteUtil.set31Bits(frame, 9, increment);
 socketWrapper.write(true, frame, 0, frame.length);
-if  (stream.canWrite()) {
+// No need to send update from closed stream
+if  (stream instanceof Stream && ((Stream) stream).canWrite()) {
 // Change stream Id and re-use
 ByteUtil.set31Bits(frame, 5, stream.getIdAsInt());
 try {
@@ -1488,10 +1489,8 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 public void swallowedPadding(int streamId, int paddingLength) throws
 ConnectionException, IOException {
 AbstractNonZeroStream abstractNonZeroStream = 
getStreamMayBeClosed(streamId, true);
-if (abstractNonZeroStream instanceof Stream) {
-// +1 is for the payload byte used to define the padding length
-writeWindowUpdate((Stream) abstractNonZeroStream, paddingLength + 
1, false);
-}
+// +1 is for the payload byte used to define the padding length
+writeWindowUpdate(abstractNonZeroStream, paddingLength + 1, false);
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 043506d..ec41058 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -56,6 +56,15 @@
   
 
   
+  
+
+  
+Refactor the HTTP/2 window update handling for padding in data frames 
to
+ensure that the connection window is correctly updated after a data
+frame with zero lngth padding is received. (markt)
+  
+
+  
   
 
   


-
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 HTTP/2 window updates with zero padding. Found via CI tests

2020-10-08 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 1e97ab2  Fix HTTP/2 window updates with zero padding. Found via CI 
tests
1e97ab2 is described below

commit 1e97ab20677f7295db2bdaad3f294b1d553208ae
Author: Mark Thomas 
AuthorDate: Thu Oct 8 14:20:53 2020 +0100

Fix HTTP/2 window updates with zero padding. Found via CI tests
---
 java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java |  5 +++--
 java/org/apache/coyote/http2/Http2UpgradeHandler.java  | 11 +--
 webapps/docs/changelog.xml |  9 +
 3 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
index 2068044..931de90 100644
--- a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
@@ -229,14 +229,15 @@ public class Http2AsyncUpgradeHandler extends 
Http2UpgradeHandler {
 
 
 @Override
-void writeWindowUpdate(Stream stream, int increment, boolean 
applicationInitiated)
+void writeWindowUpdate(AbstractNonZeroStream stream, int increment, 
boolean applicationInitiated)
 throws IOException {
 // Build window update frame for stream 0
 byte[] frame = new byte[13];
 ByteUtil.setThreeBytes(frame, 0,  4);
 frame[3] = FrameType.WINDOW_UPDATE.getIdByte();
 ByteUtil.set31Bits(frame, 9, increment);
-if (stream.canWrite()) {
+// No need to send update from closed stream
+if  (stream instanceof Stream && ((Stream) stream).canWrite()) {
 // Change stream Id
 byte[] frame2 = new byte[13];
 ByteUtil.setThreeBytes(frame2, 0,  4);
diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index a1002c1..79f2bad 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -802,7 +802,7 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
  * Needs to know if this was application initiated since that affects the
  * error handling.
  */
-void writeWindowUpdate(Stream stream, int increment, boolean 
applicationInitiated)
+void writeWindowUpdate(AbstractNonZeroStream stream, int increment, 
boolean applicationInitiated)
 throws IOException {
 synchronized (socketWrapper) {
 // Build window update frame for stream 0
@@ -811,7 +811,8 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 frame[3] = FrameType.WINDOW_UPDATE.getIdByte();
 ByteUtil.set31Bits(frame, 9, increment);
 socketWrapper.write(true, frame, 0, frame.length);
-if  (stream.canWrite()) {
+// No need to send update from closed stream
+if  (stream instanceof Stream && ((Stream) stream).canWrite()) {
 // Change stream Id and re-use
 ByteUtil.set31Bits(frame, 5, stream.getIdAsInt());
 try {
@@ -1488,10 +1489,8 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 public void swallowedPadding(int streamId, int paddingLength) throws
 ConnectionException, IOException {
 AbstractNonZeroStream abstractNonZeroStream = 
getStreamMayBeClosed(streamId, true);
-if (abstractNonZeroStream instanceof Stream) {
-// +1 is for the payload byte used to define the padding length
-writeWindowUpdate((Stream) abstractNonZeroStream, paddingLength + 
1, false);
-}
+// +1 is for the payload byte used to define the padding length
+writeWindowUpdate(abstractNonZeroStream, paddingLength + 1, false);
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 9ec9fca..07bdea9 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -56,6 +56,15 @@
   
 
   
+  
+
+  
+Refactor the HTTP/2 window update handling for padding in data frames 
to
+ensure that the connection window is correctly updated after a data
+frame with zero lngth padding is received. (markt)
+  
+
+  
   
 
   


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



[tomcat] branch 8.5.x updated: Fix HTTP/2 window updates with zero padding. Found via CI tests

2020-10-08 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 c656fbb  Fix HTTP/2 window updates with zero padding. Found via CI 
tests
c656fbb is described below

commit c656fbbc8817cf3dd7c09a90a27d39714dd718de
Author: Mark Thomas 
AuthorDate: Thu Oct 8 14:20:53 2020 +0100

Fix HTTP/2 window updates with zero padding. Found via CI tests
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 11 +--
 webapps/docs/changelog.xml|  9 +
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index d5d11e5..458b112 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -797,7 +797,7 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
  * Needs to know if this was application initiated since that affects the
  * error handling.
  */
-void writeWindowUpdate(Stream stream, int increment, boolean 
applicationInitiated)
+void writeWindowUpdate(AbstractNonZeroStream stream, int increment, 
boolean applicationInitiated)
 throws IOException {
 synchronized (socketWrapper) {
 // Build window update frame for stream 0
@@ -806,7 +806,8 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
 frame[3] = FrameType.WINDOW_UPDATE.getIdByte();
 ByteUtil.set31Bits(frame, 9, increment);
 socketWrapper.write(true, frame, 0, frame.length);
-if  (stream.canWrite()) {
+// No need to send update from closed stream
+if  (stream instanceof Stream && ((Stream) stream).canWrite()) {
 // Change stream Id and re-use
 ByteUtil.set31Bits(frame, 5, stream.getIdAsInt());
 try {
@@ -1595,10 +1596,8 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
 public void swallowedPadding(int streamId, int paddingLength) throws
 ConnectionException, IOException {
 AbstractNonZeroStream abstractNonZeroStream = 
getStreamMayBeClosed(streamId, true);
-if (abstractNonZeroStream instanceof Stream) {
-// +1 is for the payload byte used to define the padding length
-writeWindowUpdate((Stream) abstractNonZeroStream, paddingLength + 
1, false);
-}
+// +1 is for the payload byte used to define the padding length
+writeWindowUpdate(abstractNonZeroStream, paddingLength + 1, false);
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 49ef2e2..3012e9a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -59,6 +59,15 @@
   
 
   
+  
+
+  
+Refactor the HTTP/2 window update handling for padding in data frames 
to
+ensure that the connection window is correctly updated after a data
+frame with zero lngth padding is received. (markt)
+  
+
+  
 
 
   


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



[GitHub] [tomcat-jakartaee-migration] darmbrust opened a new issue #5: ability to ignore file extensions?

2020-10-08 Thread GitBox


darmbrust opened a new issue #5:
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/5


   I've been using this tool, to try out an entire stack with these changes, 
and we have one webapp which is a JRuby application.
   
   Using this tool on the war file produced by our JRuby build, results in a 
failure:
   
   Migrating Jar entry [WEB-INF/gems/gems/rubyzip-1.2.2/test/data/globTest/foo/]
   Migrating stream [WEB-INF/gems/gems/rubyzip-1.2.2/test/data/globTest/foo/]
   Migrating Jar entry 
[WEB-INF/gems/gems/rubyzip-1.2.2/test/data/globTest/foo.txt]
   Migrating stream [WEB-INF/gems/gems/rubyzip-1.2.2/test/data/globTest/foo.txt]
   Migrating Jar entry 
[WEB-INF/gems/gems/rubyzip-1.2.2/test/data/globTest/foo/bar/]
   Migrating stream 
[WEB-INF/gems/gems/rubyzip-1.2.2/test/data/globTest/foo/bar/]
   Migrating Jar entry 
[WEB-INF/gems/gems/rubyzip-1.2.2/test/data/globTest/foo/bar/baz/]
   Migrating stream 
[WEB-INF/gems/gems/rubyzip-1.2.2/test/data/globTest/foo/bar/baz/]
   Migrating Jar entry 
[WEB-INF/gems/gems/rubyzip-1.2.2/test/data/globTest/foo/bar/baz/foo.txt]
   Migrating stream 
[WEB-INF/gems/gems/rubyzip-1.2.2/test/data/globTest/foo/bar/baz/foo.txt]
   Migrating Jar entry 
[WEB-INF/gems/gems/rubyzip-1.2.2/test/data/globTest/food.txt]
   Migrating stream 
[WEB-INF/gems/gems/rubyzip-1.2.2/test/data/globTest/food.txt]
   Migrating Jar entry 
[WEB-INF/gems/gems/rubyzip-1.2.2/test/data/gpbit3stored.zip]
   Migrating archive 
[WEB-INF/gems/gems/rubyzip-1.2.2/test/data/gpbit3stored.zip]
   Error performing migration
   
   No additional details are given on the reason for the failure.
   Still looking into why the rubyzip gem has piles of test data in it... but 
that aside, it would be nice to tell this tool to ignore .txt and .zip files...



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-jakartaee-migration] darmbrust commented on issue #5: ability to ignore file extensions?

2020-10-08 Thread GitBox


darmbrust commented on issue #5:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/issues/5#issuecomment-705728238


   For reference, this is the zip file the tool is failing on:
   https://github.com/rubyzip/rubyzip/blob/master/test/data/gpbit3stored.zip
   
   From the context of the file its failing on, I'm guessing something isn't 
handling the general purpose bit flag properly when it is encountered:
   https://en.wikipedia.org/wiki/Zip_(file_format)#Local_file_header



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



Re: TCK status

2020-10-08 Thread Christopher Schultz
Mark,

On 10/3/20 14:39, Mark Thomas wrote:
> Hi all,
> 
> I mentioned TCK status during a couple of ApacheCon presentations.
> Having checked the current status I thought it would be worth sending a
> brief note to the list. More detail is on the wiki:
> https://cwiki.apache.org/confluence/display/TOMCAT/Jakarta+EE+TCKs
> 
> The short version is:
> 
> - EL: all tests pass
> - JSP: all tests pass (once the TCK regression is fixed)
> - WebSocket: all tests pass
> - Servlet: one failure (expected)
> 
> So, all good. No issues.
> 
> Mark
> 
> P.S. If you are wondering the servlet failure is because Tomcat ignores
> any suggested context path in web.xml and will ALWAYS derive the context
> path from the file name to avoid ambiguities and conflicts.

I can't for the life of me find a reference to how you "suggest" the
context path in web.xml. Is this using the appCxtRoot env-entry? I
thought that was vendor-specific...

-chris

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



Re: TCK status

2020-10-08 Thread Mark Thomas
On 08/10/2020 20:23, Christopher Schultz wrote:
> Mark,
> 
> On 10/3/20 14:39, Mark Thomas wrote:
>> Hi all,
>>
>> I mentioned TCK status during a couple of ApacheCon presentations.
>> Having checked the current status I thought it would be worth sending a
>> brief note to the list. More detail is on the wiki:
>> https://cwiki.apache.org/confluence/display/TOMCAT/Jakarta+EE+TCKs
>>
>> The short version is:
>>
>> - EL: all tests pass
>> - JSP: all tests pass (once the TCK regression is fixed)
>> - WebSocket: all tests pass
>> - Servlet: one failure (expected)
>>
>> So, all good. No issues.
>>
>> Mark
>>
>> P.S. If you are wondering the servlet failure is because Tomcat ignores
>> any suggested context path in web.xml and will ALWAYS derive the context
>> path from the file name to avoid ambiguities and conflicts.
> 
> I can't for the life of me find a reference to how you "suggest" the
> context path in web.xml. Is this using the appCxtRoot env-entry? I
> thought that was vendor-specific...

... in web.xml

It was (and still is) a bad idea. The supporters of the feature ignored
questions like:

- What to do if two web apps use the same value?
- What if a webapp is already deployed at that path?

The only concession I was able to extract was the "may be overridden by
container specific configuration". In Tomcat's case this is the name of
the WAR/DIR so we can always ignore this. Once I reached the point where
I/Tomcat could ignore it, I did.

Mark

-
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 (1e97ab2 -> 0de12f4)

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

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


from 1e97ab2  Fix HTTP/2 window updates with zero padding. Found via CI 
tests
 new 87e6865  Align with 10.0.x. No functional change.
 new 0de12f4  Align with 10.0.x. No functional change.

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


Summary of changes:
 java/org/apache/tomcat/buildutil/translate/Utils.java | 2 +-
 java/org/apache/tomcat/util/net/NioEndpoint.java  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)


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



[tomcat] 01/02: Align with 10.0.x. No functional change.

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

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

commit 87e686599bc1e034b0d7f393ef1b3ea701332a8b
Author: Mark Thomas 
AuthorDate: Thu Oct 8 19:33:50 2020 +0100

Align with 10.0.x. No functional change.
---
 java/org/apache/tomcat/buildutil/translate/Utils.java | 2 +-
 java/org/apache/tomcat/util/net/NioEndpoint.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/buildutil/translate/Utils.java 
b/java/org/apache/tomcat/buildutil/translate/Utils.java
index 5eb015f..63d3947 100644
--- a/java/org/apache/tomcat/buildutil/translate/Utils.java
+++ b/java/org/apache/tomcat/buildutil/translate/Utils.java
@@ -73,7 +73,7 @@ public class Utils {
 if (result.contains("[{0}]")) {
 result = FIX_SINGLE_QUOTE.matcher(result).replaceAll("''");
 }
-return result;
+return result.trim();
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index 9a8a0aa..7fa25e3 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -134,7 +134,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 public boolean getUseInheritedChannel() { return useInheritedChannel; }
 
 /**
- * Priority of the poller threads.
+ * Priority of the poller thread.
  */
 private int pollerThreadPriority = Thread.NORM_PRIORITY;
 public void setPollerThreadPriority(int pollerThreadPriority) { 
this.pollerThreadPriority = pollerThreadPriority; }


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



[tomcat] 02/02: Align with 10.0.x. No functional change.

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

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

commit 0de12f4fd6d0b0761a16a0997d313ceb212a1403
Author: Mark Thomas 
AuthorDate: Thu Oct 8 19:48:57 2020 +0100

Align with 10.0.x. No functional change.
---
 java/org/apache/tomcat/util/net/NioEndpoint.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index 7fa25e3..26486be 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -938,8 +938,8 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 try {
 for (SelectionKey key : selector.keys()) {
 keycount++;
+NioSocketWrapper socketWrapper = (NioSocketWrapper) 
key.attachment();
 try {
-NioSocketWrapper socketWrapper = (NioSocketWrapper) 
key.attachment();
 if (socketWrapper == null) {
 // We don't support any keys without attachments
 cancelledKey(key, null);
@@ -987,7 +987,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 }
 }
 } catch (CancelledKeyException ckx) {
-cancelledKey(key, (NioSocketWrapper) key.attachment());
+cancelledKey(key, socketWrapper);
 }
 }
 } catch (ConcurrentModificationException cme) {


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



[tomcat] 01/02: Align wiht 9.0.x. No funcitonal change.

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

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

commit 716142cf21ad64a2a9979c568fad4ec54c713b21
Author: Mark Thomas 
AuthorDate: Thu Oct 8 19:34:29 2020 +0100

Align wiht 9.0.x. No funcitonal change.
---
 .../buildutil/translate/BackportEnglish.java   |  2 +-
 .../apache/tomcat/buildutil/translate/Utils.java   |  2 +-
 java/org/apache/tomcat/util/net/NioEndpoint.java   | 67 --
 3 files changed, 40 insertions(+), 31 deletions(-)

diff --git a/java/org/apache/tomcat/buildutil/translate/BackportEnglish.java 
b/java/org/apache/tomcat/buildutil/translate/BackportEnglish.java
index fb43d84..9a0c7ae 100644
--- a/java/org/apache/tomcat/buildutil/translate/BackportEnglish.java
+++ b/java/org/apache/tomcat/buildutil/translate/BackportEnglish.java
@@ -33,7 +33,7 @@ public class BackportEnglish extends BackportBase {
 
 
 public static void main(String... args) throws IOException {
-// Exclude keys known to be different between 9.0.x and 8.5.x
+// Exclude keys known to be different between 8.5.x and 7.0.x
 
keysToExclude.add("java.org.apache.catalina.manager.zzz.htmlManagerServlet.deployPath");
 
keysToExclude.add("java.org.apache.catalina.mbeans.zzz.jmxRemoteLifecycleListener.deprecated");
 
keysToExclude.add("java.org.apache.catalina.session.zzz.managerBase.contextNull");
diff --git a/java/org/apache/tomcat/buildutil/translate/Utils.java 
b/java/org/apache/tomcat/buildutil/translate/Utils.java
index 5eb015f..63d3947 100644
--- a/java/org/apache/tomcat/buildutil/translate/Utils.java
+++ b/java/org/apache/tomcat/buildutil/translate/Utils.java
@@ -73,7 +73,7 @@ public class Utils {
 if (result.contains("[{0}]")) {
 result = FIX_SINGLE_QUOTE.matcher(result).replaceAll("''");
 }
-return result;
+return result.trim();
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index a70faef..32a5c4d 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -90,7 +90,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 private volatile ServerSocketChannel serverSock = null;
 
 /**
- *
+ * Stop latch used to wait for poller stop
  */
 private volatile CountDownLatch stopLatch = null;
 
@@ -150,8 +150,9 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 public int getPollerThreadCount() { return pollerThreadCount; }
 
 private long selectorTimeout = 1000;
-public void setSelectorTimeout(long timeout){ this.selectorTimeout = 
timeout;}
-public long getSelectorTimeout(){ return this.selectorTimeout; }
+public void setSelectorTimeout(long timeout) { this.selectorTimeout = 
timeout;}
+public long getSelectorTimeout() { return this.selectorTimeout; }
+
 /**
  * The socket poller.
  */
@@ -187,6 +188,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 
 
 // - Public Methods
+
 /**
  * Number of keep-alive sockets.
  *
@@ -248,6 +250,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 selectorPool.open();
 }
 
+
 /**
  * Start the NIO endpoint, creating acceptor, poller threads.
  */
@@ -266,7 +269,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 socketProperties.getBufferPool());
 
 // Create worker collection
-if ( getExecutor() == null ) {
+if (getExecutor() == null) {
 createExecutor();
 }
 
@@ -679,7 +682,9 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 
 private void addEvent(PollerEvent event) {
 events.offer(event);
-if ( wakeupCounter.incrementAndGet() == 0 ) selector.wakeup();
+if (wakeupCounter.incrementAndGet() == 0) {
+selector.wakeup();
+}
 }
 
 /**
@@ -694,8 +699,11 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
  */
 public void add(final NioChannel socket, final int interestOps) {
 PollerEvent r = eventCache.pop();
-if ( r==null) r = new PollerEvent(socket,null,interestOps);
-else r.reset(socket,null,interestOps);
+if (r == null) {
+r = new PollerEvent(socket,null,interestOps);
+} else {
+r.reset(socket,null,interestOps);
+}
 addEvent(r);
 if (close) {
 NioEndpoint.NioSocketWrapper ka = 
(NioEndpoint.NioSocketWrapper)socket.getAttachment();
@@ -823,8 +831,8 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 if (!close) {
 hasEvents = events();

[tomcat] 02/02: Align with 9.0.x. No funcitonal change.

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

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

commit 9219962dd4a37cc256a99363734abb7f43e47c27
Author: Mark Thomas 
AuthorDate: Thu Oct 8 19:49:26 2020 +0100

Align with 9.0.x. No funcitonal change.
---
 java/org/apache/tomcat/util/net/NioEndpoint.java | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index 32a5c4d..9b8c281 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -1032,14 +1032,14 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 }
 }
 
-protected void unreg(SelectionKey sk, NioSocketWrapper attachment, int 
readyOps) {
-//this is a must, so that we don't have multiple threads messing 
with the socket
-reg(sk,attachment,sk.interestOps()& (~readyOps));
+protected void unreg(SelectionKey sk, NioSocketWrapper socketWrapper, 
int readyOps) {
+// This is a must, so that we don't have multiple threads messing 
with the socket
+reg(sk, socketWrapper, sk.interestOps() & (~readyOps));
 }
 
-protected void reg(SelectionKey sk, NioSocketWrapper attachment, int 
intops) {
+protected void reg(SelectionKey sk, NioSocketWrapper socketWrapper, 
int intops) {
 sk.interestOps(intops);
-attachment.interestOps(intops);
+socketWrapper.interestOps(intops);
 }
 
 protected void timeout(int keyCount, boolean hasEvents) {
@@ -1132,9 +1132,9 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 socketBufferHandler = channel.getBufHandler();
 }
 
-public Poller getPoller() { return poller;}
+public Poller getPoller() { return poller; }
 public void setPoller(Poller poller){this.poller = poller;}
-public int interestOps() { return interestOps;}
+public int interestOps() { return interestOps; }
 public int interestOps(int ops) { this.interestOps  = ops; return ops; 
}
 public CountDownLatch getReadLatch() { return readLatch; }
 public CountDownLatch getWriteLatch() { return writeLatch; }
@@ -1165,7 +1165,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 public void awaitWriteLatch(long timeout, TimeUnit unit) throws 
InterruptedException { awaitLatch(writeLatch,timeout,unit);}
 
 public void setSendfileData(SendfileData sf) { this.sendfileData = sf;}
-public SendfileData getSendfileData() { return this.sendfileData;}
+public SendfileData getSendfileData() { return this.sendfileData; }
 
 public void updateLastWrite() { lastWrite = 
System.currentTimeMillis(); }
 public long getLastWrite() { return lastWrite; }
@@ -1664,6 +1664,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 }
 
 // --- SendfileData Inner Class
+
 /**
  * SendfileData class.
  */


-
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 (c656fbb -> 9219962)

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

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


from c656fbb  Fix HTTP/2 window updates with zero padding. Found via CI 
tests
 new 716142c  Align wiht 9.0.x. No funcitonal change.
 new 9219962  Align with 9.0.x. No funcitonal change.

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:
 .../buildutil/translate/BackportEnglish.java   |  2 +-
 .../apache/tomcat/buildutil/translate/Utils.java   |  2 +-
 java/org/apache/tomcat/util/net/NioEndpoint.java   | 84 --
 3 files changed, 49 insertions(+), 39 deletions(-)


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



[tomcat] 02/02: Align with 9.0.x. No funcitonal change.

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

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

commit 9219962dd4a37cc256a99363734abb7f43e47c27
Author: Mark Thomas 
AuthorDate: Thu Oct 8 19:49:26 2020 +0100

Align with 9.0.x. No funcitonal change.
---
 java/org/apache/tomcat/util/net/NioEndpoint.java | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index 32a5c4d..9b8c281 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -1032,14 +1032,14 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 }
 }
 
-protected void unreg(SelectionKey sk, NioSocketWrapper attachment, int 
readyOps) {
-//this is a must, so that we don't have multiple threads messing 
with the socket
-reg(sk,attachment,sk.interestOps()& (~readyOps));
+protected void unreg(SelectionKey sk, NioSocketWrapper socketWrapper, 
int readyOps) {
+// This is a must, so that we don't have multiple threads messing 
with the socket
+reg(sk, socketWrapper, sk.interestOps() & (~readyOps));
 }
 
-protected void reg(SelectionKey sk, NioSocketWrapper attachment, int 
intops) {
+protected void reg(SelectionKey sk, NioSocketWrapper socketWrapper, 
int intops) {
 sk.interestOps(intops);
-attachment.interestOps(intops);
+socketWrapper.interestOps(intops);
 }
 
 protected void timeout(int keyCount, boolean hasEvents) {
@@ -1132,9 +1132,9 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 socketBufferHandler = channel.getBufHandler();
 }
 
-public Poller getPoller() { return poller;}
+public Poller getPoller() { return poller; }
 public void setPoller(Poller poller){this.poller = poller;}
-public int interestOps() { return interestOps;}
+public int interestOps() { return interestOps; }
 public int interestOps(int ops) { this.interestOps  = ops; return ops; 
}
 public CountDownLatch getReadLatch() { return readLatch; }
 public CountDownLatch getWriteLatch() { return writeLatch; }
@@ -1165,7 +1165,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 public void awaitWriteLatch(long timeout, TimeUnit unit) throws 
InterruptedException { awaitLatch(writeLatch,timeout,unit);}
 
 public void setSendfileData(SendfileData sf) { this.sendfileData = sf;}
-public SendfileData getSendfileData() { return this.sendfileData;}
+public SendfileData getSendfileData() { return this.sendfileData; }
 
 public void updateLastWrite() { lastWrite = 
System.currentTimeMillis(); }
 public long getLastWrite() { return lastWrite; }
@@ -1664,6 +1664,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 }
 
 // --- SendfileData Inner Class
+
 /**
  * SendfileData class.
  */


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



[tomcat] 01/02: Align with 10.0.x. No functional change.

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

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

commit 87e686599bc1e034b0d7f393ef1b3ea701332a8b
Author: Mark Thomas 
AuthorDate: Thu Oct 8 19:33:50 2020 +0100

Align with 10.0.x. No functional change.
---
 java/org/apache/tomcat/buildutil/translate/Utils.java | 2 +-
 java/org/apache/tomcat/util/net/NioEndpoint.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/buildutil/translate/Utils.java 
b/java/org/apache/tomcat/buildutil/translate/Utils.java
index 5eb015f..63d3947 100644
--- a/java/org/apache/tomcat/buildutil/translate/Utils.java
+++ b/java/org/apache/tomcat/buildutil/translate/Utils.java
@@ -73,7 +73,7 @@ public class Utils {
 if (result.contains("[{0}]")) {
 result = FIX_SINGLE_QUOTE.matcher(result).replaceAll("''");
 }
-return result;
+return result.trim();
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index 9a8a0aa..7fa25e3 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -134,7 +134,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 public boolean getUseInheritedChannel() { return useInheritedChannel; }
 
 /**
- * Priority of the poller threads.
+ * Priority of the poller thread.
  */
 private int pollerThreadPriority = Thread.NORM_PRIORITY;
 public void setPollerThreadPriority(int pollerThreadPriority) { 
this.pollerThreadPriority = pollerThreadPriority; }


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



[tomcat] 01/02: Align wiht 9.0.x. No funcitonal change.

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

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

commit 716142cf21ad64a2a9979c568fad4ec54c713b21
Author: Mark Thomas 
AuthorDate: Thu Oct 8 19:34:29 2020 +0100

Align wiht 9.0.x. No funcitonal change.
---
 .../buildutil/translate/BackportEnglish.java   |  2 +-
 .../apache/tomcat/buildutil/translate/Utils.java   |  2 +-
 java/org/apache/tomcat/util/net/NioEndpoint.java   | 67 --
 3 files changed, 40 insertions(+), 31 deletions(-)

diff --git a/java/org/apache/tomcat/buildutil/translate/BackportEnglish.java 
b/java/org/apache/tomcat/buildutil/translate/BackportEnglish.java
index fb43d84..9a0c7ae 100644
--- a/java/org/apache/tomcat/buildutil/translate/BackportEnglish.java
+++ b/java/org/apache/tomcat/buildutil/translate/BackportEnglish.java
@@ -33,7 +33,7 @@ public class BackportEnglish extends BackportBase {
 
 
 public static void main(String... args) throws IOException {
-// Exclude keys known to be different between 9.0.x and 8.5.x
+// Exclude keys known to be different between 8.5.x and 7.0.x
 
keysToExclude.add("java.org.apache.catalina.manager.zzz.htmlManagerServlet.deployPath");
 
keysToExclude.add("java.org.apache.catalina.mbeans.zzz.jmxRemoteLifecycleListener.deprecated");
 
keysToExclude.add("java.org.apache.catalina.session.zzz.managerBase.contextNull");
diff --git a/java/org/apache/tomcat/buildutil/translate/Utils.java 
b/java/org/apache/tomcat/buildutil/translate/Utils.java
index 5eb015f..63d3947 100644
--- a/java/org/apache/tomcat/buildutil/translate/Utils.java
+++ b/java/org/apache/tomcat/buildutil/translate/Utils.java
@@ -73,7 +73,7 @@ public class Utils {
 if (result.contains("[{0}]")) {
 result = FIX_SINGLE_QUOTE.matcher(result).replaceAll("''");
 }
-return result;
+return result.trim();
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index a70faef..32a5c4d 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -90,7 +90,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 private volatile ServerSocketChannel serverSock = null;
 
 /**
- *
+ * Stop latch used to wait for poller stop
  */
 private volatile CountDownLatch stopLatch = null;
 
@@ -150,8 +150,9 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 public int getPollerThreadCount() { return pollerThreadCount; }
 
 private long selectorTimeout = 1000;
-public void setSelectorTimeout(long timeout){ this.selectorTimeout = 
timeout;}
-public long getSelectorTimeout(){ return this.selectorTimeout; }
+public void setSelectorTimeout(long timeout) { this.selectorTimeout = 
timeout;}
+public long getSelectorTimeout() { return this.selectorTimeout; }
+
 /**
  * The socket poller.
  */
@@ -187,6 +188,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 
 
 // - Public Methods
+
 /**
  * Number of keep-alive sockets.
  *
@@ -248,6 +250,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 selectorPool.open();
 }
 
+
 /**
  * Start the NIO endpoint, creating acceptor, poller threads.
  */
@@ -266,7 +269,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 socketProperties.getBufferPool());
 
 // Create worker collection
-if ( getExecutor() == null ) {
+if (getExecutor() == null) {
 createExecutor();
 }
 
@@ -679,7 +682,9 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 
 private void addEvent(PollerEvent event) {
 events.offer(event);
-if ( wakeupCounter.incrementAndGet() == 0 ) selector.wakeup();
+if (wakeupCounter.incrementAndGet() == 0) {
+selector.wakeup();
+}
 }
 
 /**
@@ -694,8 +699,11 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
  */
 public void add(final NioChannel socket, final int interestOps) {
 PollerEvent r = eventCache.pop();
-if ( r==null) r = new PollerEvent(socket,null,interestOps);
-else r.reset(socket,null,interestOps);
+if (r == null) {
+r = new PollerEvent(socket,null,interestOps);
+} else {
+r.reset(socket,null,interestOps);
+}
 addEvent(r);
 if (close) {
 NioEndpoint.NioSocketWrapper ka = 
(NioEndpoint.NioSocketWrapper)socket.getAttachment();
@@ -823,8 +831,8 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 if (!close) {
 hasEvents = events();

[tomcat] branch 8.5.x updated (c656fbb -> 9219962)

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

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


from c656fbb  Fix HTTP/2 window updates with zero padding. Found via CI 
tests
 new 716142c  Align wiht 9.0.x. No funcitonal change.
 new 9219962  Align with 9.0.x. No funcitonal change.

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:
 .../buildutil/translate/BackportEnglish.java   |  2 +-
 .../apache/tomcat/buildutil/translate/Utils.java   |  2 +-
 java/org/apache/tomcat/util/net/NioEndpoint.java   | 84 --
 3 files changed, 49 insertions(+), 39 deletions(-)


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



[tomcat] branch 9.0.x updated (1e97ab2 -> 0de12f4)

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

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


from 1e97ab2  Fix HTTP/2 window updates with zero padding. Found via CI 
tests
 new 87e6865  Align with 10.0.x. No functional change.
 new 0de12f4  Align with 10.0.x. No functional change.

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


Summary of changes:
 java/org/apache/tomcat/buildutil/translate/Utils.java | 2 +-
 java/org/apache/tomcat/util/net/NioEndpoint.java  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)


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



[tomcat] 02/02: Align with 10.0.x. No functional change.

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

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

commit 0de12f4fd6d0b0761a16a0997d313ceb212a1403
Author: Mark Thomas 
AuthorDate: Thu Oct 8 19:48:57 2020 +0100

Align with 10.0.x. No functional change.
---
 java/org/apache/tomcat/util/net/NioEndpoint.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index 7fa25e3..26486be 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -938,8 +938,8 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 try {
 for (SelectionKey key : selector.keys()) {
 keycount++;
+NioSocketWrapper socketWrapper = (NioSocketWrapper) 
key.attachment();
 try {
-NioSocketWrapper socketWrapper = (NioSocketWrapper) 
key.attachment();
 if (socketWrapper == null) {
 // We don't support any keys without attachments
 cancelledKey(key, null);
@@ -987,7 +987,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 }
 }
 } catch (CancelledKeyException ckx) {
-cancelledKey(key, (NioSocketWrapper) key.attachment());
+cancelledKey(key, socketWrapper);
 }
 }
 } catch (ConcurrentModificationException cme) {


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



[GitHub] [tomcat] willmeck opened a new pull request #369: UDecoder does not properly convert when EncodedSolidusHandling is PASS_THROUGH and non-solidus encoded characters are present before the soli

2020-10-08 Thread GitBox


willmeck opened a new pull request #369:
URL: https://github.com/apache/tomcat/pull/369


   https://github.com/willmeck/tomcat-test-app - small test project showcasing 
the issue and fix
   
   When EncodedSolidusHandling is PASS_THROUGH, and other non-solidus encoded 
characters, such as encoded '+' (%2B) are present, the resultant string is 
incorrect. 
   Consider the string `abc%2Bde%2Ffg` 
   With PASS_THROUGH, it is expected that this would decode to `abc+de%2Ffg`
   However, looking at the UDecoder `convert()` code, this is what happens:
   
   buff contains `abc%2Bde%2Ffg`
   
   1. set idx to the first % character, `idx = 3`
   2. enter loop, setting j equal to idx, `idx=3` `j=3`
   3. buff[j] is `%` so enter else condition
   4. `j+=2` so `j=5 idx=3`
   5. set `res` equal to the char which is made up by j, j+1, and j+2
   6. res is not a `/`, so set buff[idx] = res (res is `+`) 
   
   buff now contains `abc+2Bde%2Ffg` and `j=5 idx=3`
   
   1. loop again so now `j=6 idx=4`
   2. buff[j] is `d`, so set buff[idx] = buff[j]
   3. loop again so now `j=7 idx=5'
   4. buff[j] is `e` so set buff[idx] = buff[j]
   
   buff now contains `abc+dede%2Ffg`
   
   1. loop again so now `j=8 idx=6`
   2. buff[j] is `%` so enter else condition
   3. `j+=2` so `j=10 idx=6`
   4. set `res` equal to the char which is made up by j, j+1, and j+2
   5. res is `/` so enter switch and go to case PASS_THROUGH
   6. `idx+=2` so `j=10 idx=8` (Note that at no point do you copy any chars 
from j to idx)
   
   buff now still contains `abc+dede%2Ffg`
   
   1. loop again so now `j=11 idx=9`
   2. buff[j] is `f` so set buff[idx] = buff[j]
   3. loop again so now `j=12 idx=10`
   4. buff[j] is `g` so set buff[idx] = buff[j]
   5. exit loop because reached length, adding 1 to idx, so `idx=11`
   6. set end at idx
   
   buff now contains `abc+dede%fg`
   
   The passthrough case statement expects j and idx to be equal, and that is 
not always the case, so we must explicitly copy those bytes. 



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