[tomcat] branch 8.5.x updated: Improve error message

2022-08-23 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 3e45f1a6f6 Improve error message
3e45f1a6f6 is described below

commit 3e45f1a6f66d4e0601e7d13f2ebf0588a7ae8eee
Author: Mark Thomas 
AuthorDate: Tue Aug 23 17:38:58 2022 +0100

Improve error message
---
 java/org/apache/coyote/http2/Http2Parser.java  | 6 --
 java/org/apache/coyote/http2/LocalStrings.properties   | 2 +-
 java/org/apache/coyote/http2/LocalStrings_fr.properties| 2 +-
 java/org/apache/coyote/http2/LocalStrings_ja.properties| 2 +-
 java/org/apache/coyote/http2/LocalStrings_ko.properties| 2 +-
 java/org/apache/coyote/http2/LocalStrings_zh_CN.properties | 2 +-
 6 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2Parser.java 
b/java/org/apache/coyote/http2/Http2Parser.java
index bab0ae1408..97bd0d4ed7 100644
--- a/java/org/apache/coyote/http2/Http2Parser.java
+++ b/java/org/apache/coyote/http2/Http2Parser.java
@@ -376,11 +376,13 @@ class Http2Parser {
 if (windowSizeIncrement == 0) {
 if (streamId == 0) {
 throw new ConnectionException(
-
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement"),
+
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement",
+connectionId, Integer.toString(streamId)),
 Http2Error.PROTOCOL_ERROR);
 } else {
 throw new StreamException(
-
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement"),
+
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement",
+connectionId, Integer.toString(streamId)),
 Http2Error.PROTOCOL_ERROR, streamId);
 }
 }
diff --git a/java/org/apache/coyote/http2/LocalStrings.properties 
b/java/org/apache/coyote/http2/LocalStrings.properties
index c0b192b80f..32d14f657e 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -75,7 +75,7 @@ http2Parser.processFramePriority.invalidParent=Connection 
[{0}], Stream [{1}], A
 http2Parser.processFramePushPromise=Connection [{0}], Stream [{1}], Push 
promise frames should not be sent by the client
 http2Parser.processFrameSettings.ackWithNonZeroPayload=Settings frame received 
with the ACK flag set and payload present
 http2Parser.processFrameWindowUpdate.debug=Connection [{0}], Stream [{1}], 
Window size increment [{2}]
-http2Parser.processFrameWindowUpdate.invalidIncrement=Window update frame 
received with an invalid increment size of [{0}]
+http2Parser.processFrameWindowUpdate.invalidIncrement=Connection [{0}], Stream 
[{1}], Window update frame received with an invalid increment size of [0].
 http2Parser.swallow.debug=Connection [{0}], Stream [{1}], Swallowed [{2}] bytes
 
 http2Protocol.jmxRegistration.fail=JMX registration for the HTTP/2 protocol 
failed
diff --git a/java/org/apache/coyote/http2/LocalStrings_fr.properties 
b/java/org/apache/coyote/http2/LocalStrings_fr.properties
index 5c1dedd254..d36f89e44a 100644
--- a/java/org/apache/coyote/http2/LocalStrings_fr.properties
+++ b/java/org/apache/coyote/http2/LocalStrings_fr.properties
@@ -75,7 +75,7 @@ http2Parser.processFramePriority.invalidParent=Connection 
[{0}], Flux [{1}], Un
 http2Parser.processFramePushPromise=Connexion [{0}], Flux (Stream) [{1}], les 
trames de promesse d''envoi ("Push promise frames") ne doivent pas être 
envoyées par le client.
 http2Parser.processFrameSettings.ackWithNonZeroPayload=La trame de paramètres 
a été reçue avec un indicateur ACK activé et des données présentes
 http2Parser.processFrameWindowUpdate.debug=Connection [{0}], Flux [{1}], 
Incrémentation de [{2}] de la taille de fenêtre
-http2Parser.processFrameWindowUpdate.invalidIncrement=La trame de mise à jour 
de la fenêtre a été reçue avec un incrément invalide [{0}]
+http2Parser.processFrameWindowUpdate.invalidIncrement=La trame de mise à jour 
de la fenêtre a été reçue avec un incrément invalide [0]
 http2Parser.swallow.debug=Connection [{0}], Flux [{1}], Avalé [{2}] octets
 
 http2Protocol.jmxRegistration.fail=L'enregistrement dans JMX du protocole 
HTTP/2 a échoué
diff --git a/java/org/apache/coyote/http2/LocalStrings_ja.properties 
b/java/org/apache/coyote/http2/LocalStrings_ja.properties
index c5e6d2c7eb..7cfbff4c6d 100644
--- a/java/org/apache/coyote/http2/LocalStrings_ja.properties
+++ b/java/org/apache/coyote/http2/LocalStrings_ja.properties
@@ -75,7 +75,7 @@ http2Parser.processFramePriority.invalidParent=コネクション [{0}]、スト
 http2Parser.processFramePushPromise=コネクション [{0}]、ストリーム [{1}]、クライアントから 
PUSH_PROMISE 

[tomcat] branch 10.0.x updated: Improve error message

2022-08-23 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 5bbd679c8e Improve error message
5bbd679c8e is described below

commit 5bbd679c8ed9316807eb05bc82b7bdc19e6abc8e
Author: Mark Thomas 
AuthorDate: Tue Aug 23 17:38:58 2022 +0100

Improve error message
---
 java/org/apache/coyote/http2/Http2Parser.java  | 6 --
 java/org/apache/coyote/http2/LocalStrings.properties   | 2 +-
 java/org/apache/coyote/http2/LocalStrings_fr.properties| 2 +-
 java/org/apache/coyote/http2/LocalStrings_ja.properties| 2 +-
 java/org/apache/coyote/http2/LocalStrings_ko.properties| 2 +-
 java/org/apache/coyote/http2/LocalStrings_zh_CN.properties | 2 +-
 6 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2Parser.java 
b/java/org/apache/coyote/http2/Http2Parser.java
index 9a4bf0c9bb..c03a17a5e9 100644
--- a/java/org/apache/coyote/http2/Http2Parser.java
+++ b/java/org/apache/coyote/http2/Http2Parser.java
@@ -417,11 +417,13 @@ class Http2Parser {
 if (windowSizeIncrement == 0) {
 if (streamId == 0) {
 throw new ConnectionException(
-
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement"),
+
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement",
+connectionId, Integer.toString(streamId)),
 Http2Error.PROTOCOL_ERROR);
 } else {
 throw new StreamException(
-
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement"),
+
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement",
+connectionId, Integer.toString(streamId)),
 Http2Error.PROTOCOL_ERROR, streamId);
 }
 }
diff --git a/java/org/apache/coyote/http2/LocalStrings.properties 
b/java/org/apache/coyote/http2/LocalStrings.properties
index 62f3f189bb..098afef83e 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -76,7 +76,7 @@ http2Parser.processFramePriority.invalidParent=Connection 
[{0}], Stream [{1}], A
 http2Parser.processFramePushPromise=Connection [{0}], Stream [{1}], Push 
promise frames should not be sent by the client
 http2Parser.processFrameSettings.ackWithNonZeroPayload=Settings frame received 
with the ACK flag set and payload present
 http2Parser.processFrameWindowUpdate.debug=Connection [{0}], Stream [{1}], 
Window size increment [{2}]
-http2Parser.processFrameWindowUpdate.invalidIncrement=Window update frame 
received with an invalid increment size of [{0}]
+http2Parser.processFrameWindowUpdate.invalidIncrement=Connection [{0}], Stream 
[{1}], Window update frame received with an invalid increment size of [0].
 http2Parser.swallow.debug=Connection [{0}], Stream [{1}], Swallowed [{2}] bytes
 
 http2Protocol.jmxRegistration.fail=JMX registration for the HTTP/2 protocol 
failed
diff --git a/java/org/apache/coyote/http2/LocalStrings_fr.properties 
b/java/org/apache/coyote/http2/LocalStrings_fr.properties
index be7d040793..4f54e7221a 100644
--- a/java/org/apache/coyote/http2/LocalStrings_fr.properties
+++ b/java/org/apache/coyote/http2/LocalStrings_fr.properties
@@ -76,7 +76,7 @@ http2Parser.processFramePriority.invalidParent=Connection 
[{0}], Flux [{1}], Un
 http2Parser.processFramePushPromise=Connexion [{0}], Flux (Stream) [{1}], les 
trames de promesse d''envoi ("Push promise frames") ne doivent pas être 
envoyées par le client.
 http2Parser.processFrameSettings.ackWithNonZeroPayload=La trame de paramètres 
a été reçue avec un indicateur ACK activé et des données présentes
 http2Parser.processFrameWindowUpdate.debug=Connection [{0}], Flux [{1}], 
Incrémentation de [{2}] de la taille de fenêtre
-http2Parser.processFrameWindowUpdate.invalidIncrement=La trame de mise à jour 
de la fenêtre a été reçue avec un incrément invalide [{0}]
+http2Parser.processFrameWindowUpdate.invalidIncrement=La trame de mise à jour 
de la fenêtre a été reçue avec un incrément invalide [0]
 http2Parser.swallow.debug=Connection [{0}], Flux [{1}], Avalé [{2}] octets
 
 http2Protocol.jmxRegistration.fail=L'enregistrement dans JMX du protocole 
HTTP/2 a échoué
diff --git a/java/org/apache/coyote/http2/LocalStrings_ja.properties 
b/java/org/apache/coyote/http2/LocalStrings_ja.properties
index f4f7aa9b66..c87c0a167f 100644
--- a/java/org/apache/coyote/http2/LocalStrings_ja.properties
+++ b/java/org/apache/coyote/http2/LocalStrings_ja.properties
@@ -76,7 +76,7 @@ http2Parser.processFramePriority.invalidParent=コネクション [{0}]、スト
 http2Parser.processFramePushPromise=コネクション [{0}]、ストリーム [{1}]、クライアントから 
PUSH_PROMISE 

[tomcat] branch 9.0.x updated: Improve error message

2022-08-23 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 441e2bbfaa Improve error message
441e2bbfaa is described below

commit 441e2bbfaa2e81c825687091ca640b0b2f27f8b6
Author: Mark Thomas 
AuthorDate: Tue Aug 23 17:38:58 2022 +0100

Improve error message
---
 java/org/apache/coyote/http2/Http2Parser.java  | 6 --
 java/org/apache/coyote/http2/LocalStrings.properties   | 2 +-
 java/org/apache/coyote/http2/LocalStrings_fr.properties| 2 +-
 java/org/apache/coyote/http2/LocalStrings_ja.properties| 2 +-
 java/org/apache/coyote/http2/LocalStrings_ko.properties| 2 +-
 java/org/apache/coyote/http2/LocalStrings_zh_CN.properties | 2 +-
 6 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2Parser.java 
b/java/org/apache/coyote/http2/Http2Parser.java
index 0fd6acb47d..868e4fe379 100644
--- a/java/org/apache/coyote/http2/Http2Parser.java
+++ b/java/org/apache/coyote/http2/Http2Parser.java
@@ -417,11 +417,13 @@ class Http2Parser {
 if (windowSizeIncrement == 0) {
 if (streamId == 0) {
 throw new ConnectionException(
-
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement"),
+
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement",
+connectionId, Integer.toString(streamId)),
 Http2Error.PROTOCOL_ERROR);
 } else {
 throw new StreamException(
-
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement"),
+
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement",
+connectionId, Integer.toString(streamId)),
 Http2Error.PROTOCOL_ERROR, streamId);
 }
 }
diff --git a/java/org/apache/coyote/http2/LocalStrings.properties 
b/java/org/apache/coyote/http2/LocalStrings.properties
index 62f3f189bb..098afef83e 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -76,7 +76,7 @@ http2Parser.processFramePriority.invalidParent=Connection 
[{0}], Stream [{1}], A
 http2Parser.processFramePushPromise=Connection [{0}], Stream [{1}], Push 
promise frames should not be sent by the client
 http2Parser.processFrameSettings.ackWithNonZeroPayload=Settings frame received 
with the ACK flag set and payload present
 http2Parser.processFrameWindowUpdate.debug=Connection [{0}], Stream [{1}], 
Window size increment [{2}]
-http2Parser.processFrameWindowUpdate.invalidIncrement=Window update frame 
received with an invalid increment size of [{0}]
+http2Parser.processFrameWindowUpdate.invalidIncrement=Connection [{0}], Stream 
[{1}], Window update frame received with an invalid increment size of [0].
 http2Parser.swallow.debug=Connection [{0}], Stream [{1}], Swallowed [{2}] bytes
 
 http2Protocol.jmxRegistration.fail=JMX registration for the HTTP/2 protocol 
failed
diff --git a/java/org/apache/coyote/http2/LocalStrings_fr.properties 
b/java/org/apache/coyote/http2/LocalStrings_fr.properties
index be7d040793..4f54e7221a 100644
--- a/java/org/apache/coyote/http2/LocalStrings_fr.properties
+++ b/java/org/apache/coyote/http2/LocalStrings_fr.properties
@@ -76,7 +76,7 @@ http2Parser.processFramePriority.invalidParent=Connection 
[{0}], Flux [{1}], Un
 http2Parser.processFramePushPromise=Connexion [{0}], Flux (Stream) [{1}], les 
trames de promesse d''envoi ("Push promise frames") ne doivent pas être 
envoyées par le client.
 http2Parser.processFrameSettings.ackWithNonZeroPayload=La trame de paramètres 
a été reçue avec un indicateur ACK activé et des données présentes
 http2Parser.processFrameWindowUpdate.debug=Connection [{0}], Flux [{1}], 
Incrémentation de [{2}] de la taille de fenêtre
-http2Parser.processFrameWindowUpdate.invalidIncrement=La trame de mise à jour 
de la fenêtre a été reçue avec un incrément invalide [{0}]
+http2Parser.processFrameWindowUpdate.invalidIncrement=La trame de mise à jour 
de la fenêtre a été reçue avec un incrément invalide [0]
 http2Parser.swallow.debug=Connection [{0}], Flux [{1}], Avalé [{2}] octets
 
 http2Protocol.jmxRegistration.fail=L'enregistrement dans JMX du protocole 
HTTP/2 a échoué
diff --git a/java/org/apache/coyote/http2/LocalStrings_ja.properties 
b/java/org/apache/coyote/http2/LocalStrings_ja.properties
index f4f7aa9b66..c87c0a167f 100644
--- a/java/org/apache/coyote/http2/LocalStrings_ja.properties
+++ b/java/org/apache/coyote/http2/LocalStrings_ja.properties
@@ -76,7 +76,7 @@ http2Parser.processFramePriority.invalidParent=コネクション [{0}]、スト
 http2Parser.processFramePushPromise=コネクション [{0}]、ストリーム [{1}]、クライアントから 
PUSH_PROMISE 

[Bug 66191] compile taglibs that are not (yet) included in jsp file

2022-08-23 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66191

Mark Thomas  changed:

   What|Removed |Added

   Severity|normal  |enhancement

--- Comment #2 from Mark Thomas  ---
Moving this to an enhancement.

Given that the compilation of the tag files is simply a means to an ends
(dependency management) I wonder if there is a simpler solution.

-- 
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-jakartaee-migration] wmccusker commented on a diff in pull request #33: fixes #32 check if file name ends with manifest name

2022-08-23 Thread GitBox


wmccusker commented on code in PR #33:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/pull/33#discussion_r951564802


##
src/test/java/org/apache/tomcat/jakartaee/ManifestConverterTest.java:
##
@@ -0,0 +1,16 @@
+package org.apache.tomcat.jakartaee;
+
+import static org.junit.Assert.assertTrue;

Review Comment:
   I reviewed all the unit test code in the jakartaee package, and it appears 
that all of them use static imports for Assert. Since this static import is 
consistent with all other JUnit tests in the package and since it is limited to 
only the Assert class, does this address this comment?



-- 
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 66235] New: Java Beans Standard not honoured in EL expressions when running under Graal VM (JVM Runtime Mode)

2022-08-23 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66235

Bug ID: 66235
   Summary: Java Beans Standard not honoured in EL expressions
when running under Graal VM (JVM Runtime Mode)
   Product: Tomcat 9
   Version: 9.0.x
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Jasper
  Assignee: dev@tomcat.apache.org
  Reporter: matthias.hil...@mgm-tp.com
  Target Milestone: -

I recently tried to run an existing application under tomcat 9 with the Graal
VM in JVM Runtime Mode, that means not as an Native exceutable, see
https://www.graalvm.org/22.2/docs/introduction/#runtime-modes ).

I have a class similar like

public class MyBean {
  public String getText(Locale locale) { ... }
  public String getText() { ... }
}

When I use an EL expression like ${pageScope.mybean.text} it fails (returns
null/an empty string) under certain conditions.

I think the problem is the following:

a) the JasperELResolver uses an GraalBeanELResolver when it thinks it runs
under graal (see
https://github.com/apache/tomcat/blob/main/java/org/apache/jasper/el/JasperELResolver.java#L72
), I'm not sure if the GraalBeanELResolver would be really needed under Graal
VM in JVM Runtime mode as this one should support reflection. But at the moment
the JasperELResolver/JspRuntimeLibrary.GRAAL is configured to to so. 

b) the GraalBeanELResolver tries to find the getter of my property, see
https://github.com/apache/tomcat/blob/79173cfbcaf6e82972cce98fbdc619e227037ab8/java/org/apache/jasper/el/JasperELResolver.java#L243
, to do so it simply iterates over all methods and tries to find "getText", it
simply uses the first one. In my example above it depends on the order of
beanClass.getMethods() if this will succeed at the end.

I think the GraalBeanELResolver should use the same logic as the default
BeanELResolver which uses the java.beans.PropertyDescriptor.getReadMethod, this
means to:
  - only search for getters without arguments
  - also honor the special "is" logic for boolean arguments

I only checked the code for reading (getValue) at the moment, but I guess also
the setValue might have similar issues.

You might say that the above class MyBean is a bad architecture, but
nevertheless with Graal VM the application behaves different than with standard
JDK.

Above I wrote that the code fails in my case under "certain conditions". The
exact difference was that it only failed when I had an
"serletContext.setAttribute(ELInterpreterFactory.EL_INTERPRETER_CLASS_NAME,
someCustomElInterpreter);"
in place. Nevertheless, this custom el interpreter did not interprete this
special el expression on its own but used JspUtil.interpreterCall (which usees
the default mechanism). But while debugging I saw that the main difference was
the order of beanClass.getMethods() inside GraalBeanELResolver. I don't know
how this order is determined. But in my optinion the GraalBeanELResolver should
not rely on any specific order as the javadoc of getMethods says: "The elements
in the returned array are not sorted and are not in any particular order."

-- 
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 66235] Java Beans Standard not honoured in EL expressions when running under Graal VM (JVM Runtime Mode)

2022-08-23 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66235

matthias.hil...@mgm-tp.com changed:

   What|Removed |Added

 OS||All

--- Comment #1 from matthias.hil...@mgm-tp.com ---
By the way the commit integrating the GraalBeanELResolver already had an
comment about similar problems but it was ignored.
See
https://github.com/apache/tomcat/commit/4f5bdbc95f1ad1152396c615aab65b2137d30c7f#commitcomment-39709814

-- 
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 main updated: Improve error message

2022-08-23 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 6798a0058b Improve error message
6798a0058b is described below

commit 6798a0058b7d5f3640d8bb7f1af0865e6d3fc4e1
Author: Mark Thomas 
AuthorDate: Tue Aug 23 17:38:58 2022 +0100

Improve error message
---
 java/org/apache/coyote/http2/Http2Parser.java  | 6 --
 java/org/apache/coyote/http2/LocalStrings.properties   | 2 +-
 java/org/apache/coyote/http2/LocalStrings_fr.properties| 2 +-
 java/org/apache/coyote/http2/LocalStrings_ja.properties| 2 +-
 java/org/apache/coyote/http2/LocalStrings_ko.properties| 2 +-
 java/org/apache/coyote/http2/LocalStrings_zh_CN.properties | 2 +-
 6 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2Parser.java 
b/java/org/apache/coyote/http2/Http2Parser.java
index 9a4bf0c9bb..c03a17a5e9 100644
--- a/java/org/apache/coyote/http2/Http2Parser.java
+++ b/java/org/apache/coyote/http2/Http2Parser.java
@@ -417,11 +417,13 @@ class Http2Parser {
 if (windowSizeIncrement == 0) {
 if (streamId == 0) {
 throw new ConnectionException(
-
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement"),
+
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement",
+connectionId, Integer.toString(streamId)),
 Http2Error.PROTOCOL_ERROR);
 } else {
 throw new StreamException(
-
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement"),
+
sm.getString("http2Parser.processFrameWindowUpdate.invalidIncrement",
+connectionId, Integer.toString(streamId)),
 Http2Error.PROTOCOL_ERROR, streamId);
 }
 }
diff --git a/java/org/apache/coyote/http2/LocalStrings.properties 
b/java/org/apache/coyote/http2/LocalStrings.properties
index 62f3f189bb..098afef83e 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -76,7 +76,7 @@ http2Parser.processFramePriority.invalidParent=Connection 
[{0}], Stream [{1}], A
 http2Parser.processFramePushPromise=Connection [{0}], Stream [{1}], Push 
promise frames should not be sent by the client
 http2Parser.processFrameSettings.ackWithNonZeroPayload=Settings frame received 
with the ACK flag set and payload present
 http2Parser.processFrameWindowUpdate.debug=Connection [{0}], Stream [{1}], 
Window size increment [{2}]
-http2Parser.processFrameWindowUpdate.invalidIncrement=Window update frame 
received with an invalid increment size of [{0}]
+http2Parser.processFrameWindowUpdate.invalidIncrement=Connection [{0}], Stream 
[{1}], Window update frame received with an invalid increment size of [0].
 http2Parser.swallow.debug=Connection [{0}], Stream [{1}], Swallowed [{2}] bytes
 
 http2Protocol.jmxRegistration.fail=JMX registration for the HTTP/2 protocol 
failed
diff --git a/java/org/apache/coyote/http2/LocalStrings_fr.properties 
b/java/org/apache/coyote/http2/LocalStrings_fr.properties
index be7d040793..4f54e7221a 100644
--- a/java/org/apache/coyote/http2/LocalStrings_fr.properties
+++ b/java/org/apache/coyote/http2/LocalStrings_fr.properties
@@ -76,7 +76,7 @@ http2Parser.processFramePriority.invalidParent=Connection 
[{0}], Flux [{1}], Un
 http2Parser.processFramePushPromise=Connexion [{0}], Flux (Stream) [{1}], les 
trames de promesse d''envoi ("Push promise frames") ne doivent pas être 
envoyées par le client.
 http2Parser.processFrameSettings.ackWithNonZeroPayload=La trame de paramètres 
a été reçue avec un indicateur ACK activé et des données présentes
 http2Parser.processFrameWindowUpdate.debug=Connection [{0}], Flux [{1}], 
Incrémentation de [{2}] de la taille de fenêtre
-http2Parser.processFrameWindowUpdate.invalidIncrement=La trame de mise à jour 
de la fenêtre a été reçue avec un incrément invalide [{0}]
+http2Parser.processFrameWindowUpdate.invalidIncrement=La trame de mise à jour 
de la fenêtre a été reçue avec un incrément invalide [0]
 http2Parser.swallow.debug=Connection [{0}], Flux [{1}], Avalé [{2}] octets
 
 http2Protocol.jmxRegistration.fail=L'enregistrement dans JMX du protocole 
HTTP/2 a échoué
diff --git a/java/org/apache/coyote/http2/LocalStrings_ja.properties 
b/java/org/apache/coyote/http2/LocalStrings_ja.properties
index f4f7aa9b66..c87c0a167f 100644
--- a/java/org/apache/coyote/http2/LocalStrings_ja.properties
+++ b/java/org/apache/coyote/http2/LocalStrings_ja.properties
@@ -76,7 +76,7 @@ http2Parser.processFramePriority.invalidParent=コネクション [{0}]、スト
 http2Parser.processFramePushPromise=コネクション [{0}]、ストリーム [{1}]、クライアントから 
PUSH_PROMISE フレームを送信するべきではありません。

[Bug 66191] compile taglibs that are not (yet) included in jsp file

2022-08-23 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66191

--- Comment #3 from andreas.sta...@rmcon-int.de ---
> Given that the compilation of the tag files is simply a means to an ends
> (dependency management) I wonder if there is a simpler solution.

We could write a test that scans our tag files to check that no import of a
prematurely used class exists.

However, the JSP compiler has info what is on the classpath, transitive
dependencies etc. Thus, I argue that compilation would be the better solution.

When not compiling tag files, errors will always be delayed to later projects.
For example, unsupported Java language features (depends on language level
configuration) or syntax errors. But yes, this is a minor issue because the
error will show up eventually.

-- 
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 main updated: Fix BZ 66194 - align HTTP/2 with HTTP/1.1 for handling of client errors

2022-08-23 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 257bc23cdb Fix BZ 66194 - align HTTP/2 with HTTP/1.1 for handling of 
client errors
257bc23cdb is described below

commit 257bc23cdb786bd67bd8b5a407ed88908775c920
Author: Mark Thomas 
AuthorDate: Tue Aug 23 19:24:39 2022 +0100

Fix BZ 66194 - align HTTP/2 with HTTP/1.1 for handling of client errors

https://bz.apache.org/bugzilla/show_bug.cgi?id=66194
Also covers exceeding various limits (max header size, cookie count etc)
---
 .../org/apache/coyote/http2/Http2UpgradeHandler.java | 20 
 java/org/apache/coyote/http2/LocalStrings.properties |  3 +++
 webapps/docs/changelog.xml   |  5 +
 3 files changed, 28 insertions(+)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 8e285e17ec..f093b2ad38 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -49,6 +49,7 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.codec.binary.Base64;
 import org.apache.tomcat.util.http.MimeHeaders;
+import org.apache.tomcat.util.log.UserDataHelper;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
 import org.apache.tomcat.util.net.SSLSupport;
 import org.apache.tomcat.util.net.SendfileState;
@@ -146,6 +147,8 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 private volatile int lastNonFinalDataPayload;
 private volatile int lastWindowUpdate;
 
+protected final UserDataHelper userDataHelper = new UserDataHelper(log);
+
 
 Http2UpgradeHandler(Http2Protocol protocol, Adapter adapter, Request 
coyoteRequest, SocketWrapperBase socketWrapper) {
 super (STREAM_ID_ZERO);
@@ -356,6 +359,23 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 break;
 }
 } catch (StreamException se) {
+// Log the Stream error but not necessarily all of
+// them
+UserDataHelper.Mode logMode = 
userDataHelper.getNextMode();
+if (logMode != null) {
+String message = 
sm.getString("upgradeHandler.stream.error",
+connectionId, 
Integer.toString(se.getStreamId()));
+switch (logMode) {
+case INFO_THEN_DEBUG:
+message += 
sm.getString("upgradeHandler.fallToDebug");
+//$FALL-THROUGH$
+case INFO:
+log.info(message, se);
+break;
+case DEBUG:
+log.debug(message, se);
+}
+}
 // Stream errors are not fatal to the connection so
 // continue reading frames
 Stream stream = getStream(se.getStreamId(), false);
diff --git a/java/org/apache/coyote/http2/LocalStrings.properties 
b/java/org/apache/coyote/http2/LocalStrings.properties
index 098afef83e..615e6413dc 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -129,6 +129,8 @@ upgradeHandler.allocate.left=Connection [{0}], Stream 
[{1}], [{2}] bytes unalloc
 upgradeHandler.allocate.recipient=Connection [{0}], Stream [{1}], potential 
recipient [{2}] with weight [{3}]
 upgradeHandler.connectionError=Connection error
 upgradeHandler.dependency.invalid=Connection [{0}], Stream [{1}], Streams may 
not depend on themselves
+upgradeHandler.fallToDebug=\n\
+\ Note: further occurrences of HTTP/2 stream errors will be logged at DEBUG 
level.
 upgradeHandler.goaway.debug=Connection [{0}], Goaway, Last stream [{1}], Error 
code [{2}], Debug data [{3}]
 upgradeHandler.init=Connection [{0}], State [{1}]
 upgradeHandler.invalidPreface=Connection [{0}], Invalid connection preface
@@ -151,6 +153,7 @@ upgradeHandler.sendfile.reservation=Connection [{0}], 
Stream [{1}], Connection r
 upgradeHandler.socketCloseFailed=Error closing socket
 upgradeHandler.startRequestBodyFrame.result=Connection [{0}], Stream [{1}] 
startRequestBodyFrame returned [{2}]
 upgradeHandler.stream.closed=Stream [{0}] has been closed for some time
+upgradeHandler.stream.error=Connection [{0}], Stream [{1}] Closed due to error

[tomcat] branch 9.0.x updated: Fix BZ 66194 - align HTTP/2 with HTTP/1.1 for handling of client errors

2022-08-23 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 ddecddc2a0 Fix BZ 66194 - align HTTP/2 with HTTP/1.1 for handling of 
client errors
ddecddc2a0 is described below

commit ddecddc2a0df5fb4eb665e4e951f15003d637149
Author: Mark Thomas 
AuthorDate: Tue Aug 23 19:24:39 2022 +0100

Fix BZ 66194 - align HTTP/2 with HTTP/1.1 for handling of client errors

https://bz.apache.org/bugzilla/show_bug.cgi?id=66194
Also covers exceeding various limits (max header size, cookie count etc)
---
 .../org/apache/coyote/http2/Http2UpgradeHandler.java | 20 
 java/org/apache/coyote/http2/LocalStrings.properties |  3 +++
 webapps/docs/changelog.xml   |  5 +
 webapps/docs/config/systemprops.xml  |  1 +
 4 files changed, 29 insertions(+)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index f8d8235dea..48ed2f00b1 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -48,6 +48,7 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.codec.binary.Base64;
 import org.apache.tomcat.util.http.MimeHeaders;
+import org.apache.tomcat.util.log.UserDataHelper;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
 import org.apache.tomcat.util.net.SSLSupport;
 import org.apache.tomcat.util.net.SendfileState;
@@ -146,6 +147,8 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 private volatile int lastNonFinalDataPayload;
 private volatile int lastWindowUpdate;
 
+protected final UserDataHelper userDataHelper = new UserDataHelper(log);
+
 
 Http2UpgradeHandler(Http2Protocol protocol, Adapter adapter, Request 
coyoteRequest) {
 super (STREAM_ID_ZERO);
@@ -351,6 +354,23 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 break;
 }
 } catch (StreamException se) {
+// Log the Stream error but not necessarily all of
+// them
+UserDataHelper.Mode logMode = 
userDataHelper.getNextMode();
+if (logMode != null) {
+String message = 
sm.getString("upgradeHandler.stream.error",
+connectionId, 
Integer.toString(se.getStreamId()));
+switch (logMode) {
+case INFO_THEN_DEBUG:
+message += 
sm.getString("upgradeHandler.fallToDebug");
+//$FALL-THROUGH$
+case INFO:
+log.info(message, se);
+break;
+case DEBUG:
+log.debug(message, se);
+}
+}
 // Stream errors are not fatal to the connection so
 // continue reading frames
 Stream stream = getStream(se.getStreamId(), false);
diff --git a/java/org/apache/coyote/http2/LocalStrings.properties 
b/java/org/apache/coyote/http2/LocalStrings.properties
index 098afef83e..615e6413dc 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -129,6 +129,8 @@ upgradeHandler.allocate.left=Connection [{0}], Stream 
[{1}], [{2}] bytes unalloc
 upgradeHandler.allocate.recipient=Connection [{0}], Stream [{1}], potential 
recipient [{2}] with weight [{3}]
 upgradeHandler.connectionError=Connection error
 upgradeHandler.dependency.invalid=Connection [{0}], Stream [{1}], Streams may 
not depend on themselves
+upgradeHandler.fallToDebug=\n\
+\ Note: further occurrences of HTTP/2 stream errors will be logged at DEBUG 
level.
 upgradeHandler.goaway.debug=Connection [{0}], Goaway, Last stream [{1}], Error 
code [{2}], Debug data [{3}]
 upgradeHandler.init=Connection [{0}], State [{1}]
 upgradeHandler.invalidPreface=Connection [{0}], Invalid connection preface
@@ -151,6 +153,7 @@ upgradeHandler.sendfile.reservation=Connection [{0}], 
Stream [{1}], Connection r
 upgradeHandler.socketCloseFailed=Error closing socket
 upgradeHandler.startRequestBodyFrame.result=Connection [{0}], Stream [{1}] 
startRequestBodyFrame returned [{2}]
 upgradeHandler.stream.closed=Stream [{0}] has been closed for some time
+upgradeHandler.stream.error=Connection [{0}], 

[tomcat] branch 10.0.x updated: Fix BZ 66194 - align HTTP/2 with HTTP/1.1 for handling of client errors

2022-08-23 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 60745ec2d9 Fix BZ 66194 - align HTTP/2 with HTTP/1.1 for handling of 
client errors
60745ec2d9 is described below

commit 60745ec2d9370f205ca7547b7b0d0d22e15b3acf
Author: Mark Thomas 
AuthorDate: Tue Aug 23 19:24:39 2022 +0100

Fix BZ 66194 - align HTTP/2 with HTTP/1.1 for handling of client errors

https://bz.apache.org/bugzilla/show_bug.cgi?id=66194
Also covers exceeding various limits (max header size, cookie count etc)
---
 .../org/apache/coyote/http2/Http2UpgradeHandler.java | 20 
 java/org/apache/coyote/http2/LocalStrings.properties |  3 +++
 webapps/docs/changelog.xml   |  5 +
 webapps/docs/config/systemprops.xml  |  1 +
 4 files changed, 29 insertions(+)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index de33bfded6..068677905e 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -48,6 +48,7 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.codec.binary.Base64;
 import org.apache.tomcat.util.http.MimeHeaders;
+import org.apache.tomcat.util.log.UserDataHelper;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
 import org.apache.tomcat.util.net.SSLSupport;
 import org.apache.tomcat.util.net.SendfileState;
@@ -146,6 +147,8 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 private volatile int lastNonFinalDataPayload;
 private volatile int lastWindowUpdate;
 
+protected final UserDataHelper userDataHelper = new UserDataHelper(log);
+
 
 Http2UpgradeHandler(Http2Protocol protocol, Adapter adapter, Request 
coyoteRequest) {
 super (STREAM_ID_ZERO);
@@ -351,6 +354,23 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 break;
 }
 } catch (StreamException se) {
+// Log the Stream error but not necessarily all of
+// them
+UserDataHelper.Mode logMode = 
userDataHelper.getNextMode();
+if (logMode != null) {
+String message = 
sm.getString("upgradeHandler.stream.error",
+connectionId, 
Integer.toString(se.getStreamId()));
+switch (logMode) {
+case INFO_THEN_DEBUG:
+message += 
sm.getString("upgradeHandler.fallToDebug");
+//$FALL-THROUGH$
+case INFO:
+log.info(message, se);
+break;
+case DEBUG:
+log.debug(message, se);
+}
+}
 // Stream errors are not fatal to the connection so
 // continue reading frames
 Stream stream = getStream(se.getStreamId(), false);
diff --git a/java/org/apache/coyote/http2/LocalStrings.properties 
b/java/org/apache/coyote/http2/LocalStrings.properties
index 098afef83e..615e6413dc 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -129,6 +129,8 @@ upgradeHandler.allocate.left=Connection [{0}], Stream 
[{1}], [{2}] bytes unalloc
 upgradeHandler.allocate.recipient=Connection [{0}], Stream [{1}], potential 
recipient [{2}] with weight [{3}]
 upgradeHandler.connectionError=Connection error
 upgradeHandler.dependency.invalid=Connection [{0}], Stream [{1}], Streams may 
not depend on themselves
+upgradeHandler.fallToDebug=\n\
+\ Note: further occurrences of HTTP/2 stream errors will be logged at DEBUG 
level.
 upgradeHandler.goaway.debug=Connection [{0}], Goaway, Last stream [{1}], Error 
code [{2}], Debug data [{3}]
 upgradeHandler.init=Connection [{0}], State [{1}]
 upgradeHandler.invalidPreface=Connection [{0}], Invalid connection preface
@@ -151,6 +153,7 @@ upgradeHandler.sendfile.reservation=Connection [{0}], 
Stream [{1}], Connection r
 upgradeHandler.socketCloseFailed=Error closing socket
 upgradeHandler.startRequestBodyFrame.result=Connection [{0}], Stream [{1}] 
startRequestBodyFrame returned [{2}]
 upgradeHandler.stream.closed=Stream [{0}] has been closed for some time
+upgradeHandler.stream.error=Connection [{0}], 

[DISCUSS] MessageBytes refactoring

2022-08-23 Thread Mark Thomas

Hi all,

I've been looking at a fix for bug 66196. My ideas so far have revolved 
around MessageBytes but the solutions are being made more complex by the 
current behaviour of MessageBytes in some cases.


For example (I'm using strings in place of byte[] and char[] to keep it 
simple):


mb.setBytes("aaa");
mb.setChars("bbb");
mb.toBytes();

mb.getByteChunk() returns "aaa" whereas I'd expect it to be "bbb".

I'd like to refactor MessageBytes so it always behaves as if it has a 
single current value regardless of whether that value was set as a 
String, byte[] or char[]. If a get() method is called for a different 
type, conversion occurs on demand.


I'm reasonably confident that changing MessageBytes to always have a 
single, consistent value will also enable a few useful optimizations - 
particularly around ISO-8859-1 String to byte conversions which gets 
used a lot for HTTP response headers.


Note: As currently, if you write to the ByteChunk or CharChunk directly 
the caller is expected to take responsibility for keeping the values in 
sync or dealing with the consequences.


Thoughts?

Mark


[1] https://bz.apache.org/bugzilla/show_bug.cgi?id=66196

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



[Bug 66235] Java Beans Standard not honoured in EL expressions when running under Graal VM (JVM Runtime Mode)

2022-08-23 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66235

--- Comment #2 from Remy Maucherat  ---
(In reply to matthias.hiller from comment #1)
> By the way the commit integrating the GraalBeanELResolver already had an
> comment about similar problems but it was ignored.
> See
> https://github.com/apache/tomcat/commit/
> 4f5bdbc95f1ad1152396c615aab65b2137d30c7f#commitcomment-39709814

The basic problem is that something like the default Tomcat landing page will
no longer work out of the box (there's no tracing last time I tried, it needs
horrible manual config). So I think this is unusable and the replacement is
always a better option, but there's room for adding the couple extra hacks you
mention (like checking the params for get/set and the alternate "is" for get).
This will take care of all current uses I think.

-- 
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 66194] When using http2 and maxHeaderSize is exceeded, nothing is logged

2022-08-23 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66194

Mark Thomas  changed:

   What|Removed |Added

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

--- Comment #3 from Mark Thomas  ---
Fixed in:
- 10.1.x for 10.1.0-M18 onwards
- 10.0.x for 10.0.24 onwards
-  9.0.x for  9.0.66 onwards
-  8.5.x for  8.5.83 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] branch 8.5.x updated: Fix BZ 66194 - align HTTP/2 with HTTP/1.1 for handling of client errors

2022-08-23 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 b0d7d1603a Fix BZ 66194 - align HTTP/2 with HTTP/1.1 for handling of 
client errors
b0d7d1603a is described below

commit b0d7d1603a8c916469913962af1631a899d8ca05
Author: Mark Thomas 
AuthorDate: Tue Aug 23 19:24:39 2022 +0100

Fix BZ 66194 - align HTTP/2 with HTTP/1.1 for handling of client errors

https://bz.apache.org/bugzilla/show_bug.cgi?id=66194
Also covers exceeding various limits (max header size, cookie count etc)
---
 .../org/apache/coyote/http2/Http2UpgradeHandler.java | 20 
 java/org/apache/coyote/http2/LocalStrings.properties |  3 +++
 webapps/docs/changelog.xml   |  5 +
 webapps/docs/config/systemprops.xml  |  1 +
 4 files changed, 29 insertions(+)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 4d43f7c3ef..e9651c510e 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -49,6 +49,7 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.codec.binary.Base64;
 import org.apache.tomcat.util.http.MimeHeaders;
+import org.apache.tomcat.util.log.UserDataHelper;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
 import org.apache.tomcat.util.net.SSLSupport;
 import org.apache.tomcat.util.net.SocketEvent;
@@ -158,6 +159,8 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 private volatile int lastNonFinalDataPayload;
 private volatile int lastWindowUpdate;
 
+protected final UserDataHelper userDataHelper = new UserDataHelper(log);
+
 
 public Http2UpgradeHandler(Http2Protocol protocol, Adapter adapter, 
Request coyoteRequest) {
 super (STREAM_ID_ZERO);
@@ -345,6 +348,23 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 break;
 }
 } catch (StreamException se) {
+// Log the Stream error but not necessarily all of
+// them
+UserDataHelper.Mode logMode = 
userDataHelper.getNextMode();
+if (logMode != null) {
+String message = 
sm.getString("upgradeHandler.stream.error",
+connectionId, 
Integer.toString(se.getStreamId()));
+switch (logMode) {
+case INFO_THEN_DEBUG:
+message += 
sm.getString("upgradeHandler.fallToDebug");
+//$FALL-THROUGH$
+case INFO:
+log.info(message, se);
+break;
+case DEBUG:
+log.debug(message, se);
+}
+}
 // Stream errors are not fatal to the connection so
 // continue reading frames
 Stream stream = getStream(se.getStreamId(), false);
diff --git a/java/org/apache/coyote/http2/LocalStrings.properties 
b/java/org/apache/coyote/http2/LocalStrings.properties
index 32d14f657e..05f2b125bf 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -128,6 +128,8 @@ upgradeHandler.allocate.left=Connection [{0}], Stream 
[{1}], [{2}] bytes unalloc
 upgradeHandler.allocate.recipient=Connection [{0}], Stream [{1}], potential 
recipient [{2}] with weight [{3}]
 upgradeHandler.connectionError=Connection error
 upgradeHandler.dependency.invalid=Connection [{0}], Stream [{1}], Streams may 
not depend on themselves
+upgradeHandler.fallToDebug=\n\
+\ Note: further occurrences of HTTP/2 stream errors will be logged at DEBUG 
level.
 upgradeHandler.goaway.debug=Connection [{0}], Goaway, Last stream [{1}], Error 
code [{2}], Debug data [{3}]
 upgradeHandler.init=Connection [{0}], State [{1}]
 upgradeHandler.initialWindowSize.invalid=Connection [{0}], Illegal value of 
[{1}] ignored for initial window size
@@ -149,6 +151,7 @@ upgradeHandler.sendPrefaceFail=Connection [{0}], Failed to 
send preface to clien
 upgradeHandler.socketCloseFailed=Error closing socket
 upgradeHandler.startRequestBodyFrame.result=Connection [{0}], Stream [{1}] 
startRequestBodyFrame returned [{2}]
 upgradeHandler.stream.closed=Stream [{0}] has been closed for some time

[tomcat] branch main updated: Update docs

2022-08-23 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 200f048455 Update docs
200f048455 is described below

commit 200f048455ca50971b33997141753adf475031df
Author: Mark Thomas 
AuthorDate: Tue Aug 23 19:26:28 2022 +0100

Update docs
---
 webapps/docs/config/systemprops.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/webapps/docs/config/systemprops.xml 
b/webapps/docs/config/systemprops.xml
index a211bc5b1e..c3a6d59bf0 100644
--- a/webapps/docs/config/systemprops.xml
+++ b/webapps/docs/config/systemprops.xml
@@ -200,6 +200,7 @@
maxHeaderCount or maxParameterCount limits
of a connector).
  invalid host names
+ HTTP/2 stream closures
  
  Other errors triggered by invalid input data may be added to this
  system in later versions.


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



[tomcat] branch main updated: Remove code previously marked for removal in 10.1.x

2022-08-23 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 79173cfbca Remove code previously marked for removal in 10.1.x
79173cfbca is described below

commit 79173cfbcaf6e82972cce98fbdc619e227037ab8
Author: Mark Thomas 
AuthorDate: Tue Aug 23 11:05:25 2022 +0100

Remove code previously marked for removal in 10.1.x
---
 java/org/apache/jasper/JspC.java | 4 
 1 file changed, 4 deletions(-)

diff --git a/java/org/apache/jasper/JspC.java b/java/org/apache/jasper/JspC.java
index 88b4687376..1458e493cf 100644
--- a/java/org/apache/jasper/JspC.java
+++ b/java/org/apache/jasper/JspC.java
@@ -104,10 +104,6 @@ public class JspC extends Task implements Options {
 JspFactory.setDefaultFactory(new JspFactoryImpl());
 }
 
-@Deprecated
-public static final String DEFAULT_IE_CLASS_ID =
-"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93";
-
 // Logger
 private static final Log log = LogFactory.getLog(JspC.class);
 


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



[GitHub] [tomcat] aooohan commented on a diff in pull request #541: Bugfix for 66183 - AccessLogValve - %{xxx}c should output the value of all cookies with the same name

2022-08-23 Thread GitBox


aooohan commented on code in PR #541:
URL: https://github.com/apache/tomcat/pull/541#discussion_r952287911


##
java/org/apache/catalina/valves/ExtendedAccessLogValve.java:
##
@@ -298,12 +298,22 @@ public CookieElement(String name) {
 @Override
 public void addElement(CharArrayWriter buf, Date date, Request request,
 Response response, long time) {
+StringBuilder value = new StringBuilder();
+boolean first = true;
 Cookie[] c = request.getCookies();
 for (int i = 0; c != null && i < c.length; i++) {
 if (name.equals(c[i].getName())) {
-buf.append(wrap(c[i].getValue()));
+if (first) {
+first = false;
+} else {
+value.append(",");
+}
+value.append(wrap(c[i].getValue()));

Review Comment:
   Fixed



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



[tomcat] branch 8.5.x updated: BZ 66183. Log all values for given cookie, not just the first.

2022-08-23 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 3fd2ea8e35 BZ 66183. Log all values for given cookie, not just the 
first.
3fd2ea8e35 is described below

commit 3fd2ea8e3536b48eb363a0dd9e6138285fa4d7a4
Author: Mark Thomas 
AuthorDate: Tue Aug 23 09:20:38 2022 +0100

BZ 66183. Log all values for given cookie, not just the first.

https://bz.apache.org/bugzilla/show_bug.cgi?id=66183
Based on #541 by Han Li.
---
 .../apache/catalina/valves/AbstractAccessLogValve.java  | 17 +
 .../apache/catalina/valves/ExtendedAccessLogValve.java  | 16 ++--
 webapps/docs/changelog.xml  |  6 ++
 webapps/docs/config/valve.xml   |  4 ++--
 4 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index e92d3a014d..6132d8f9e0 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1560,17 +1560,26 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 @Override
 public void addElement(CharArrayWriter buf, Date date, Request request,
 Response response, long time) {
-String value = "-";
+StringBuilder value = new StringBuilder();
+boolean first = true;
 Cookie[] cookies = request.getCookies();
 if (cookies != null) {
 for (Cookie cookie : cookies) {
 if (cookieNameToLog.equals(cookie.getName())) {
-value = cookie.getValue();
-break;
+if (first) {
+first = false;
+} else {
+value.append(',');
+}
+value.append(cookie.getValue());
 }
 }
 }
-escapeAndAppend(value, buf);
+if (value.length() == 0) {
+buf.append('-');
+} else {
+escapeAndAppend(value.toString(), buf);
+}
 }
 }
 
diff --git a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java 
b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
index 5a9fc0d9f6..f4313ac9ac 100644
--- a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
+++ b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
@@ -64,7 +64,7 @@ import org.apache.tomcat.util.ExceptionUtils;
  * time-taken:  Time (in seconds) taken to serve the 
request
  * x-threadname: Current request thread name (can compare 
later with stacktraces)
  * x-A(XXX): Pull XXX attribute from the servlet context 
- * x-C(XXX): Pull the first cookie of the name XXX 
+ * x-C(XXX): Pull the cookie(s) of the name XXX 
  * x-O(XXX): Pull the all response header values XXX 
  * x-R(XXX): Pull XXX attribute from the servlet request 
  * x-S(XXX): Pull XXX attribute from the session 
@@ -308,12 +308,24 @@ public class ExtendedAccessLogValve extends 
AccessLogValve {
 @Override
 public void addElement(CharArrayWriter buf, Date date, Request request,
 Response response, long time) {
+StringBuilder value = new StringBuilder();
+boolean first = true;
 Cookie[] c = request.getCookies();
 for (int i = 0; c != null && i < c.length; i++) {
 if (name.equals(c[i].getName())) {
-buf.append(wrap(c[i].getValue()));
+if (first) {
+first = false;
+} else {
+value.append(',');
+}
+value.append(c[i].getValue());
 }
 }
+if (value.length() == 0 ) {
+buf.append('-');
+} else {
+buf.append(wrap(value.toString()));
+}
 }
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 582f35613c..d7ab2b5c3d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -107,6 +107,12 @@
 
   
 
+  
+66183: When logging cookie values in an access log valve and
+there are multiple cookies with the same name, log all cookie values
+rather than just the first. Based on pull request 541 by Han
+Li. (markt)
+  
   
 66184: Ensure that JULI root loggers have a default level of
 INFO. Pull request 533 provided by Piotr P.
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 

[tomcat] branch 10.0.x updated: BZ 66183. Log all values for given cookie, not just the first.

2022-08-23 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 83c97a17c9 BZ 66183. Log all values for given cookie, not just the 
first.
83c97a17c9 is described below

commit 83c97a17c99c6c73baa1e7cda28e7d4926bee829
Author: Mark Thomas 
AuthorDate: Tue Aug 23 09:20:38 2022 +0100

BZ 66183. Log all values for given cookie, not just the first.

https://bz.apache.org/bugzilla/show_bug.cgi?id=66183
Based on #541 by Han Li.
---
 .../apache/catalina/valves/AbstractAccessLogValve.java  | 17 +
 .../apache/catalina/valves/ExtendedAccessLogValve.java  | 16 ++--
 webapps/docs/changelog.xml  |  6 ++
 webapps/docs/config/valve.xml   |  4 ++--
 4 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 31ed2c15e0..879da82d5d 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1545,17 +1545,26 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 @Override
 public void addElement(CharArrayWriter buf, Date date, Request request,
 Response response, long time) {
-String value = "-";
+StringBuilder value = new StringBuilder();
+boolean first = true;
 Cookie[] cookies = request.getCookies();
 if (cookies != null) {
 for (Cookie cookie : cookies) {
 if (cookieNameToLog.equals(cookie.getName())) {
-value = cookie.getValue();
-break;
+if (first) {
+first = false;
+} else {
+value.append(',');
+}
+value.append(cookie.getValue());
 }
 }
 }
-escapeAndAppend(value, buf);
+if (value.length() == 0) {
+buf.append('-');
+} else {
+escapeAndAppend(value.toString(), buf);
+}
 }
 }
 
diff --git a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java 
b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
index d717bac903..852a473c43 100644
--- a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
+++ b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
@@ -64,7 +64,7 @@ import org.apache.tomcat.util.ExceptionUtils;
  * time-taken:  Time (in seconds) taken to serve the 
request
  * x-threadname: Current request thread name (can compare 
later with stacktraces)
  * x-A(XXX): Pull XXX attribute from the servlet context 
- * x-C(XXX): Pull the first cookie of the name XXX 
+ * x-C(XXX): Pull the cookie(s) of the name XXX 
  * x-O(XXX): Pull the all response header values XXX 
  * x-R(XXX): Pull XXX attribute from the servlet request 
  * x-S(XXX): Pull XXX attribute from the session 
@@ -298,12 +298,24 @@ public class ExtendedAccessLogValve extends 
AccessLogValve {
 @Override
 public void addElement(CharArrayWriter buf, Date date, Request request,
 Response response, long time) {
+StringBuilder value = new StringBuilder();
+boolean first = true;
 Cookie[] c = request.getCookies();
 for (int i = 0; c != null && i < c.length; i++) {
 if (name.equals(c[i].getName())) {
-buf.append(wrap(c[i].getValue()));
+if (first) {
+first = false;
+} else {
+value.append(',');
+}
+value.append(c[i].getValue());
 }
 }
+if (value.length() == 0 ) {
+buf.append('-');
+} else {
+buf.append(wrap(value.toString()));
+}
 }
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index db270bcba7..94a3b2c783 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -128,6 +128,12 @@
 MemoryUserDatabase.save(). Deprecate and discontinue use of MemoryUser,
 MemoryRole, and MemoryGroup classes. (schultz)
   
+  
+66183: When logging cookie values in an access log valve and
+there are multiple cookies with the same name, log all cookie values
+rather than just the first. Based on pull request 541 by Han
+Li. (markt)
+  
   
 66184: Ensure that JULI root loggers have a default level of
 

[tomcat] branch 9.0.x updated: BZ 66183. Log all values for given cookie, not just the first.

2022-08-23 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 c88bbac085 BZ 66183. Log all values for given cookie, not just the 
first.
c88bbac085 is described below

commit c88bbac0856ef5134a73031109ae1307294ecd23
Author: Mark Thomas 
AuthorDate: Tue Aug 23 09:20:38 2022 +0100

BZ 66183. Log all values for given cookie, not just the first.

https://bz.apache.org/bugzilla/show_bug.cgi?id=66183
Based on #541 by Han Li.
---
 .../apache/catalina/valves/AbstractAccessLogValve.java  | 17 +
 .../apache/catalina/valves/ExtendedAccessLogValve.java  | 16 ++--
 webapps/docs/changelog.xml  |  6 ++
 webapps/docs/config/valve.xml   |  4 ++--
 4 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 5afea9f2c3..668492b0fd 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1549,17 +1549,26 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 @Override
 public void addElement(CharArrayWriter buf, Date date, Request request,
 Response response, long time) {
-String value = "-";
+StringBuilder value = new StringBuilder();
+boolean first = true;
 Cookie[] cookies = request.getCookies();
 if (cookies != null) {
 for (Cookie cookie : cookies) {
 if (cookieNameToLog.equals(cookie.getName())) {
-value = cookie.getValue();
-break;
+if (first) {
+first = false;
+} else {
+value.append(',');
+}
+value.append(cookie.getValue());
 }
 }
 }
-escapeAndAppend(value, buf);
+if (value.length() == 0) {
+buf.append('-');
+} else {
+escapeAndAppend(value.toString(), buf);
+}
 }
 }
 
diff --git a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java 
b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
index bc0097cc5a..a128d236b6 100644
--- a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
+++ b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
@@ -64,7 +64,7 @@ import org.apache.tomcat.util.ExceptionUtils;
  * time-taken:  Time (in seconds) taken to serve the 
request
  * x-threadname: Current request thread name (can compare 
later with stacktraces)
  * x-A(XXX): Pull XXX attribute from the servlet context 
- * x-C(XXX): Pull the first cookie of the name XXX 
+ * x-C(XXX): Pull the cookie(s) of the name XXX 
  * x-O(XXX): Pull the all response header values XXX 
  * x-R(XXX): Pull XXX attribute from the servlet request 
  * x-S(XXX): Pull XXX attribute from the session 
@@ -298,12 +298,24 @@ public class ExtendedAccessLogValve extends 
AccessLogValve {
 @Override
 public void addElement(CharArrayWriter buf, Date date, Request request,
 Response response, long time) {
+StringBuilder value = new StringBuilder();
+boolean first = true;
 Cookie[] c = request.getCookies();
 for (int i = 0; c != null && i < c.length; i++) {
 if (name.equals(c[i].getName())) {
-buf.append(wrap(c[i].getValue()));
+if (first) {
+first = false;
+} else {
+value.append(',');
+}
+value.append(c[i].getValue());
 }
 }
+if (value.length() == 0 ) {
+buf.append('-');
+} else {
+buf.append(wrap(value.toString()));
+}
 }
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 6608afc8df..26a6d24038 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -128,6 +128,12 @@
 MemoryUserDatabase.save(). Deprecate and discontinue use of MemoryUser,
 MemoryRole, and MemoryGroup classes. (schultz)
   
+  
+66183: When logging cookie values in an access log valve and
+there are multiple cookies with the same name, log all cookie values
+rather than just the first. Based on pull request 541 by Han
+Li. (markt)
+  
   
 66184: Ensure that JULI root loggers have a default level of
 INFO. 

[tomcat] branch main updated: BZ 66183. Log all values for given cookie, not just the first.

2022-08-23 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 cbf884c4d5 BZ 66183. Log all values for given cookie, not just the 
first.
cbf884c4d5 is described below

commit cbf884c4d54bf4eacace15261511bf627a11da36
Author: Mark Thomas 
AuthorDate: Tue Aug 23 09:20:38 2022 +0100

BZ 66183. Log all values for given cookie, not just the first.

https://bz.apache.org/bugzilla/show_bug.cgi?id=66183
Based on #541 by Han Li.
---
 .../apache/catalina/valves/AbstractAccessLogValve.java  | 17 +
 .../apache/catalina/valves/ExtendedAccessLogValve.java  | 16 ++--
 webapps/docs/changelog.xml  |  6 ++
 webapps/docs/config/valve.xml   |  4 ++--
 4 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 31ed2c15e0..879da82d5d 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1545,17 +1545,26 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 @Override
 public void addElement(CharArrayWriter buf, Date date, Request request,
 Response response, long time) {
-String value = "-";
+StringBuilder value = new StringBuilder();
+boolean first = true;
 Cookie[] cookies = request.getCookies();
 if (cookies != null) {
 for (Cookie cookie : cookies) {
 if (cookieNameToLog.equals(cookie.getName())) {
-value = cookie.getValue();
-break;
+if (first) {
+first = false;
+} else {
+value.append(',');
+}
+value.append(cookie.getValue());
 }
 }
 }
-escapeAndAppend(value, buf);
+if (value.length() == 0) {
+buf.append('-');
+} else {
+escapeAndAppend(value.toString(), buf);
+}
 }
 }
 
diff --git a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java 
b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
index d717bac903..852a473c43 100644
--- a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
+++ b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
@@ -64,7 +64,7 @@ import org.apache.tomcat.util.ExceptionUtils;
  * time-taken:  Time (in seconds) taken to serve the 
request
  * x-threadname: Current request thread name (can compare 
later with stacktraces)
  * x-A(XXX): Pull XXX attribute from the servlet context 
- * x-C(XXX): Pull the first cookie of the name XXX 
+ * x-C(XXX): Pull the cookie(s) of the name XXX 
  * x-O(XXX): Pull the all response header values XXX 
  * x-R(XXX): Pull XXX attribute from the servlet request 
  * x-S(XXX): Pull XXX attribute from the session 
@@ -298,12 +298,24 @@ public class ExtendedAccessLogValve extends 
AccessLogValve {
 @Override
 public void addElement(CharArrayWriter buf, Date date, Request request,
 Response response, long time) {
+StringBuilder value = new StringBuilder();
+boolean first = true;
 Cookie[] c = request.getCookies();
 for (int i = 0; c != null && i < c.length; i++) {
 if (name.equals(c[i].getName())) {
-buf.append(wrap(c[i].getValue()));
+if (first) {
+first = false;
+} else {
+value.append(',');
+}
+value.append(c[i].getValue());
 }
 }
+if (value.length() == 0 ) {
+buf.append('-');
+} else {
+buf.append(wrap(value.toString()));
+}
 }
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index d669f9be4b..eeb630ad34 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -128,6 +128,12 @@
 MemoryUserDatabase.save(). Deprecate and discontinue use of MemoryUser,
 MemoryRole, and MemoryGroup classes. (schultz)
   
+  
+66183: When logging cookie values in an access log valve and
+there are multiple cookies with the same name, log all cookie values
+rather than just the first. Based on pull request 541 by Han
+Li. (markt)
+  
   
 66184: Ensure that JULI root loggers have a default level of
 INFO. 

[GitHub] [tomcat] markt-asf closed pull request #541: Bugfix for 66183 - AccessLogValve - %{xxx}c should output the value of all cookies with the same name

2022-08-23 Thread GitBox


markt-asf closed pull request #541: Bugfix for 66183 - AccessLogValve - %{xxx}c 
should output the value of all cookies with the same name
URL: https://github.com/apache/tomcat/pull/541


-- 
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 #541: Bugfix for 66183 - AccessLogValve - %{xxx}c should output the value of all cookies with the same name

2022-08-23 Thread GitBox


markt-asf commented on PR #541:
URL: https://github.com/apache/tomcat/pull/541#issuecomment-1223727734

   Applied manually with a few tweaks.


-- 
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 66179] NPE when retrieving locale from request

2022-08-23 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66179

simon.lu...@sap.com changed:

   What|Removed |Added

 Resolution|--- |INFORMATIONPROVIDED
 Status|NEEDINFO|RESOLVED

--- Comment #9 from simon.lu...@sap.com ---
Thanks a lot, you are right, this was it, with this option I could easily
reproduce it and solve it. Closing this one now.

-- 
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 66183] AccessLogValve - %{xxx}c should output the value of all cookies with the same name

2022-08-23 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66183

Mark Thomas  changed:

   What|Removed |Added

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

--- Comment #6 from Mark Thomas  ---
Thanks for the report and the PR.

Fixed in:
- 10.1.x for 10.1.0-M18 onwards
- 10.0.x for 10.0.24 onwards
-  9.0.x for  9.0.66 onwards
-  8.5.x for  8.5.83 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



[Bug 66233] when set maxCookieCount 1, request has 5 cookies, the response message is "null"

2022-08-23 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66233

yong hu  changed:

   What|Removed |Added

 CC||xyzhu88y...@gmail.com

-- 
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 10.0.x updated: Improve naming. No functional change.

2022-08-23 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 86d6af94b4 Improve naming. No functional change.
86d6af94b4 is described below

commit 86d6af94b4389f72b638409226a99caeea7e1bac
Author: Mark Thomas 
AuthorDate: Tue Aug 23 08:36:34 2022 +0100

Improve naming. No functional change.
---
 java/org/apache/catalina/valves/AbstractAccessLogValve.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 18db62ee04..31ed2c15e0 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1536,10 +1536,10 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
  * write a specific cookie - %{xxx}c
  */
 protected static class CookieElement implements AccessLogElement {
-private final String header;
+private final String cookieNameToLog;
 
-public CookieElement(String header) {
-this.header = header;
+public CookieElement(String cookieNameToLog) {
+this.cookieNameToLog = cookieNameToLog;
 }
 
 @Override
@@ -1549,7 +1549,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 Cookie[] cookies = request.getCookies();
 if (cookies != null) {
 for (Cookie cookie : cookies) {
-if (header.equals(cookie.getName())) {
+if (cookieNameToLog.equals(cookie.getName())) {
 value = cookie.getValue();
 break;
 }


-
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: Improve naming. No functional change.

2022-08-23 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 beda7290b0 Improve naming. No functional change.
beda7290b0 is described below

commit beda7290b07c5b9308f087979d1c5e67480cafef
Author: Mark Thomas 
AuthorDate: Tue Aug 23 08:36:34 2022 +0100

Improve naming. No functional change.
---
 java/org/apache/catalina/valves/AbstractAccessLogValve.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 18ede7d329..e92d3a014d 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1551,10 +1551,10 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
  * write a specific cookie - %{xxx}c
  */
 protected static class CookieElement implements AccessLogElement {
-private final String header;
+private final String cookieNameToLog;
 
-public CookieElement(String header) {
-this.header = header;
+public CookieElement(String cookieNameToLog) {
+this.cookieNameToLog = cookieNameToLog;
 }
 
 @Override
@@ -1564,7 +1564,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 Cookie[] cookies = request.getCookies();
 if (cookies != null) {
 for (Cookie cookie : cookies) {
-if (header.equals(cookie.getName())) {
+if (cookieNameToLog.equals(cookie.getName())) {
 value = cookie.getValue();
 break;
 }


-
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: Improve naming. No functional change.

2022-08-23 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 411d689c5e Improve naming. No functional change.
411d689c5e is described below

commit 411d689c5eedb55ff2e4b5760cc11b3ed03e6af4
Author: Mark Thomas 
AuthorDate: Tue Aug 23 08:36:34 2022 +0100

Improve naming. No functional change.
---
 java/org/apache/catalina/valves/AbstractAccessLogValve.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 8cf278c9b2..5afea9f2c3 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1540,10 +1540,10 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
  * write a specific cookie - %{xxx}c
  */
 protected static class CookieElement implements AccessLogElement {
-private final String header;
+private final String cookieNameToLog;
 
-public CookieElement(String header) {
-this.header = header;
+public CookieElement(String cookieNameToLog) {
+this.cookieNameToLog = cookieNameToLog;
 }
 
 @Override
@@ -1553,7 +1553,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 Cookie[] cookies = request.getCookies();
 if (cookies != null) {
 for (Cookie cookie : cookies) {
-if (header.equals(cookie.getName())) {
+if (cookieNameToLog.equals(cookie.getName())) {
 value = cookie.getValue();
 break;
 }


-
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 a diff in pull request #541: Bugfix for 66183 - AccessLogValve - %{xxx}c should output the value of all cookies with the same name

2022-08-23 Thread GitBox


markt-asf commented on code in PR #541:
URL: https://github.com/apache/tomcat/pull/541#discussion_r952256591


##
java/org/apache/catalina/valves/ExtendedAccessLogValve.java:
##
@@ -298,12 +298,22 @@ public CookieElement(String name) {
 @Override
 public void addElement(CharArrayWriter buf, Date date, Request request,
 Response response, long time) {
+StringBuilder value = new StringBuilder();
+boolean first = true;
 Cookie[] c = request.getCookies();
 for (int i = 0; c != null && i < c.length; i++) {
 if (name.equals(c[i].getName())) {
-buf.append(wrap(c[i].getValue()));
+if (first) {
+first = false;
+} else {
+value.append(",");
+}
+value.append(wrap(c[i].getValue()));

Review Comment:
   Need to wrap the output rather than individual 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



[tomcat] branch main updated: Improve naming. No functional change.

2022-08-23 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 f2f8c90c57 Improve naming. No functional change.
f2f8c90c57 is described below

commit f2f8c90c57849fd6c6cf9f0223f035769f0bbeeb
Author: Mark Thomas 
AuthorDate: Tue Aug 23 08:36:34 2022 +0100

Improve naming. No functional change.
---
 java/org/apache/catalina/valves/AbstractAccessLogValve.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 18db62ee04..31ed2c15e0 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1536,10 +1536,10 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
  * write a specific cookie - %{xxx}c
  */
 protected static class CookieElement implements AccessLogElement {
-private final String header;
+private final String cookieNameToLog;
 
-public CookieElement(String header) {
-this.header = header;
+public CookieElement(String cookieNameToLog) {
+this.cookieNameToLog = cookieNameToLog;
 }
 
 @Override
@@ -1549,7 +1549,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 Cookie[] cookies = request.getCookies();
 if (cookies != null) {
 for (Cookie cookie : cookies) {
-if (header.equals(cookie.getName())) {
+if (cookieNameToLog.equals(cookie.getName())) {
 value = cookie.getValue();
 break;
 }


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