svn commit: r51246 - /release/tomcat/tomcat-10/v10.0.12/

2021-12-07 Thread markt
Author: markt
Date: Wed Dec  8 07:39:49 2021
New Revision: 51246

Log:
Remove 10.0.12 from mirrors

Removed:
release/tomcat/tomcat-10/v10.0.12/


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



svn commit: r51245 - /dev/tomcat/tomcat-10/v10.0.14/ /release/tomcat/tomcat-10/v10.0.14/

2021-12-07 Thread markt
Author: markt
Date: Wed Dec  8 07:38:38 2021
New Revision: 51245

Log:
Release Apache Tomcat 10.0.14

Added:
release/tomcat/tomcat-10/v10.0.14/
  - copied from r51244, dev/tomcat/tomcat-10/v10.0.14/
Removed:
dev/tomcat/tomcat-10/v10.0.14/


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



svn commit: r51244 - /dev/tomcat/tomcat-10/v10.1.0-M8/ /release/tomcat/tomcat-10/v10.1.0-M8/

2021-12-07 Thread markt
Author: markt
Date: Wed Dec  8 07:37:34 2021
New Revision: 51244

Log:
Release Apache Tomcat 10.1.0-M8

Added:
release/tomcat/tomcat-10/v10.1.0-M8/
  - copied from r51243, dev/tomcat/tomcat-10/v10.1.0-M8/
Removed:
dev/tomcat/tomcat-10/v10.1.0-M8/


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



[VOTE][RESULT] Release Apache Tomcat 10.0.14

2021-12-07 Thread Mark Thomas

The following votes were cast:

Binding:
+1: remm, markt, mgrigorov

The vote therefore passes.

Thanks to everyone who contributed to this release.

Mark

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



[VOTE][RESULT] Release Apache Tomcat 10.1.0-M8

2021-12-07 Thread Mark Thomas

The following votes were cast:

Binding:
+1: remm, markt, csutherl, mgrigorov

No other votes were cast.

The vote therefore passes.

Thanks to everyone who contributed to this release.

Mark

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



[Bug 57129] Regression. Load WEB-INF/lib jarfiles in alphabetical order

2021-12-07 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=57129

--- Comment #48 from Christopher Schultz  ---
This bug report has been RESOLVED WONTFIX.

Please don't use Bugzilla to conduct a flame war. If you want to discuss this
(again), please raise the issue on the users' or developers' mailing list.

-- 
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] ChristopherSchultz commented on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


ChristopherSchultz commented on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-988253403


   @Mikhail2048 Your patch also doesn't even compile, so it wouldn't have been 
accepted, anyway.


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

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

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



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



[Bug 65571] ClientAbortException in Tomcat 9.0.50 and 9.0.52

2021-12-07 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65571

--- Comment #5 from sutharvis...@gmail.com ---
I'm still working on reproducing this error. It's very important for us to
reproduce and report it to you.

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



[tomcat] branch 8.5.x updated: Fix typo

2021-12-07 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 1363865  Fix typo
1363865 is described below

commit 136386552b51690b92032b8b76be2070d3f1fba6
Author: Mark Thomas 
AuthorDate: Tue Dec 7 14:10:18 2021 +

Fix typo
---
 webapps/docs/config/http.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index c18b2b9..df8f74f 100644
--- a/webapps/docs/config/http.xml
+++ b/webapps/docs/config/http.xml
@@ -176,7 +176,7 @@
 
   The maximum size in bytes of the request body which will be
   saved/buffered by the container during FORM or CLIENT-CERT authentication
-  or during HTTP/1.1 upgarde. For both types of authentication, the request
+  or during HTTP/1.1 upgrade. For both types of authentication, the request
   body will be saved/buffered before the user is authenticated. For
   CLIENT-CERT authentication, the request body is buffered for the duration
   of the SSL handshake and the buffer emptied when the request is 
processed.

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



[tomcat] branch 9.0.x updated: Fix typo

2021-12-07 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 a7823f3  Fix typo
a7823f3 is described below

commit a7823f38c17b1df4a41d306f72da7f8f1b6772f9
Author: Mark Thomas 
AuthorDate: Tue Dec 7 14:10:18 2021 +

Fix typo
---
 webapps/docs/config/http.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index 9e2a751..ccac9cb 100644
--- a/webapps/docs/config/http.xml
+++ b/webapps/docs/config/http.xml
@@ -176,7 +176,7 @@
 
   The maximum size in bytes of the request body which will be
   saved/buffered by the container during FORM or CLIENT-CERT authentication
-  or during HTTP/1.1 upgarde. For both types of authentication, the request
+  or during HTTP/1.1 upgrade. For both types of authentication, the request
   body will be saved/buffered before the user is authenticated. For
   CLIENT-CERT authentication, the request body is buffered for the duration
   of the SSL handshake and the buffer emptied when the request is 
processed.

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

2021-12-07 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 2565de4  Fix typo
2565de4 is described below

commit 2565de4b01643277ef032f30dab8ef311bfa085b
Author: Mark Thomas 
AuthorDate: Tue Dec 7 14:10:18 2021 +

Fix typo
---
 webapps/docs/config/http.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index 5f3f4ec..30d34f2 100644
--- a/webapps/docs/config/http.xml
+++ b/webapps/docs/config/http.xml
@@ -190,7 +190,7 @@
 
   The maximum size in bytes of the request body which will be
   saved/buffered by the container during FORM or CLIENT-CERT authentication
-  or during HTTP/1.1 upgarde. For both types of authentication, the request
+  or during HTTP/1.1 upgrade. For both types of authentication, the request
   body will be saved/buffered before the user is authenticated. For
   CLIENT-CERT authentication, the request body is buffered for the duration
   of the SSL handshake and the buffer emptied when the request is 
processed.

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



[tomcat] branch main updated: Fix typo

2021-12-07 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 54586a1  Fix typo
54586a1 is described below

commit 54586a129506d41f4c3d6000d20d22ee67d30289
Author: Mark Thomas 
AuthorDate: Tue Dec 7 14:10:18 2021 +

Fix typo
---
 webapps/docs/config/http.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index 6b2fa5f..42afdf1 100644
--- a/webapps/docs/config/http.xml
+++ b/webapps/docs/config/http.xml
@@ -187,7 +187,7 @@
 
   The maximum size in bytes of the request body which will be
   saved/buffered by the container during FORM or CLIENT-CERT authentication
-  or during HTTP/1.1 upgarde. For both types of authentication, the request
+  or during HTTP/1.1 upgrade. For both types of authentication, the request
   body will be saved/buffered before the user is authenticated. For
   CLIENT-CERT authentication, the request body is buffered for the duration
   of the SSL handshake and the buffer emptied when the request is 
processed.

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



Re: BuildBot 2 - builds failing due to Linux OOM task management

2021-12-07 Thread Konstantin Kolinko
вт, 7 дек. 2021 г. в 16:22, Mark Thomas :
>
> Hi all,
>
> I've been investigating some recent build failures and it appears that
> some builds are failing because Linux is closing tasks because of memory
> pressure.
>
> My proposed solution is based on the following facts / observations:
>
> - The test node we are using has 4 cores and 16GB of RAM
>
> - The unit tests are currently configured to run with 6 threads
>
> - The test node is currently configured to run two tests concurrently
>
> - In local testing test thread count == core count gave the best
>performance
>
> - In local testing increasing / decreasing test threads by 10% had a
>marginal impact on test duration
>
>
> My proposed solution is therefore:
>
> - reduce test thread count from 6 to 4
>
> - investigate whether we can reduce the concurrent tests from 2 to 1

I wonder if there is some consistency about when that happens.
(What tests are being executed, or at least time from launch.)

I mean if there are tests that require a noticeable amount of memory.

I have encountered such a test once,
https://bz.apache.org/bugzilla/show_bug.cgi?id=65177
org.apache.tomcat.util.net.TestSsl

IIRC, a fix reduced memory requirements for that test from 256Mb down
to 144Mb (128 + 16) of byte arrays.

Though in such a case I would expect an OutOfMemoryError in java. I
think Linux OOM killer can be active for outside reasons that are out
of our control.

Also it looks like several builds run in parallel.

Tomcat 10.1.x
https://ci2.apache.org/#/builders/44
Worker bb2_worker2_ubuntu.
A build started at 03:28 PM (visible if I hover mouse over "started
at" time for build 113) and was running for an hour and 8 minutes
(visible if I hover over build number).

Tomcat 10.0.x
https://ci2.apache.org/#/builders/43
Worker bb2_worker2_ubuntu
A build started at 03:46 PM and is currently running (for more than an hour).

Tomcat 9
https://ci2.apache.org/#/builders/37
Worker bb2_worker2_ubuntu
A build started at 04:37 PM and is currently running.

Even though they did not start at the same time, it looks like they
overlap. I saw both 10.0.x and 9 being tested at the same time.
(10.0.x has finished a few seconds ago).

Best regards,
Konstantin Kolinko

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



Re: BuildBot 2 - builds failing due to Linux OOM task management

2021-12-07 Thread Mark Thomas

On 07/12/2021 13:22, Mark Thomas wrote:

Hi all,

I've been investigating some recent build failures and it appears that 
some builds are failing because Linux is closing tasks because of memory 
pressure.


My proposed solution is based on the following facts / observations:

- The test node we are using has 4 cores and 16GB of RAM

- The unit tests are currently configured to run with 6 threads

- The test node is currently configured to run two tests concurrently

- In local testing test thread count == core count gave the best
   performance

- In local testing increasing / decreasing test threads by 10% had a
   marginal impact on test duration


My proposed solution is therefore:

- reduce test thread count from 6 to 4

- investigate whether we can reduce the concurrent tests from 2 to 1


We can and I have.

We'll have to wait for the current tests to finish before the changes 
take effect.


Mark

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



BuildBot 2 - builds failing due to Linux OOM task management

2021-12-07 Thread Mark Thomas

Hi all,

I've been investigating some recent build failures and it appears that 
some builds are failing because Linux is closing tasks because of memory 
pressure.


My proposed solution is based on the following facts / observations:

- The test node we are using has 4 cores and 16GB of RAM

- The unit tests are currently configured to run with 6 threads

- The test node is currently configured to run two tests concurrently

- In local testing test thread count == core count gave the best
  performance

- In local testing increasing / decreasing test threads by 10% had a
  marginal impact on test duration


My proposed solution is therefore:

- reduce test thread count from 6 to 4

- investigate whether we can reduce the concurrent tests from 2 to 1

Mark

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



[Bug 65726] NullPointerException while reading request input with H2C upgraded exchanges

2021-12-07 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65726

Mark Thomas  changed:

   What|Removed |Added

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

--- Comment #2 from Mark Thomas  ---
Fixed in:
- 10.1.x for 10.1.0-M9 onwards
- 10.0.x for 10.0.15 onwards
- 9.0.x for 9.0.57 onwards
- 8.5.x for 8.5.74 onwards

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



[tomcat] 02/02: Fix BZ 65726 - handle HTTP/1.1 upgrade with request body

2021-12-07 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

commit f4c12fcaae02b947c8b46384af284bde8cec5489
Author: Mark Thomas 
AuthorDate: Mon Dec 6 23:15:08 2021 +

Fix BZ 65726 - handle HTTP/1.1 upgrade with request body

https://bz.apache.org/bugzilla/show_bug.cgi?id=65726
---
 java/org/apache/coyote/http11/Http11Processor.java | 116 +++--
 .../upgrade/UpgradeApplicationBufferHandler.java   |  45 
 java/org/apache/coyote/http2/Stream.java   |   2 +-
 test/org/apache/coyote/http2/Http2TestBase.java|  27 +
 .../coyote/http2/TestHttp2UpgradeHandler.java  |  80 ++
 webapps/docs/changelog.xml |   5 +
 webapps/docs/config/http.xml   |  24 +++--
 webapps/docs/security-howto.xml|   8 +-
 8 files changed, 258 insertions(+), 49 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 1886f22..7bcdec6 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -46,6 +46,7 @@ import 
org.apache.coyote.http11.filters.SavedRequestInputFilter;
 import org.apache.coyote.http11.filters.VoidInputFilter;
 import org.apache.coyote.http11.filters.VoidOutputFilter;
 import org.apache.coyote.http11.upgrade.InternalHttpUpgradeHandler;
+import org.apache.coyote.http11.upgrade.UpgradeApplicationBufferHandler;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
@@ -57,6 +58,7 @@ import org.apache.tomcat.util.http.parser.HttpParser;
 import org.apache.tomcat.util.http.parser.TokenList;
 import org.apache.tomcat.util.log.UserDataHelper;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
+import org.apache.tomcat.util.net.ApplicationBufferHandler;
 import org.apache.tomcat.util.net.SSLSupport;
 import org.apache.tomcat.util.net.SendfileDataBase;
 import org.apache.tomcat.util.net.SendfileKeepAliveState;
@@ -335,18 +337,33 @@ public class Http11Processor extends AbstractProcessor {
 UpgradeProtocol upgradeProtocol = 
protocol.getUpgradeProtocol(requestedProtocol);
 if (upgradeProtocol != null) {
 if (upgradeProtocol.accept(request)) {
-
response.setStatus(HttpServletResponse.SC_SWITCHING_PROTOCOLS);
-response.setHeader("Connection", "Upgrade");
-response.setHeader("Upgrade", requestedProtocol);
-action(ActionCode.CLOSE,  null);
-getAdapter().log(request, response, 0);
-
-InternalHttpUpgradeHandler upgradeHandler =
-upgradeProtocol.getInternalUpgradeHandler(
-socketWrapper, getAdapter(), 
cloneRequest(request));
-UpgradeToken upgradeToken = new 
UpgradeToken(upgradeHandler, null, null, requestedProtocol);
-action(ActionCode.UPGRADE, upgradeToken);
-return SocketState.UPGRADING;
+// Create clone of request for upgraded protocol
+Request upgradeRequest = null;
+try {
+upgradeRequest = cloneRequest(request);
+} catch (ByteChunk.BufferOverflowException ioe) {
+
response.setStatus(HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE);
+setErrorState(ErrorState.CLOSE_CLEAN, null);
+} catch (IOException ioe) {
+
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+setErrorState(ErrorState.CLOSE_CLEAN, ioe);
+}
+
+if (upgradeRequest != null) {
+// Complete the HTTP/1.1 upgrade process
+
response.setStatus(HttpServletResponse.SC_SWITCHING_PROTOCOLS);
+response.setHeader("Connection", "Upgrade");
+response.setHeader("Upgrade", requestedProtocol);
+action(ActionCode.CLOSE,  null);
+getAdapter().log(request, response, 0);
+
+// Continue processing using new protocol
+InternalHttpUpgradeHandler upgradeHandler =
+
upgradeProtocol.getInternalUpgradeHandler(socketWrapper, getAdapter(), 
upgradeRequest);
+UpgradeToken upgradeToken = new 
UpgradeToken(upgradeHandler, null, null, requestedProtocol);
+

[tomcat] 02/02: Fix BZ 65726 - handle HTTP/1.1 upgrade with request body

2021-12-07 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 9771286749407ce86c7c9783d2567edb0c660098
Author: Mark Thomas 
AuthorDate: Mon Dec 6 23:15:08 2021 +

Fix BZ 65726 - handle HTTP/1.1 upgrade with request body

https://bz.apache.org/bugzilla/show_bug.cgi?id=65726
---
 java/org/apache/coyote/http11/Http11Processor.java | 116 +++--
 .../upgrade/UpgradeApplicationBufferHandler.java   |  45 
 java/org/apache/coyote/http2/Stream.java   |   2 +-
 test/org/apache/coyote/http2/Http2TestBase.java|  27 +
 .../coyote/http2/TestHttp2UpgradeHandler.java  |  80 ++
 webapps/docs/changelog.xml |   5 +
 webapps/docs/config/http.xml   |  24 +++--
 webapps/docs/security-howto.xml|   8 +-
 8 files changed, 258 insertions(+), 49 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 34ee0e1..7aaf1f8 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -46,6 +46,7 @@ import 
org.apache.coyote.http11.filters.SavedRequestInputFilter;
 import org.apache.coyote.http11.filters.VoidInputFilter;
 import org.apache.coyote.http11.filters.VoidOutputFilter;
 import org.apache.coyote.http11.upgrade.InternalHttpUpgradeHandler;
+import org.apache.coyote.http11.upgrade.UpgradeApplicationBufferHandler;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
@@ -57,6 +58,7 @@ import org.apache.tomcat.util.http.parser.HttpParser;
 import org.apache.tomcat.util.http.parser.TokenList;
 import org.apache.tomcat.util.log.UserDataHelper;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
+import org.apache.tomcat.util.net.ApplicationBufferHandler;
 import org.apache.tomcat.util.net.SSLSupport;
 import org.apache.tomcat.util.net.SendfileDataBase;
 import org.apache.tomcat.util.net.SendfileKeepAliveState;
@@ -335,18 +337,33 @@ public class Http11Processor extends AbstractProcessor {
 UpgradeProtocol upgradeProtocol = 
protocol.getUpgradeProtocol(requestedProtocol);
 if (upgradeProtocol != null) {
 if (upgradeProtocol.accept(request)) {
-
response.setStatus(HttpServletResponse.SC_SWITCHING_PROTOCOLS);
-response.setHeader("Connection", "Upgrade");
-response.setHeader("Upgrade", requestedProtocol);
-action(ActionCode.CLOSE,  null);
-getAdapter().log(request, response, 0);
-
-InternalHttpUpgradeHandler upgradeHandler =
-upgradeProtocol.getInternalUpgradeHandler(
-socketWrapper, getAdapter(), 
cloneRequest(request));
-UpgradeToken upgradeToken = new 
UpgradeToken(upgradeHandler, null, null, requestedProtocol);
-action(ActionCode.UPGRADE, upgradeToken);
-return SocketState.UPGRADING;
+// Create clone of request for upgraded protocol
+Request upgradeRequest = null;
+try {
+upgradeRequest = cloneRequest(request);
+} catch (ByteChunk.BufferOverflowException ioe) {
+
response.setStatus(HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE);
+setErrorState(ErrorState.CLOSE_CLEAN, null);
+} catch (IOException ioe) {
+
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+setErrorState(ErrorState.CLOSE_CLEAN, ioe);
+}
+
+if (upgradeRequest != null) {
+// Complete the HTTP/1.1 upgrade process
+
response.setStatus(HttpServletResponse.SC_SWITCHING_PROTOCOLS);
+response.setHeader("Connection", "Upgrade");
+response.setHeader("Upgrade", requestedProtocol);
+action(ActionCode.CLOSE,  null);
+getAdapter().log(request, response, 0);
+
+// Continue processing using new protocol
+InternalHttpUpgradeHandler upgradeHandler =
+
upgradeProtocol.getInternalUpgradeHandler(socketWrapper, getAdapter(), 
upgradeRequest);
+UpgradeToken upgradeToken = new 
UpgradeToken(upgradeHandler, null, null, requestedProtocol);
+

[tomcat] branch 8.5.x updated: Correct entry location

2021-12-07 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 829ee13  Correct entry location
829ee13 is described below

commit 829ee13bc31933fd55fb1568a0781d56a27daa7c
Author: Mark Thomas 
AuthorDate: Tue Dec 7 11:42:33 2021 +

Correct entry location
---
 webapps/docs/changelog.xml | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 88ccec6..a897d6c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -138,11 +138,6 @@
 does not explicitly close an input stream for an uploaded file that was
 cached on disk. (markt)
   
-  
-65726: Implement support for HTTP/1.1 upgrade when the
-request includes a body. The maximum permitted size of the body is
-controlled by maxSavePostSize. (markt)
-  
 
   
   
@@ -181,6 +176,11 @@
 on MacOS as it does on Linux and Windows when no trusted certificate
 authorities are configured and reject all client certificates. (markt)
   
+  
+65726: Implement support for HTTP/1.1 upgrade when the
+request includes a body. The maximum permitted size of the body is
+controlled by maxSavePostSize. (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: Correct entry location

2021-12-07 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 037d164  Correct entry location
037d164 is described below

commit 037d1647e0ca5ab5a6276f1b67fc4164414658f6
Author: Mark Thomas 
AuthorDate: Tue Dec 7 11:41:56 2021 +

Correct entry location
---
 webapps/docs/changelog.xml | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 527664e..91816b8 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,15 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+65726: Implement support for HTTP/1.1 upgrade when the
+request includes a body. The maximum permitted size of the body is
+controlled by maxSavePostSize. (markt)
+  
+
+  
   
 
   
@@ -149,11 +158,6 @@
 does not explicitly close an input stream for an uploaded file that was
 cached on disk. (markt)
   
-  
-65726: Implement support for HTTP/1.1 upgrade when the
-request includes a body. The maximum permitted size of the body is
-controlled by maxSavePostSize. (markt)
-  
 
   
   

-
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: Correct entry location

2021-12-07 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 70d56de  Correct entry location
70d56de is described below

commit 70d56debe095c51e28d6271943c574c524311a2b
Author: Mark Thomas 
AuthorDate: Tue Dec 7 11:40:50 2021 +

Correct entry location
---
 webapps/docs/changelog.xml | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 9a7091a..243f397 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,15 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+65726: Implement support for HTTP/1.1 upgrade when the
+request includes a body. The maximum permitted size of the body is
+controlled by maxSavePostSize. (markt)
+  
+
+  
   
 
   
@@ -149,11 +158,6 @@
 does not explicitly close an input stream for an uploaded file that was
 cached on disk. (markt)
   
-  
-65726: Implement support for HTTP/1.1 upgrade when the
-request includes a body. The maximum permitted size of the body is
-controlled by maxSavePostSize. (markt)
-  
 
   
   

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



[tomcat] 02/02: Fix BZ 65726 - handle HTTP/1.1 upgrade with request body

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

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

commit 744333edb6de7fb71ff4fb4159d7674712325f55
Author: Mark Thomas 
AuthorDate: Mon Dec 6 23:15:08 2021 +

Fix BZ 65726 - handle HTTP/1.1 upgrade with request body

https://bz.apache.org/bugzilla/show_bug.cgi?id=65726
---
 java/org/apache/coyote/http11/Http11Processor.java | 116 +++--
 .../upgrade/UpgradeApplicationBufferHandler.java   |  45 
 java/org/apache/coyote/http2/Stream.java   |   2 +-
 test/org/apache/coyote/http2/Http2TestBase.java|  27 +
 .../coyote/http2/TestHttp2UpgradeHandler.java  |  80 ++
 webapps/docs/changelog.xml |   9 ++
 webapps/docs/config/http.xml   |  24 +++--
 webapps/docs/security-howto.xml|   8 +-
 8 files changed, 262 insertions(+), 49 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 4f27473..623631a 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -47,6 +47,7 @@ import 
org.apache.coyote.http11.filters.SavedRequestInputFilter;
 import org.apache.coyote.http11.filters.VoidInputFilter;
 import org.apache.coyote.http11.filters.VoidOutputFilter;
 import org.apache.coyote.http11.upgrade.InternalHttpUpgradeHandler;
+import org.apache.coyote.http11.upgrade.UpgradeApplicationBufferHandler;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
@@ -58,6 +59,7 @@ import org.apache.tomcat.util.http.parser.HttpParser;
 import org.apache.tomcat.util.http.parser.TokenList;
 import org.apache.tomcat.util.log.UserDataHelper;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
+import org.apache.tomcat.util.net.ApplicationBufferHandler;
 import org.apache.tomcat.util.net.SSLSupport;
 import org.apache.tomcat.util.net.SendfileDataBase;
 import org.apache.tomcat.util.net.SendfileKeepAliveState;
@@ -336,18 +338,33 @@ public class Http11Processor extends AbstractProcessor {
 UpgradeProtocol upgradeProtocol = 
protocol.getUpgradeProtocol(requestedProtocol);
 if (upgradeProtocol != null) {
 if (upgradeProtocol.accept(request)) {
-
response.setStatus(HttpServletResponse.SC_SWITCHING_PROTOCOLS);
-response.setHeader("Connection", "Upgrade");
-response.setHeader("Upgrade", requestedProtocol);
-action(ActionCode.CLOSE,  null);
-getAdapter().log(request, response, 0);
-
-InternalHttpUpgradeHandler upgradeHandler =
-upgradeProtocol.getInternalUpgradeHandler(
-socketWrapper, getAdapter(), 
cloneRequest(request));
-UpgradeToken upgradeToken = new 
UpgradeToken(upgradeHandler, null, null, requestedProtocol);
-action(ActionCode.UPGRADE, upgradeToken);
-return SocketState.UPGRADING;
+// Create clone of request for upgraded protocol
+Request upgradeRequest = null;
+try {
+upgradeRequest = cloneRequest(request);
+} catch (ByteChunk.BufferOverflowException ioe) {
+
response.setStatus(HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE);
+setErrorState(ErrorState.CLOSE_CLEAN, null);
+} catch (IOException ioe) {
+
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+setErrorState(ErrorState.CLOSE_CLEAN, ioe);
+}
+
+if (upgradeRequest != null) {
+// Complete the HTTP/1.1 upgrade process
+
response.setStatus(HttpServletResponse.SC_SWITCHING_PROTOCOLS);
+response.setHeader("Connection", "Upgrade");
+response.setHeader("Upgrade", requestedProtocol);
+action(ActionCode.CLOSE,  null);
+getAdapter().log(request, response, 0);
+
+// Continue processing using new protocol
+InternalHttpUpgradeHandler upgradeHandler =
+
upgradeProtocol.getInternalUpgradeHandler(socketWrapper, getAdapter(), 
upgradeRequest);
+UpgradeToken upgradeToken = new 
UpgradeToken(upgradeHandler, null, null, requestedProtocol);
+

[tomcat] 01/02: Use specialised exception for the case of ByteChunk overflow

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

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

commit ffe42125b38ff95f0f65cdc784a19bc1772a9ae1
Author: Mark Thomas 
AuthorDate: Mon Dec 6 22:44:11 2021 +

Use specialised exception for the case of ByteChunk overflow

This enables the option of specific handling for this case further up
the stack
---
 java/org/apache/tomcat/util/buf/ByteChunk.java | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/buf/ByteChunk.java 
b/java/org/apache/tomcat/util/buf/ByteChunk.java
index 841b3e3..c2a3d86 100644
--- a/java/org/apache/tomcat/util/buf/ByteChunk.java
+++ b/java/org/apache/tomcat/util/buf/ByteChunk.java
@@ -465,7 +465,7 @@ public final class ByteChunk extends AbstractChunk {
 public void flushBuffer() throws IOException {
 // assert out!=null
 if (out == null) {
-throw new IOException(sm.getString(
+throw new BufferOverflowException(sm.getString(
 "chunk.overflow", Integer.valueOf(getLimit()), 
Integer.valueOf(buff.length)));
 }
 out.realWriteBytes(buff, start, end - start);
@@ -830,4 +830,14 @@ public final class ByteChunk extends AbstractChunk {
 }
 return result;
 }
+
+
+public static class BufferOverflowException extends IOException {
+
+private static final long serialVersionUID = 1L;
+
+public BufferOverflowException(String message) {
+super(message);
+}
+}
 }

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



[tomcat] branch main updated (28f5e29 -> 744333e)

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

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


from 28f5e29  Refactor tests to reduce running time when using multiple 
threads
 new ffe4212  Use specialised exception for the case of ByteChunk overflow
 new 744333e  Fix BZ 65726 - handle HTTP/1.1 upgrade with request body

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/coyote/http11/Http11Processor.java | 116 +++--
 .../upgrade/UpgradeApplicationBufferHandler.java   |  31 +++---
 java/org/apache/coyote/http2/Stream.java   |   2 +-
 java/org/apache/tomcat/util/buf/ByteChunk.java |  12 ++-
 test/org/apache/coyote/http2/Http2TestBase.java|  27 +
 .../coyote/http2/TestHttp2UpgradeHandler.java  |  80 ++
 webapps/docs/changelog.xml |   9 ++
 webapps/docs/config/http.xml   |  24 +++--
 webapps/docs/security-howto.xml|   8 +-
 9 files changed, 243 insertions(+), 66 deletions(-)
 copy test/org/apache/catalina/valves/rewrite/TesterRewriteMapA.java => 
java/org/apache/coyote/http11/upgrade/UpgradeApplicationBufferHandler.java (60%)

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



[tomcat] 01/02: Use specialised exception for the case of ByteChunk overflow

2021-12-07 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

commit 6cf9b082d6b24253027921096ef905037f3f10ca
Author: Mark Thomas 
AuthorDate: Mon Dec 6 22:44:11 2021 +

Use specialised exception for the case of ByteChunk overflow

This enables the option of specific handling for this case further up
the stack
---
 java/org/apache/tomcat/util/buf/ByteChunk.java | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/buf/ByteChunk.java 
b/java/org/apache/tomcat/util/buf/ByteChunk.java
index 841b3e3..c2a3d86 100644
--- a/java/org/apache/tomcat/util/buf/ByteChunk.java
+++ b/java/org/apache/tomcat/util/buf/ByteChunk.java
@@ -465,7 +465,7 @@ public final class ByteChunk extends AbstractChunk {
 public void flushBuffer() throws IOException {
 // assert out!=null
 if (out == null) {
-throw new IOException(sm.getString(
+throw new BufferOverflowException(sm.getString(
 "chunk.overflow", Integer.valueOf(getLimit()), 
Integer.valueOf(buff.length)));
 }
 out.realWriteBytes(buff, start, end - start);
@@ -830,4 +830,14 @@ public final class ByteChunk extends AbstractChunk {
 }
 return result;
 }
+
+
+public static class BufferOverflowException extends IOException {
+
+private static final long serialVersionUID = 1L;
+
+public BufferOverflowException(String message) {
+super(message);
+}
+}
 }

-
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 (5822574 -> f4c12fc)

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

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


from 5822574  Refactor tests to reduce running time when using multiple 
threads
 new 6cf9b08  Use specialised exception for the case of ByteChunk overflow
 new f4c12fc  Fix BZ 65726 - handle HTTP/1.1 upgrade with request body

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/coyote/http11/Http11Processor.java | 116 +++--
 .../upgrade/UpgradeApplicationBufferHandler.java   |  31 +++---
 java/org/apache/coyote/http2/Stream.java   |   2 +-
 java/org/apache/tomcat/util/buf/ByteChunk.java |  12 ++-
 test/org/apache/coyote/http2/Http2TestBase.java|  27 +
 .../coyote/http2/TestHttp2UpgradeHandler.java  |  80 ++
 webapps/docs/changelog.xml |   5 +
 webapps/docs/config/http.xml   |  24 +++--
 webapps/docs/security-howto.xml|   8 +-
 9 files changed, 239 insertions(+), 66 deletions(-)
 copy test/org/apache/catalina/valves/rewrite/TesterRewriteMapA.java => 
java/org/apache/coyote/http11/upgrade/UpgradeApplicationBufferHandler.java (60%)

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



[tomcat] 01/02: Use specialised exception for the case of ByteChunk overflow

2021-12-07 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 2f81d33e41321d988ee6322ff244545acc464167
Author: Mark Thomas 
AuthorDate: Mon Dec 6 22:44:11 2021 +

Use specialised exception for the case of ByteChunk overflow

This enables the option of specific handling for this case further up
the stack
---
 java/org/apache/tomcat/util/buf/ByteChunk.java | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/buf/ByteChunk.java 
b/java/org/apache/tomcat/util/buf/ByteChunk.java
index d05cc8b..f2ea740 100644
--- a/java/org/apache/tomcat/util/buf/ByteChunk.java
+++ b/java/org/apache/tomcat/util/buf/ByteChunk.java
@@ -512,7 +512,7 @@ public final class ByteChunk extends AbstractChunk {
 public void flushBuffer() throws IOException {
 // assert out!=null
 if (out == null) {
-throw new IOException(sm.getString(
+throw new BufferOverflowException(sm.getString(
 "chunk.overflow", Integer.valueOf(getLimit()), 
Integer.valueOf(buff.length)));
 }
 out.realWriteBytes(buff, start, end - start);
@@ -877,4 +877,14 @@ public final class ByteChunk extends AbstractChunk {
 }
 return result;
 }
+
+
+public static class BufferOverflowException extends IOException {
+
+private static final long serialVersionUID = 1L;
+
+public BufferOverflowException(String message) {
+super(message);
+}
+}
 }

-
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 (a7390da -> 9771286)

2021-12-07 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 a7390da  Refactor tests to reduce running time when using multiple 
threads
 new 2f81d33  Use specialised exception for the case of ByteChunk overflow
 new 9771286  Fix BZ 65726 - handle HTTP/1.1 upgrade with request body

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/coyote/http11/Http11Processor.java | 116 +++--
 .../upgrade/UpgradeApplicationBufferHandler.java   |  31 +++---
 java/org/apache/coyote/http2/Stream.java   |   2 +-
 java/org/apache/tomcat/util/buf/ByteChunk.java |  12 ++-
 test/org/apache/coyote/http2/Http2TestBase.java|  27 +
 .../coyote/http2/TestHttp2UpgradeHandler.java  |  80 ++
 webapps/docs/changelog.xml |   5 +
 webapps/docs/config/http.xml   |  24 +++--
 webapps/docs/security-howto.xml|   8 +-
 9 files changed, 239 insertions(+), 66 deletions(-)
 copy test/org/apache/catalina/valves/rewrite/TesterRewriteMapA.java => 
java/org/apache/coyote/http11/upgrade/UpgradeApplicationBufferHandler.java (60%)

-
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: Align with 9.0.x

2021-12-07 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 8b9223c  Align with 9.0.x
8b9223c is described below

commit 8b9223c33454897039438af6121e9f53fa227dfc
Author: Mark Thomas 
AuthorDate: Tue Dec 7 11:27:44 2021 +

Align with 9.0.x
---
 java/org/apache/tomcat/util/buf/ByteChunk.java  | 4 ++--
 java/org/apache/tomcat/util/buf/LocalStrings.properties | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/tomcat/util/buf/ByteChunk.java 
b/java/org/apache/tomcat/util/buf/ByteChunk.java
index 748e101..e3c6a65 100644
--- a/java/org/apache/tomcat/util/buf/ByteChunk.java
+++ b/java/org/apache/tomcat/util/buf/ByteChunk.java
@@ -470,8 +470,8 @@ public final class ByteChunk extends AbstractChunk {
 public void flushBuffer() throws IOException {
 // assert out!=null
 if (out == null) {
-throw new BufferOverflowException(sm.getString("byteChunk.noSink",
-Integer.valueOf(getLimit()), 
Integer.valueOf(buff.length)));
+throw new BufferOverflowException(sm.getString(
+"chunk.overflow", Integer.valueOf(getLimit()), 
Integer.valueOf(buff.length)));
 }
 out.realWriteBytes(buff, start, end - start);
 end = start;
diff --git a/java/org/apache/tomcat/util/buf/LocalStrings.properties 
b/java/org/apache/tomcat/util/buf/LocalStrings.properties
index 8440c7f..0f14806 100644
--- a/java/org/apache/tomcat/util/buf/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/buf/LocalStrings.properties
@@ -20,7 +20,7 @@ b2cConverter.unknownEncoding=The character encoding [{0}] is 
not supported
 
 byteBufferUtils.cleaner=Cannot use direct ByteBuffer cleaner, memory leaking 
may occur
 
-byteChunk.noSink=Cannot write [{1}] bytes to ByteChunk with limit [{0}] as it 
has no sink for overflow
+chunk.overflow=Buffer overflow and no sink is set, limit [{0}] and buffer 
length [{1}]
 
 c2bConverter.recycleFailed=Failed to recycle the C2B Converter. Creating new 
BufferedWriter, WriteConvertor and IntermediateOutputStream.
 

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



[tomcat] 03/03: Avoid NPE (observed when running tests)

2021-12-07 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 b6ace6f2274298ceec3d1de762b95d109e4aa695
Author: Mark Thomas 
AuthorDate: Tue Dec 7 10:01:10 2021 +

Avoid NPE (observed when running tests)
---
 java/org/apache/tomcat/util/net/NioBlockingSelector.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/java/org/apache/tomcat/util/net/NioBlockingSelector.java 
b/java/org/apache/tomcat/util/net/NioBlockingSelector.java
index 3199d04..3a629d3 100644
--- a/java/org/apache/tomcat/util/net/NioBlockingSelector.java
+++ b/java/org/apache/tomcat/util/net/NioBlockingSelector.java
@@ -91,6 +91,9 @@ public class NioBlockingSelector {
 reference = new KeyReference();
 }
 NioSocketWrapper att = (NioSocketWrapper) key.attachment();
+if (att == null) {
+throw new IOException();
+}
 if (att.previousIOException != null) {
 /*
  * Socket has previously seen an IOException on write.

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



[tomcat] 02/03: Fix BZ 65726 - handle HTTP/1.1 upgrade with request body

2021-12-07 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 d09a2968779eea53916f4c4a344d69374a59bba0
Author: Mark Thomas 
AuthorDate: Mon Dec 6 23:15:08 2021 +

Fix BZ 65726 - handle HTTP/1.1 upgrade with request body

https://bz.apache.org/bugzilla/show_bug.cgi?id=65726
---
 java/org/apache/coyote/http11/Http11Processor.java | 118 +++--
 .../upgrade/UpgradeApplicationBufferHandler.java   |  45 
 java/org/apache/coyote/http2/Stream.java   |   2 +-
 test/org/apache/coyote/http2/Http2TestBase.java|  27 +
 .../coyote/http2/TestHttp2UpgradeHandler.java  |  80 ++
 webapps/docs/changelog.xml |   5 +
 webapps/docs/config/http.xml   |  24 +++--
 webapps/docs/security-howto.xml|   8 +-
 8 files changed, 258 insertions(+), 51 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index bfc033f..196dc33 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -45,6 +45,7 @@ import 
org.apache.coyote.http11.filters.SavedRequestInputFilter;
 import org.apache.coyote.http11.filters.VoidInputFilter;
 import org.apache.coyote.http11.filters.VoidOutputFilter;
 import org.apache.coyote.http11.upgrade.InternalHttpUpgradeHandler;
+import org.apache.coyote.http11.upgrade.UpgradeApplicationBufferHandler;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
@@ -58,6 +59,7 @@ import org.apache.tomcat.util.http.parser.TokenList;
 import org.apache.tomcat.util.log.UserDataHelper;
 import org.apache.tomcat.util.net.AbstractEndpoint;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
+import org.apache.tomcat.util.net.ApplicationBufferHandler;
 import org.apache.tomcat.util.net.SSLSupport;
 import org.apache.tomcat.util.net.SendfileDataBase;
 import org.apache.tomcat.util.net.SendfileKeepAliveState;
@@ -576,20 +578,33 @@ public class Http11Processor extends AbstractProcessor {
 UpgradeProtocol upgradeProtocol = 
protocol.getUpgradeProtocol(requestedProtocol);
 if (upgradeProtocol != null) {
 if (upgradeProtocol.accept(request)) {
-// TODO Figure out how to handle request bodies at this
-// point.
-
response.setStatus(HttpServletResponse.SC_SWITCHING_PROTOCOLS);
-response.setHeader("Connection", "Upgrade");
-response.setHeader("Upgrade", requestedProtocol);
-action(ActionCode.CLOSE,  null);
-getAdapter().log(request, response, 0);
-
-InternalHttpUpgradeHandler upgradeHandler =
-upgradeProtocol.getInternalUpgradeHandler(
-getAdapter(), cloneRequest(request));
-UpgradeToken upgradeToken = new 
UpgradeToken(upgradeHandler, null, null, requestedProtocol);
-action(ActionCode.UPGRADE, upgradeToken);
-return SocketState.UPGRADING;
+// Create clone of request for upgraded protocol
+Request upgradeRequest = null;
+try {
+upgradeRequest = cloneRequest(request);
+} catch (ByteChunk.BufferOverflowException ioe) {
+
response.setStatus(HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE);
+setErrorState(ErrorState.CLOSE_CLEAN, null);
+} catch (IOException ioe) {
+
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+setErrorState(ErrorState.CLOSE_CLEAN, ioe);
+}
+
+if (upgradeRequest != null) {
+// Complete the HTTP/1.1 upgrade process
+
response.setStatus(HttpServletResponse.SC_SWITCHING_PROTOCOLS);
+response.setHeader("Connection", "Upgrade");
+response.setHeader("Upgrade", requestedProtocol);
+action(ActionCode.CLOSE,  null);
+getAdapter().log(request, response, 0);
+
+// Continue processing using new protocol
+InternalHttpUpgradeHandler upgradeHandler =
+
upgradeProtocol.getInternalUpgradeHandler(getAdapter(), upgradeRequest);
+UpgradeToken upgradeToken = new 

[tomcat] 01/03: Use specialised exception for the case of ByteChunk overflow

2021-12-07 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 aceb64d504f1adcb49319acf1973c3262b49048a
Author: Mark Thomas 
AuthorDate: Mon Dec 6 22:44:11 2021 +

Use specialised exception for the case of ByteChunk overflow

This enables the option of specific handling for this case further up
the stack
---
 java/org/apache/tomcat/util/buf/ByteChunk.java  | 17 -
 java/org/apache/tomcat/util/buf/LocalStrings.properties |  2 ++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/buf/ByteChunk.java 
b/java/org/apache/tomcat/util/buf/ByteChunk.java
index 3ba68af..748e101 100644
--- a/java/org/apache/tomcat/util/buf/ByteChunk.java
+++ b/java/org/apache/tomcat/util/buf/ByteChunk.java
@@ -24,6 +24,8 @@ import java.nio.CharBuffer;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 
+import org.apache.tomcat.util.res.StringManager;
+
 /*
  * In a server it is very important to be able to operate on
  * the original byte[] without converting everything to chars.
@@ -118,6 +120,8 @@ public final class ByteChunk extends AbstractChunk {
 
 // 
 
+private static final StringManager sm = 
StringManager.getManager(ByteChunk.class);
+
 /**
  * Default encoding used to convert to strings. It should be UTF8, as most
  * standards seem to converge, but the servlet API requires 8859_1, and 
this
@@ -466,7 +470,8 @@ public final class ByteChunk extends AbstractChunk {
 public void flushBuffer() throws IOException {
 // assert out!=null
 if (out == null) {
-throw new IOException("Buffer overflow, no sink " + getLimit() + " 
" + buff.length);
+throw new BufferOverflowException(sm.getString("byteChunk.noSink",
+Integer.valueOf(getLimit()), 
Integer.valueOf(buff.length)));
 }
 out.realWriteBytes(buff, start, end - start);
 end = start;
@@ -830,4 +835,14 @@ public final class ByteChunk extends AbstractChunk {
 }
 return result;
 }
+
+
+public static class BufferOverflowException extends IOException {
+
+private static final long serialVersionUID = 1L;
+
+public BufferOverflowException(String message) {
+super(message);
+}
+}
 }
diff --git a/java/org/apache/tomcat/util/buf/LocalStrings.properties 
b/java/org/apache/tomcat/util/buf/LocalStrings.properties
index fb860d7..8440c7f 100644
--- a/java/org/apache/tomcat/util/buf/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/buf/LocalStrings.properties
@@ -20,6 +20,8 @@ b2cConverter.unknownEncoding=The character encoding [{0}] is 
not supported
 
 byteBufferUtils.cleaner=Cannot use direct ByteBuffer cleaner, memory leaking 
may occur
 
+byteChunk.noSink=Cannot write [{1}] bytes to ByteChunk with limit [{0}] as it 
has no sink for overflow
+
 c2bConverter.recycleFailed=Failed to recycle the C2B Converter. Creating new 
BufferedWriter, WriteConvertor and IntermediateOutputStream.
 
 encodedSolidusHandling.invalid=The value [{0}] is not recognised

-
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 (a054f4f -> b6ace6f)

2021-12-07 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 a054f4f  Refactor tests to reduce running time when using multiple 
threads
 new aceb64d  Use specialised exception for the case of ByteChunk overflow
 new d09a296  Fix BZ 65726 - handle HTTP/1.1 upgrade with request body
 new b6ace6f  Avoid NPE (observed when running tests)

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


Summary of changes:
 java/org/apache/coyote/http11/Http11Processor.java | 118 +++--
 .../upgrade/UpgradeApplicationBufferHandler.java}  |  36 +++
 java/org/apache/coyote/http2/Stream.java   |   2 +-
 java/org/apache/tomcat/util/buf/ByteChunk.java |  17 ++-
 .../apache/tomcat/util/buf/LocalStrings.properties |   2 +
 .../tomcat/util/net/NioBlockingSelector.java   |   3 +
 test/org/apache/coyote/http2/Http2TestBase.java|  27 +
 .../coyote/http2/TestHttp2UpgradeHandler.java  |  80 ++
 webapps/docs/changelog.xml |   5 +
 webapps/docs/config/http.xml   |  24 +++--
 webapps/docs/security-howto.xml|   8 +-
 11 files changed, 249 insertions(+), 73 deletions(-)
 copy java/org/apache/{catalina/ha/ClusterMessageBase.java => 
coyote/http11/upgrade/UpgradeApplicationBufferHandler.java} (59%)

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



[GitHub] [tomcat] gmshake removed a comment on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


gmshake removed a comment on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-987793365


   > Ok, I am sorry, I will reference you directly :) I disagree with you, 
@markt-asf. The class Base64 is used **_directly_** by the clients. Just a 
couple of examples: 
[this](https://stackoverflow.com/questions/10744715/how-to-base64-encode-a-java-object-using-org-apache-commons-codec-binary-base64/10747284),
 and 
[this](https://www.baeldung.com/java-base64-encode-and-decode#encodingdecoding-using-apache-commons-code),
 also 
[this](https://stackoverflow.com/questions/11544568/decoding-a-base64-string-in-java)
 and e.t.c.) - and, as I already mentioned, Base64 delegates to BaseNCodec, 
which does not tolerate null.
   > 
   > @markt-asf I really do not understand why it is so hard to apply this 
minor, non-breaking change :) As I mentioned above, people are using this API 
in thier code (it is public b.t.w), so why not make their life easier?)
   
   @Mikhail2048 , as @markt-asf has emphasised:
   > This code is not part of a framework. It is Tomcat's internal API. 
Applications should not be calling this code.
   
   The examples you referenced is `org.apache.commons.codec.binary.Base64`, 
that is not this one `org.apache.tomcat.util.codec.binary.BaseNCodec`. Be aware 
the two packages are different.


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

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

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



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



[GitHub] [tomcat] gmshake commented on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


gmshake commented on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-987793365


   > Ok, I am sorry, I will reference you directly :) I disagree with you, 
@markt-asf. The class Base64 is used **_directly_** by the clients. Just a 
couple of examples: 
[this](https://stackoverflow.com/questions/10744715/how-to-base64-encode-a-java-object-using-org-apache-commons-codec-binary-base64/10747284),
 and 
[this](https://www.baeldung.com/java-base64-encode-and-decode#encodingdecoding-using-apache-commons-code),
 also 
[this](https://stackoverflow.com/questions/11544568/decoding-a-base64-string-in-java)
 and e.t.c.) - and, as I already mentioned, Base64 delegates to BaseNCodec, 
which does not tolerate null.
   > 
   > @markt-asf I really do not understand why it is so hard to apply this 
minor, non-breaking change :) As I mentioned above, people are using this API 
in thier code (it is public b.t.w), so why not make their life easier?)
   
   @Mikhail2048 , as @markt-asf has emphasised:
   > This code is not part of a framework. It is Tomcat's internal API. 
Applications should not be calling this code.
   
   The examples you referenced is `org.apache.commons.codec.binary.Base64`, 
that is not this one `org.apache.tomcat.util.codec.binary.BaseNCodec`. Be aware 
the two packages are different.


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

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

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



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



[GitHub] [tomcat] Mikhail2048 closed pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


Mikhail2048 closed pull request #461:
URL: https://github.com/apache/tomcat/pull/461


   


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

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

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



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



[GitHub] [tomcat] Mikhail2048 commented on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


Mikhail2048 commented on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-987791199


   Ok, that make sence. I will use the public API


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

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

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



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



[GitHub] [tomcat] markt-asf commented on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


markt-asf commented on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-987789405


   All those references you provided are for 
`org.apache.commons.codec.binary.BaseNCodec` not 
`org.apache.tomcat.util.codec.binary.BaseNCodec`
   
   That the class is public is irrelevant. It has to be public as it is a 
utility class used by various Tomcat packages. Tomcat's public API is 
documented in the RELEASE-NOTES.
   
   The change won't be applied because it isn't necessary and there is no 
desire to add unnecessary code bloat to Tomcat.
   
   It your application wants to use Commons Codec then it should package it in 
WEB-INF/lib.


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

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

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



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



[GitHub] [tomcat] Mikhail2048 commented on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


Mikhail2048 commented on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-987781061


   Ok, I am sorry, I will reference you directly :) I disagree with you, 
@markt-asf. The class Base64 is used **_directly_** by the clients. Just a 
couple of examples: 
[this](https://stackoverflow.com/questions/10744715/how-to-base64-encode-a-java-object-using-org-apache-commons-codec-binary-base64/10747284),
 and 
[this](https://www.baeldung.com/java-base64-encode-and-decode#encodingdecoding-using-apache-commons-code),
 also 
[this](https://stackoverflow.com/questions/11544568/decoding-a-base64-string-in-java)
 and e.t.c.) - and, as I already mentioned, Base64 delegates to BaseNCodec, 
which does not tolerate null.
   
   @markt-asf I really do not understand why it is so hard to apply this minor, 
non-breaking change :) As I mentioned above, people are using this API in thier 
code (it is public b.t.w), so why not make their life easier?)


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

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

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



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



[GitHub] [tomcat] markt-asf commented on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


markt-asf commented on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-987773286


   1. Please avoid use of gender specific terminology such as "guys" or 
"fellows" when referring to members of the Tomcat community.
   
   2. This code is not part of a framework. It is Tomcat's internal API. 
Applications should not be calling this code.
   
   The logic behind the current design is simple: Tomcat never calls that 
method with `null` so a null check is unnecessary.


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

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

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



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



[GitHub] [tomcat] Mikhail2048 commented on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


Mikhail2048 commented on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-987771204


   > > Becuase this code, for example : `new Base64().decode(myString)` will 
produce NPE in case of myString is `null`. This is becuase of inner delegation 
to `public byte[] decode(final byte[] pArray)` method (in `BaseNCodec` class), 
which cannot handle null values.
   > 
   > It make sense to `encode` a empty string, but it does not make sense to 
`encode` or `decode` a `null` string.
   
   I agree with that, but it forces the client the be aware of the fact that 
string is not null. I am responsible to check it, as a Client - why? I 
genuinely do not understand the logic behind it 


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

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

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



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



[GitHub] [tomcat] Mikhail2048 commented on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


Mikhail2048 commented on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-987768973


   But guys, I am, as a framework user, expect that the framework will take 
care of this check. Do you really think I am doing the  
   `decode((String) null)` - I have a string in application, which can be null, 
and I, as a framework user, do not want to take care about making checks about 
it.
   
   Indeed, fellows, I guess you have used Apache Commons. Take a look into its 
utility classes - they withdraw this boring responsibilities from the framework 
client.


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

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

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



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



[GitHub] [tomcat] gmshake commented on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


gmshake commented on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-987746994


   > Becuase this code, for example : `new Base64().decode(myString)` will 
produce NPE in case of myString is `null`. This is becuase of inner delegation 
to `public byte[] decode(final byte[] pArray)` method (in `BaseNCodec` class), 
which cannot handle null values.
   
   It make sense to `encode` a empty string, but it does not make sense to 
`encode` or `decode` a `null` string.


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

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

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



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



[GitHub] [tomcat] markt-asf commented on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


markt-asf commented on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-987737781


   So don't call `decode((String) null)`.


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

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

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



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



[GitHub] [tomcat] BlueSkyT edited a comment on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


BlueSkyT edited a comment on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-987709632


   这是一封自动回复邮件。已经收到您的来信,我会尽快回复。


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

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

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



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



[GitHub] [tomcat] zhengdi1992 edited a comment on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


zhengdi1992 edited a comment on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-987709851


   <自动回复>
   你好,你的来信我已收到,尽快会给你回复。


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

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

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



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



[GitHub] [tomcat] zhengdi1992 commented on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


zhengdi1992 commented on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-987709851


   <自动回复>
   你好,你的来信我已收到,尽快会给你回复。


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

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

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



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



[GitHub] [tomcat] BlueSkyT commented on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


BlueSkyT commented on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-987709632


   这是一封自动回复邮件。已经收到您的来信,我会尽快回复。


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

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

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



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



[GitHub] [tomcat] Mikhail2048 commented on pull request #461: Add null check for BaseNCodec decodning

2021-12-07 Thread GitBox


Mikhail2048 commented on pull request #461:
URL: https://github.com/apache/tomcat/pull/461#issuecomment-987709245


   Becuase this code, for example : `new Base64().decode(myString)` will 
produce NPE in case of myString is `null`. This is becuase of inner delegation 
to `public byte[] decode(final byte[] pArray)` method (in `BaseNCodec` class), 
which cannot handle null values.


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

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

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



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