(tomcat) branch main updated: Add new suspendWrappedResponseAfterForward

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

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


The following commit(s) were added to refs/heads/main by this push:
 new 81ede59fb1 Add new suspendWrappedResponseAfterForward
81ede59fb1 is described below

commit 81ede59fb1da659361b20b373ef7c78f0e23c1ea
Author: remm 
AuthorDate: Wed Mar 6 11:44:14 2024 +0100

Add new suspendWrappedResponseAfterForward

This allow configuring the suspend after forward unwrapping.
---
 java/org/apache/catalina/Context.java   | 17 +
 .../org/apache/catalina/core/ApplicationDispatcher.java |  3 ++-
 java/org/apache/catalina/core/StandardContext.java  | 14 ++
 java/org/apache/catalina/startup/FailedContext.java |  9 +
 test/org/apache/tomcat/unittest/TesterContext.java  |  5 +
 webapps/docs/changelog.xml  |  5 -
 webapps/docs/config/context.xml |  7 +++
 7 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/Context.java 
b/java/org/apache/catalina/Context.java
index f63c7d8e79..b13b6c182f 100644
--- a/java/org/apache/catalina/Context.java
+++ b/java/org/apache/catalina/Context.java
@@ -2003,6 +2003,23 @@ public interface Context extends Container, ContextBind {
 void setDispatcherWrapsSameObject(boolean dispatcherWrapsSameObject);
 
 
+/**
+ * If this is true, then following a forward the response will
+ * be unwrapped to suspend the Catalina response instead of simply closing
+ * the top level response. The default value is true.
+ * @return the flag value
+ */
+boolean getSuspendWrappedResponseAfterForward();
+
+
+/**
+ * Allows unwrapping the response object to suspend the response following
+ * a forward.
+ * @param suspendWrappedResponseAfterForward the new flag value
+ */
+void setSuspendWrappedResponseAfterForward(boolean 
suspendWrappedResponseAfterForward);
+
+
 /**
  * Find configuration file with the specified path, first looking into the
  * webapp resources, then delegating to
diff --git a/java/org/apache/catalina/core/ApplicationDispatcher.java 
b/java/org/apache/catalina/core/ApplicationDispatcher.java
index d7abfe6ba4..08e43c84a2 100644
--- a/java/org/apache/catalina/core/ApplicationDispatcher.java
+++ b/java/org/apache/catalina/core/ApplicationDispatcher.java
@@ -299,7 +299,8 @@ final class ApplicationDispatcher implements 
AsyncDispatcher, RequestDispatcher
 if (response instanceof ResponseFacade) {
 finished = true;
 ((ResponseFacade) response).finish();
-} else if (response instanceof ServletResponseWrapper) {
+} else if (context.getSuspendWrappedResponseAfterForward()
+&& response instanceof ServletResponseWrapper) {
 ServletResponse baseResponse = response;
 do {
 baseResponse = ((ServletResponseWrapper) 
baseResponse).getResponse();
diff --git a/java/org/apache/catalina/core/StandardContext.java 
b/java/org/apache/catalina/core/StandardContext.java
index f9dd5b060a..fdc59984d4 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -794,6 +794,8 @@ public class StandardContext extends ContainerBase 
implements Context, Notificat
 
 private boolean dispatcherWrapsSameObject = 
Globals.STRICT_SERVLET_COMPLIANCE;
 
+private boolean suspendWrappedResponseAfterForward = true;
+
 private boolean parallelAnnotationScanning = false;
 
 
@@ -876,6 +878,18 @@ public class StandardContext extends ContainerBase 
implements Context, Notificat
 }
 
 
+@Override
+public boolean getSuspendWrappedResponseAfterForward() {
+return suspendWrappedResponseAfterForward;
+}
+
+
+@Override
+public void setSuspendWrappedResponseAfterForward(boolean 
suspendWrappedResponseAfterForward) {
+this.suspendWrappedResponseAfterForward = 
suspendWrappedResponseAfterForward;
+}
+
+
 @Override
 public String getRequestCharacterEncoding() {
 return requestEncoding;
diff --git a/java/org/apache/catalina/startup/FailedContext.java 
b/java/org/apache/catalina/startup/FailedContext.java
index e323e589d2..172d83b319 100644
--- a/java/org/apache/catalina/startup/FailedContext.java
+++ b/java/org/apache/catalina/startup/FailedContext.java
@@ -1436,4 +1436,13 @@ public class FailedContext extends LifecycleMBeanBase 
implements Context {
 public void setParallelAnnotationScanning(boolean 
parallelAnnotationScanning) {
 }
 
+@Override
+public boolean getSuspendWrappedResponseAfterForward() {
+return false;
+}
+
+@Override
+public void setSuspendWrappedResponseAfterForward(boolean 
suspendWrappedResponseAfterForward) {
+}
+
 }
\ No newline at end of file
diff --git

Re: March releases

2024-03-06 Thread Rémy Maucherat
On Tue, Mar 5, 2024 at 1:19 PM Mark Thomas  wrote:
>
> On 27/02/2024 09:29, Christopher Schultz wrote:
> > Mark,
> >
> > On 2/27/24 06:20, Mark Thomas wrote:
> >> On 27/02/2024 10:57, Rémy Maucherat wrote:
> >>> On Tue, Feb 27, 2024 at 10:12 AM Mark Thomas  wrote:
> 
>  All,
> 
>  When I look at the current change logs there isn't much there to
>  justify
>  a March release. There are a couple of open bugs of which one looks
>  likely that there is an actual issue to be fixed.
> 
>  That said, I'm unlikely to be in a position to tag 11.0.x until w/c 11
>  March. The change log may look different at that point.
> 
>  It is probably too early to make a decision but I wanted to float the
>  possibility of skipping the March release. That would mean we'd
>  probably
>  need to make the final 8.5.x release in April.
> >>>
> >>> We don't need to always release all branches every time.
> >>
> >> Good point.
> >>
> >>> For example, 11 already has two useful fixes right now: support for
> >>> Java 17 (one could want to verify it), then the FFM fix I made (using
> >>> the wrong loader in one location means it simply breaks depending on
> >>> how OpenSSL is loaded, so that's bad). But these two are not in the
> >>> other branches.
> >>
> >> Ack. Those are good reasons for an 11.0.x release.
> >>
> >> I just checked the dependencies - there are no updates at the moment.
> >>
> >>> As for a final 8.5, I would say it is not mandatory if there's nothing
> >>> useful in the changelog by the end of March. There's always going to
> >>> be a final final fix needed anyway. I started skipping some backports
> >>> to 8.5 since "regressions, who knows".
> >>
> >> I was just thinking .100 was a nice point release to end on ;)
> >
> > Yeah, me too ;)
> >
> > I think we should release 8.5.100 in March, if only to meet our own goal
> > of "ending support at the end of March". There isn't likely to be
> > anything so important that it needs to be added after that.
> >
> > We made a few exceptions for Tomcats 6, 7, and 8.0 for security issues,
> > but I think there's no reason not to release 8.5.100 during March. I
> > don't mind waiting until later in the month just in case anything comes
> > up. Plus we can always change our minds and release again if there is
> > something vital.
>
> Following up on this, I think the bug fix for BZ 68495 does make it
> worth doing a set of releases this month.
>
> The dependencies are up to date, I've just updated the translations and
> we don't have any open bugs at the moment.
>
> There is the sproadic test failure issue that Rainer highlighted.
>
> My plan, as I am not in a huge rush since the Feb releases were so late
> and I am travelling this week, is to look at that issue, check the unit
> tests all pass on the usual set of platforms and then tag 11.0.x.
>
> I've just realised I don't have access to MacOS on Intel until the end
> of the week so I'm thinking tag 11.0.x on Friday if everything else goes
> to plan.

+1
I was quite sure we would find a good reason ;)

Rémy

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



Re: Add support for HTTP connectors to accept REMOTE_USER information from a proxy?

2024-03-06 Thread Christopher Schultz

All,

*bump*

Any thoughts?

-chris

On 2/28/24 14:53, Christopher Schultz wrote:

All,

When using AJP, setting tomcatAuthentication="false" allows mod_jk or 
mod_proxy_ajp to transmit authenticated user information across the 
connection to Tomcat so that request.getRemoteUser() will return 
whatever httpd has for REMOTE_USER.


The same is not true for the HTTP connectors.

   RemoteIPValve takes care of X-Forwarded-* headers

   SSLValve takes care of SSL_* variables for cipher, client cert, etc.

This appears to be one of the only commonly-used pieces of information 
that is difficult to transmit across HTTP while it's easy with AJP.


https://lists.apache.org/thread/bmps52nv8h63mkfqhzmh7p5bhhglgbpl

As a part of my crusade to get people to move from AJP to HTTP, I'd like 
to propose that we make arrangements for this information to be 
transmitted in some reasonable way.


One way to do it would be to add something to RemoteIPValve that would 
be willing to accept e.g. X-Remote-User header and assign that to the 
request. (This would be disabled by default!) Straightforward, 
relatively easy to understand and configure, and uses existing 
components. But perhaps X-Remote-User is "out of scope" for RemoteIPValve?


Another way would be to add tomcatAuthentication="false" as an option 
for the HTTP connector. It would behave like its AJP twin, except it 
would look in HTTP headers for ... X-Remote-User? REMOTE_USER? Somethign 
user-configurable? While this option mirrors the way it's done for AJP, 
I don't like it as much as using RemoteIPValve, if for no other reason 
than it has nothing to do with the connector itself and the 
RemoteIPValve already has similar configuration options for setting the 
names of special HTTP headers.


We could introduce a new Valve that just does this, and maybe adds other 
things later that we find are also missing. This introduces a completely 
new component, makes the valve chain even longer, etc. and so I still 
favor adding this to RemoteIPValve.


Thoughts?

Thanks,
-chris


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



Planning for 8.5.final

2024-03-06 Thread Christopher Schultz

All,

I was wondering if anyone had any thoughts on adding anything to 
8.5.final (likely .100) to indicate that the build was the last in the 
series. Of course, we will advertise EOL on the web site, etc. but I was 
thinking something more runtime-oriented.


Would it be okay to add an INFO log on startup that says "8.5.x has 
reached EOL and you should consider upgrading to 9.0 or later. Bug fixes 
including security fixes are unlikely to be released for 8.5.x after 
2024-03-31."


Perhaps that's too annoying?

I'm even thinking that we might want to bake this kind of thing into all 
releases. Every release knows its release-date, and we could have a 
start message that warns the user whenever the release-date gets to be 
reasonably far in the past. Say, 6 months. Or a year. Something 
"reasonable". Just in case nobody bothers to upgrade to x.y.final to see 
this kind of message.


Any thoughts?

-chris

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



Re: March releases

2024-03-06 Thread Christopher Schultz

Mark,

On 3/5/24 07:18, Mark Thomas wrote:

On 27/02/2024 09:29, Christopher Schultz wrote:

Mark,

On 2/27/24 06:20, Mark Thomas wrote:

On 27/02/2024 10:57, Rémy Maucherat wrote:

On Tue, Feb 27, 2024 at 10:12 AM Mark Thomas  wrote:


All,

When I look at the current change logs there isn't much there to 
justify

a March release. There are a couple of open bugs of which one looks
likely that there is an actual issue to be fixed.

That said, I'm unlikely to be in a position to tag 11.0.x until w/c 11
March. The change log may look different at that point.

It is probably too early to make a decision but I wanted to float the
possibility of skipping the March release. That would mean we'd 
probably

need to make the final 8.5.x release in April.


We don't need to always release all branches every time.


Good point.


For example, 11 already has two useful fixes right now: support for
Java 17 (one could want to verify it), then the FFM fix I made (using
the wrong loader in one location means it simply breaks depending on
how OpenSSL is loaded, so that's bad). But these two are not in the
other branches.


Ack. Those are good reasons for an 11.0.x release.

I just checked the dependencies - there are no updates at the moment.


As for a final 8.5, I would say it is not mandatory if there's nothing
useful in the changelog by the end of March. There's always going to
be a final final fix needed anyway. I started skipping some backports
to 8.5 since "regressions, who knows".


I was just thinking .100 was a nice point release to end on ;)


Yeah, me too ;)

I think we should release 8.5.100 in March, if only to meet our own 
goal of "ending support at the end of March". There isn't likely to be 
anything so important that it needs to be added after that.


We made a few exceptions for Tomcats 6, 7, and 8.0 for security 
issues, but I think there's no reason not to release 8.5.100 during 
March. I don't mind waiting until later in the month just in case 
anything comes up. Plus we can always change our minds and release 
again if there is something vital.


Following up on this, I think the bug fix for BZ 68495 does make it 
worth doing a set of releases this month.


The dependencies are up to date, I've just updated the translations and 
we don't have any open bugs at the moment.


There is the sproadic test failure issue that Rainer highlighted.

My plan, as I am not in a huge rush since the Feb releases were so late 
and I am travelling this week, is to look at that issue, check the unit 
tests all pass on the usual set of platforms and then tag 11.0.x.


I've just realised I don't have access to MacOS on Intel until the end 
of the week so I'm thinking tag 11.0.x on Friday if everything else goes 
to plan.


I have two Intel Macs where I can run unit tests for you if you are 
excited about getting started sooner.


But I agree: there is no rush. Releasing 8.5.x toward the end of the 
month is preferable just in case we discover something else we'd really 
like to fix.


-chris

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



(tomcat) 01/03: Look up response wrappers to suspend

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

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

commit 1b4ed5d618614bc4ec5f065620f7b6f9b5c91774
Author: remm 
AuthorDate: Mon Mar 4 10:17:39 2024 +0100

Look up response wrappers to suspend

BZ 68634 shows the implications and behavior difference between suspend
and close for response generation.
A flag could be added to make this optional if needed. I will delay
backporting this to other branches since this is a behavior change.
---
 .../apache/catalina/core/ApplicationDispatcher.java  | 20 +++-
 .../org/apache/catalina/core/LocalStrings.properties |  1 +
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/core/ApplicationDispatcher.java 
b/java/org/apache/catalina/core/ApplicationDispatcher.java
index 149ba52ca1..eff85041f6 100644
--- a/java/org/apache/catalina/core/ApplicationDispatcher.java
+++ b/java/org/apache/catalina/core/ApplicationDispatcher.java
@@ -351,16 +351,26 @@ final class ApplicationDispatcher implements 
AsyncDispatcher, RequestDispatcher
 wrapper.getLogger().trace(" Disabling the response for further 
output");
 }
 
+boolean finished = false;
 if (response instanceof ResponseFacade) {
+finished = true;
 ((ResponseFacade) response).finish();
-} else {
+} else if (response instanceof ServletResponseWrapper) {
+ServletResponse baseResponse = response;
+do {
+baseResponse = ((ServletResponseWrapper) 
baseResponse).getResponse();
+} while (baseResponse instanceof ServletResponseWrapper);
+if (baseResponse instanceof ResponseFacade) {
+finished = true;
+((ResponseFacade) baseResponse).finish();
+}
+}
+if (!finished) {
 // Servlet SRV.6.2.2. The Request/Response may have been wrapped
 // and may no longer be instance of RequestFacade
-if (wrapper.getLogger().isTraceEnabled()) {
-wrapper.getLogger()
-.trace(" The Response is vehiculed using a wrapper: " 
+ response.getClass().getName());
+if (wrapper.getLogger().isDebugEnabled()) {
+
wrapper.getLogger().debug(sm.getString("applicationDispatcher.customResponse", 
response.getClass()));
 }
-
 // Close anyway
 try {
 PrintWriter writer = response.getWriter();
diff --git a/java/org/apache/catalina/core/LocalStrings.properties 
b/java/org/apache/catalina/core/LocalStrings.properties
index 2b00ecfdd8..b6bee67cb6 100644
--- a/java/org/apache/catalina/core/LocalStrings.properties
+++ b/java/org/apache/catalina/core/LocalStrings.properties
@@ -42,6 +42,7 @@ applicationContext.setSessionTracking.iae.ssl=The session 
tracking modes request
 applicationContext.setSessionTracking.ise=The session tracking modes for 
context [{0}] cannot be set whilst the context is running
 
 applicationDispatcher.allocateException=Allocate exception for servlet [{0}]
+applicationDispatcher.customResponse=The response class [{0}] could not be 
unwraped to the Catalina response class and will be closed immediately after 
the forward
 applicationDispatcher.deallocateException=Deallocate exception for servlet 
[{0}]
 applicationDispatcher.forward.ise=Cannot forward after response has been 
committed
 applicationDispatcher.isUnavailable=Servlet [{0}] is currently unavailable


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



(tomcat) branch 10.1.x updated (84a3732fd2 -> 6f85b32c54)

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

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


from 84a3732fd2 Fix typo
 new 1b4ed5d618 Look up response wrappers to suspend
 new 8529dec650 Changelog for previous change
 new 6f85b32c54 Add new suspendWrappedResponseAfterForward

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/catalina/Context.java   | 17 +
 .../apache/catalina/core/ApplicationDispatcher.java | 21 -
 .../apache/catalina/core/LocalStrings.properties|  1 +
 java/org/apache/catalina/core/StandardContext.java  | 14 ++
 java/org/apache/catalina/startup/FailedContext.java |  9 +
 test/org/apache/tomcat/unittest/TesterContext.java  |  5 +
 webapps/docs/changelog.xml  |  7 +++
 webapps/docs/config/context.xml |  7 +++
 8 files changed, 76 insertions(+), 5 deletions(-)


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



(tomcat) 03/03: Add new suspendWrappedResponseAfterForward

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

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

commit 6f85b32c545539f36266ef83218d85c9656ae6a9
Author: remm 
AuthorDate: Wed Mar 6 11:44:14 2024 +0100

Add new suspendWrappedResponseAfterForward

This allow configuring the suspend after forward unwrapping.
---
 java/org/apache/catalina/Context.java   | 17 +
 .../org/apache/catalina/core/ApplicationDispatcher.java |  3 ++-
 java/org/apache/catalina/core/StandardContext.java  | 14 ++
 java/org/apache/catalina/startup/FailedContext.java |  9 +
 test/org/apache/tomcat/unittest/TesterContext.java  |  5 +
 webapps/docs/changelog.xml  |  5 -
 webapps/docs/config/context.xml |  7 +++
 7 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/Context.java 
b/java/org/apache/catalina/Context.java
index fb50454dcc..2f66fb46c5 100644
--- a/java/org/apache/catalina/Context.java
+++ b/java/org/apache/catalina/Context.java
@@ -1994,6 +1994,23 @@ public interface Context extends Container, ContextBind {
 void setDispatcherWrapsSameObject(boolean dispatcherWrapsSameObject);
 
 
+/**
+ * If this is true, then following a forward the response will
+ * be unwrapped to suspend the Catalina response instead of simply closing
+ * the top level response. The default value is true.
+ * @return the flag value
+ */
+boolean getSuspendWrappedResponseAfterForward();
+
+
+/**
+ * Allows unwrapping the response object to suspend the response following
+ * a forward.
+ * @param suspendWrappedResponseAfterForward the new flag value
+ */
+void setSuspendWrappedResponseAfterForward(boolean 
suspendWrappedResponseAfterForward);
+
+
 /**
  * Find configuration file with the specified path, first looking into the
  * webapp resources, then delegating to
diff --git a/java/org/apache/catalina/core/ApplicationDispatcher.java 
b/java/org/apache/catalina/core/ApplicationDispatcher.java
index eff85041f6..abb7b2fe4d 100644
--- a/java/org/apache/catalina/core/ApplicationDispatcher.java
+++ b/java/org/apache/catalina/core/ApplicationDispatcher.java
@@ -355,7 +355,8 @@ final class ApplicationDispatcher implements 
AsyncDispatcher, RequestDispatcher
 if (response instanceof ResponseFacade) {
 finished = true;
 ((ResponseFacade) response).finish();
-} else if (response instanceof ServletResponseWrapper) {
+} else if (context.getSuspendWrappedResponseAfterForward()
+&& response instanceof ServletResponseWrapper) {
 ServletResponse baseResponse = response;
 do {
 baseResponse = ((ServletResponseWrapper) 
baseResponse).getResponse();
diff --git a/java/org/apache/catalina/core/StandardContext.java 
b/java/org/apache/catalina/core/StandardContext.java
index 698dadf132..4f13b69a3f 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -798,6 +798,8 @@ public class StandardContext extends ContainerBase 
implements Context, Notificat
 
 private boolean dispatcherWrapsSameObject = 
Globals.STRICT_SERVLET_COMPLIANCE;
 
+private boolean suspendWrappedResponseAfterForward = false;
+
 private boolean parallelAnnotationScanning = false;
 
 private boolean useBloomFilterForArchives = false;
@@ -881,6 +883,18 @@ public class StandardContext extends ContainerBase 
implements Context, Notificat
 }
 
 
+@Override
+public boolean getSuspendWrappedResponseAfterForward() {
+return suspendWrappedResponseAfterForward;
+}
+
+
+@Override
+public void setSuspendWrappedResponseAfterForward(boolean 
suspendWrappedResponseAfterForward) {
+this.suspendWrappedResponseAfterForward = 
suspendWrappedResponseAfterForward;
+}
+
+
 @Override
 public String getRequestCharacterEncoding() {
 return requestEncoding;
diff --git a/java/org/apache/catalina/startup/FailedContext.java 
b/java/org/apache/catalina/startup/FailedContext.java
index eb249a1d16..6ca2063a46 100644
--- a/java/org/apache/catalina/startup/FailedContext.java
+++ b/java/org/apache/catalina/startup/FailedContext.java
@@ -1425,4 +1425,13 @@ public class FailedContext extends LifecycleMBeanBase 
implements Context {
 public void setUseBloomFilterForArchives(boolean 
useBloomFilterForArchives) {
 }
 
+@Override
+public boolean getSuspendWrappedResponseAfterForward() {
+return false;
+}
+
+@Override
+public void setSuspendWrappedResponseAfterForward(boolean 
suspendWrappedResponseAfterForward) {
+}
+
 }
\ No newline at end of file
diff --git a/test/org/apache/tomcat/unittest/TesterContext.java 
b/test/org/apache/tomcat/unittest/TesterContext.java

(tomcat) 02/03: Changelog for previous change

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

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

commit 8529dec6507f66ab3f53b27a89675b75d73ac5b1
Author: remm 
AuthorDate: Mon Mar 4 12:38:30 2024 +0100

Changelog for previous change
---
 webapps/docs/changelog.xml | 4 
 1 file changed, 4 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 7bd567dffe..a3738aaac3 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -128,6 +128,10 @@
 FORM authentication, ensure that neither the URI, the query string nor
 the protocol are corrupted when restoring the request body. (markt)
   
+  
+After forwarding a request, attempt to unwrap the response in order to
+suspend it, instead of simply closing it if it was wrapped. (remm)
+  
 
   
   


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



Re: (tomcat) 03/03: Add new suspendWrappedResponseAfterForward

2024-03-06 Thread Christopher Schultz

Rémy,

On 3/6/24 09:02, r...@apache.org wrote:

This is an automated email from the ASF dual-hosted git repository.

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

commit 6f85b32c545539f36266ef83218d85c9656ae6a9
Author: remm 
AuthorDate: Wed Mar 6 11:44:14 2024 +0100

 Add new suspendWrappedResponseAfterForward
 
 This allow configuring the suspend after forward unwrapping.

---
  java/org/apache/catalina/Context.java   | 17 +
  .../org/apache/catalina/core/ApplicationDispatcher.java |  3 ++-
  java/org/apache/catalina/core/StandardContext.java  | 14 ++
  java/org/apache/catalina/startup/FailedContext.java |  9 +
  test/org/apache/tomcat/unittest/TesterContext.java  |  5 +
  webapps/docs/changelog.xml  |  5 -
  webapps/docs/config/context.xml |  7 +++
  7 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/Context.java 
b/java/org/apache/catalina/Context.java
index fb50454dcc..2f66fb46c5 100644
--- a/java/org/apache/catalina/Context.java
+++ b/java/org/apache/catalina/Context.java
@@ -1994,6 +1994,23 @@ public interface Context extends Container, ContextBind {
  void setDispatcherWrapsSameObject(boolean dispatcherWrapsSameObject);
  
  
+/**

+ * If this is true, then following a forward the response will
+ * be unwrapped to suspend the Catalina response instead of simply closing
+ * the top level response. The default value is true.
+ * @return the flag value
+ */
+boolean getSuspendWrappedResponseAfterForward();
+
+
+/**
+ * Allows unwrapping the response object to suspend the response following
+ * a forward.
+ * @param suspendWrappedResponseAfterForward the new flag value
+ */
+void setSuspendWrappedResponseAfterForward(boolean 
suspendWrappedResponseAfterForward);
+
+
  /**
   * Find configuration file with the specified path, first looking into the
   * webapp resources, then delegating to
diff --git a/java/org/apache/catalina/core/ApplicationDispatcher.java 
b/java/org/apache/catalina/core/ApplicationDispatcher.java
index eff85041f6..abb7b2fe4d 100644
--- a/java/org/apache/catalina/core/ApplicationDispatcher.java
+++ b/java/org/apache/catalina/core/ApplicationDispatcher.java
@@ -355,7 +355,8 @@ final class ApplicationDispatcher implements 
AsyncDispatcher, RequestDispatcher
  if (response instanceof ResponseFacade) {
  finished = true;
  ((ResponseFacade) response).finish();
-} else if (response instanceof ServletResponseWrapper) {
+} else if (context.getSuspendWrappedResponseAfterForward()
+&& response instanceof ServletResponseWrapper) {
  ServletResponse baseResponse = response;
  do {
  baseResponse = ((ServletResponseWrapper) 
baseResponse).getResponse();
diff --git a/java/org/apache/catalina/core/StandardContext.java 
b/java/org/apache/catalina/core/StandardContext.java
index 698dadf132..4f13b69a3f 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -798,6 +798,8 @@ public class StandardContext extends ContainerBase 
implements Context, Notificat
  
  private boolean dispatcherWrapsSameObject = Globals.STRICT_SERVLET_COMPLIANCE;
  
+private boolean suspendWrappedResponseAfterForward = false;

+
  private boolean parallelAnnotationScanning = false;
  
  private boolean useBloomFilterForArchives = false;

@@ -881,6 +883,18 @@ public class StandardContext extends ContainerBase 
implements Context, Notificat
  }
  
  
+@Override

+public boolean getSuspendWrappedResponseAfterForward() {
+return suspendWrappedResponseAfterForward;
+}
+
+
+@Override
+public void setSuspendWrappedResponseAfterForward(boolean 
suspendWrappedResponseAfterForward) {
+this.suspendWrappedResponseAfterForward = 
suspendWrappedResponseAfterForward;
+}
+
+
  @Override
  public String getRequestCharacterEncoding() {
  return requestEncoding;
diff --git a/java/org/apache/catalina/startup/FailedContext.java 
b/java/org/apache/catalina/startup/FailedContext.java
index eb249a1d16..6ca2063a46 100644
--- a/java/org/apache/catalina/startup/FailedContext.java
+++ b/java/org/apache/catalina/startup/FailedContext.java
@@ -1425,4 +1425,13 @@ public class FailedContext extends LifecycleMBeanBase 
implements Context {
  public void setUseBloomFilterForArchives(boolean 
useBloomFilterForArchives) {
  }
  
+@Override

+public boolean getSuspendWrappedResponseAfterForward() {
+return false;
+}
+
+@Override
+public void setSuspendWrappedResponseAfterForward(boolean 
suspendWrappedResponseAfterForward) {
+}
+
  }
\ No newline at end of file
diff --git a/test/org/apa

(tomcat) branch 10.1.x updated: Fix javadoc

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

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 7596132693 Fix javadoc
7596132693 is described below

commit 759613269349b62706a8c994d753f2a213d845e5
Author: remm 
AuthorDate: Wed Mar 6 19:44:42 2024 +0100

Fix javadoc
---
 java/org/apache/catalina/Context.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/Context.java 
b/java/org/apache/catalina/Context.java
index 2f66fb46c5..d91556cb25 100644
--- a/java/org/apache/catalina/Context.java
+++ b/java/org/apache/catalina/Context.java
@@ -1997,7 +1997,7 @@ public interface Context extends Container, ContextBind {
 /**
  * If this is true, then following a forward the response will
  * be unwrapped to suspend the Catalina response instead of simply closing
- * the top level response. The default value is true.
+ * the top level response. The default value is false.
  * @return the flag value
  */
 boolean getSuspendWrappedResponseAfterForward();


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



[Bug 68720] New: Troubleshooting Tomcat: Addressing Compression Issues with Firefox 'NS_ERROR_NET_PARTIAL_TRANSFER' Error

2024-03-06 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68720

Bug ID: 68720
   Summary: Troubleshooting Tomcat: Addressing Compression Issues
with Firefox 'NS_ERROR_NET_PARTIAL_TRANSFER' Error
   Product: Tomcat Connectors
   Version: unspecified
  Hardware: PC
OS: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Common
  Assignee: dev@tomcat.apache.org
  Reporter: rootcause...@gmail.com
  Target Milestone: ---

Tomcat version : 9.0.82
Java : Open JDK 1.8.0_362
While loading the webclient UI, the javascript files were uncompressed over
response when h2 protocol is in use. In order to resolve the same, configured
compression="force" and it's related attributes in the UpgradeProtocol
component similar to the Connector component in tomcats server.xml file.

The confiugration is as follows,



 

  



OS : Windows 11
Firefox version : 123.0.1
Chrome version : 121.0.6167.185
Edge version : 122.0.2365.66

While testing the compression behavior with multiple browsers, faced
"NS_ERROR_NET_PARTIAL_TRANSFER" error from firefox for few .js, .svg and .ttf
files which resulted in broken UI. The following error trace found in catalina
logs at the same time.

[00:02:02:822]|[03-07-2024]|[org.apache.coyote.http2.Http2UpgradeHandler]|[INFO]|[338]:
Connection [91], Stream [29] Closed due to error
 Note: further occurrences of HTTP/2 stream errors will be logged at DEBUG
level.| 
org.apache.coyote.http2.StreamException: Connection [91], Stream [29], State
[CLOSED_RST_RX], Frame type [RST]
at
org.apache.coyote.http2.StreamStateMachine.checkFrameType(StreamStateMachine.java:127)
at
org.apache.coyote.http2.AbstractNonZeroStream.checkState(AbstractNonZeroStream.java:50)
at
org.apache.coyote.http2.Http2UpgradeHandler.reset(Http2UpgradeHandler.java:1711)
at
org.apache.coyote.http2.Http2AsyncUpgradeHandler.reset(Http2AsyncUpgradeHandler.java:43)
Upon refresh, the UI loaded properly in firefox browser. This is not faced
everytime when loading the UI, but intermittently. The same is working fine in
Chrome and Edge browsers.

Is there anything to be handled in configuration level to resolve this error?

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



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

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

--- Comment #11 from John Engebretson  ---
These changes reached prod and eliminated the respective profiles.

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



[Bug 68546] Performance optimization in PageContextImpl.getELContext()

2024-03-06 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68546

--- Comment #4 from John Engebretson  ---
This changed reached prod and had the (small) expected impact.  Thanks!

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



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

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

--- Comment #13 from John Engebretson  ---
This changed reached prod and improved performance.  Low impact.

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