[GitHub] [tomcat] markt-asf merged pull request #657: Eliminating duplicate execution of checkFacade logic in ResponseFacade

2023-09-06 Thread via GitHub


markt-asf merged PR #657:
URL: https://github.com/apache/tomcat/pull/657


-- 
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: Eliminating duplicate execution of checkFacade logic in ResponseFacade (#657)

2023-09-06 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 6e641be1d7 Eliminating duplicate execution of checkFacade logic in 
ResponseFacade (#657)
6e641be1d7 is described below

commit 6e641be1d7365845b947f9a06ab520aba937b9af
Author: xxeol2 
AuthorDate: Wed Sep 6 16:40:43 2023 +0900

Eliminating duplicate execution of checkFacade logic in ResponseFacade 
(#657)

Eliminating duplicate execution of checkFacade logic in ResponseFacade
---
 java/org/apache/catalina/connector/ResponseFacade.java | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/connector/ResponseFacade.java 
b/java/org/apache/catalina/connector/ResponseFacade.java
index a9c9ab031e..b09b4731a8 100644
--- a/java/org/apache/catalina/connector/ResponseFacade.java
+++ b/java/org/apache/catalina/connector/ResponseFacade.java
@@ -111,23 +111,19 @@ public class ResponseFacade implements 
HttpServletResponse {
 
 @Override
 public ServletOutputStream getOutputStream() throws IOException {
-checkFacade();
-ServletOutputStream sos = response.getOutputStream();
 if (isFinished()) {
 response.setSuspended(true);
 }
-return sos;
+return response.getOutputStream();
 }
 
 
 @Override
 public PrintWriter getWriter() throws IOException {
-checkFacade();
-PrintWriter writer = response.getWriter();
 if (isFinished()) {
 response.setSuspended(true);
 }
-return writer;
+return response.getWriter();
 }
 
 


-
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: Eliminating duplicate execution of checkFacade logic in ResponseFacade (#657)

2023-09-06 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 6df245d186 Eliminating duplicate execution of checkFacade logic in 
ResponseFacade (#657)
6df245d186 is described below

commit 6df245d1860a9ece733e60e51a495f8c65d2b1b1
Author: xxeol2 
AuthorDate: Wed Sep 6 16:40:43 2023 +0900

Eliminating duplicate execution of checkFacade logic in ResponseFacade 
(#657)

Eliminating duplicate execution of checkFacade logic in ResponseFacade
---
 java/org/apache/catalina/connector/ResponseFacade.java | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/connector/ResponseFacade.java 
b/java/org/apache/catalina/connector/ResponseFacade.java
index db8c65c686..5ad4c0778b 100644
--- a/java/org/apache/catalina/connector/ResponseFacade.java
+++ b/java/org/apache/catalina/connector/ResponseFacade.java
@@ -173,23 +173,19 @@ public class ResponseFacade implements 
HttpServletResponse {
 
 @Override
 public ServletOutputStream getOutputStream() throws IOException {
-checkFacade();
-ServletOutputStream sos = response.getOutputStream();
 if (isFinished()) {
 response.setSuspended(true);
 }
-return sos;
+return response.getOutputStream();
 }
 
 
 @Override
 public PrintWriter getWriter() throws IOException {
-checkFacade();
-PrintWriter writer = response.getWriter();
 if (isFinished()) {
 response.setSuspended(true);
 }
-return writer;
+return response.getWriter();
 }
 
 


-
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: Eliminating duplicate execution of checkFacade logic in ResponseFacade (#657)

2023-09-06 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 115246c33d Eliminating duplicate execution of checkFacade logic in 
ResponseFacade (#657)
115246c33d is described below

commit 115246c33dbbe747a12aa9ead8246b23bfbe3e31
Author: xxeol2 
AuthorDate: Wed Sep 6 16:40:43 2023 +0900

Eliminating duplicate execution of checkFacade logic in ResponseFacade 
(#657)

Eliminating duplicate execution of checkFacade logic in ResponseFacade
---
 java/org/apache/catalina/connector/ResponseFacade.java | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/connector/ResponseFacade.java 
b/java/org/apache/catalina/connector/ResponseFacade.java
index 97bb870e4a..89aeecf0f9 100644
--- a/java/org/apache/catalina/connector/ResponseFacade.java
+++ b/java/org/apache/catalina/connector/ResponseFacade.java
@@ -174,23 +174,19 @@ public class ResponseFacade implements 
HttpServletResponse {
 
 @Override
 public ServletOutputStream getOutputStream() throws IOException {
-checkFacade();
-ServletOutputStream sos = response.getOutputStream();
 if (isFinished()) {
 response.setSuspended(true);
 }
-return sos;
+return response.getOutputStream();
 }
 
 
 @Override
 public PrintWriter getWriter() throws IOException {
-checkFacade();
-PrintWriter writer = response.getWriter();
 if (isFinished()) {
 response.setSuspended(true);
 }
-return writer;
+return response.getWriter();
 }
 
 


-
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: Eliminating duplicate execution of checkFacade logic in ResponseFacade (#657)

2023-09-06 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 b1cdb0927c Eliminating duplicate execution of checkFacade logic in 
ResponseFacade (#657)
b1cdb0927c is described below

commit b1cdb0927cd21a5405c58ed9a30b9abb06c0ea0a
Author: xxeol2 
AuthorDate: Wed Sep 6 16:40:43 2023 +0900

Eliminating duplicate execution of checkFacade logic in ResponseFacade 
(#657)

Eliminating duplicate execution of checkFacade logic in ResponseFacade
---
 java/org/apache/catalina/connector/ResponseFacade.java | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/connector/ResponseFacade.java 
b/java/org/apache/catalina/connector/ResponseFacade.java
index 6f7b45aafa..4735d1bd1a 100644
--- a/java/org/apache/catalina/connector/ResponseFacade.java
+++ b/java/org/apache/catalina/connector/ResponseFacade.java
@@ -172,23 +172,19 @@ public class ResponseFacade implements 
HttpServletResponse {
 
 @Override
 public ServletOutputStream getOutputStream() throws IOException {
-checkFacade();
-ServletOutputStream sos = response.getOutputStream();
 if (isFinished()) {
 response.setSuspended(true);
 }
-return sos;
+return response.getOutputStream();
 }
 
 
 @Override
 public PrintWriter getWriter() throws IOException {
-checkFacade();
-PrintWriter writer = response.getWriter();
 if (isFinished()) {
 response.setSuspended(true);
 }
-return writer;
+return response.getWriter();
 }
 
 


-
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 #661: Unify conditional statement format for some constants in http1 package

2023-09-06 Thread via GitHub


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


##
java/org/apache/coyote/http11/filters/ChunkedInputFilter.java:
##
@@ -574,7 +574,7 @@ private boolean parseHeader() throws IOException {
 }
 
 chr = readChunk.get(readChunk.position());
-if ((chr != Constants.SP) && (chr != Constants.HT)) {
+if (!(chr == Constants.SP || chr == Constants.HT)) {

Review Comment:
   As above - remove application of De Morgan's law.



##
java/org/apache/coyote/http11/Http11InputBuffer.java:
##
@@ -998,7 +998,7 @@ private HeaderParseStatus parseHeader() throws IOException {
 
 byte peek = byteBuffer.get(byteBuffer.position());
 if (headerParsePos == HeaderParsePosition.HEADER_MULTI_LINE) {
-if ((peek != Constants.SP) && (peek != Constants.HT)) {
+if (!(peek == Constants.SP || peek == Constants.HT)) {

Review Comment:
   Removing the unnecessary brackets is fine. Applying De Morgan's law is not. 
Yes, the result is the same but the intention is less obvious than with the 
original form so please keep it.



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

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

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


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



[GitHub] [tomcat] markt-asf commented on a diff in pull request #659: Unify constant delimiters and Refactoring for better readability

2023-09-06 Thread via GitHub


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


##
java/org/apache/coyote/http11/Constants.java:
##
@@ -106,7 +106,7 @@ public final class Constants {
 public static final String KEEP_ALIVE_HEADER_VALUE_TOKEN = "keep-alive";
 public static final String CHUNKED = "chunked";
 public static final byte[] ACK_BYTES = ByteChunk.convertToBytes("HTTP/1.1 
100 " + CRLF + CRLF);
-public static final String TRANSFERENCODING = "Transfer-Encoding";
+public static final String TRANSFER_ENCODING = "Transfer-Encoding";

Review Comment:
   This change still needs to be reverted. It is a public constant and my 
previous comments in this PR about not changing public constants apply equally 
to this one.



-- 
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 a diff in pull request #660: Optimize when call getSessionCookieName & getSessionUriParamName

2023-09-06 Thread via GitHub


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


##
java/org/apache/catalina/util/SessionConfig.java:
##
@@ -49,38 +42,30 @@ public static String getSessionCookieName(Context context) {
  * @return the parameter name for the session
  */
 public static String getSessionUriParamName(Context context) {
-
-String result = getConfiguredSessionCookieName(context);
-
-if (result == null) {
-result = DEFAULT_SESSION_PARAMETER_NAME;
-}
-
-return result;
+return getConfiguredSessionCookieName(context, 
DEFAULT_SESSION_PARAMETER_NAME);
 }
 
 
-private static String getConfiguredSessionCookieName(Context context) {
-
+private static String getConfiguredSessionCookieName(Context context, 
String defaultName) {
+if (context == null) {
+return defaultName;
+}
 // Priority is:
 // 1. Cookie name defined in context
 // 2. Cookie name configured for app
 // 3. Default defined by spec
-if (context != null) {
-String cookieName = context.getSessionCookieName();

Review Comment:
   The code will be cleaner if you keep the original null check. That will also 
keep the code better aligned with the documented priority order.



-- 
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] greeng00se commented on a diff in pull request #660: Optimize when call getSessionCookieName & getSessionUriParamName

2023-09-06 Thread via GitHub


greeng00se commented on code in PR #660:
URL: https://github.com/apache/tomcat/pull/660#discussion_r1316896601


##
java/org/apache/catalina/util/SessionConfig.java:
##
@@ -49,38 +42,30 @@ public static String getSessionCookieName(Context context) {
  * @return the parameter name for the session
  */
 public static String getSessionUriParamName(Context context) {
-
-String result = getConfiguredSessionCookieName(context);
-
-if (result == null) {
-result = DEFAULT_SESSION_PARAMETER_NAME;
-}
-
-return result;
+return getConfiguredSessionCookieName(context, 
DEFAULT_SESSION_PARAMETER_NAME);
 }
 
 
-private static String getConfiguredSessionCookieName(Context context) {
-
+private static String getConfiguredSessionCookieName(Context context, 
String defaultName) {
+if (context == null) {
+return defaultName;
+}
 // Priority is:
 // 1. Cookie name defined in context
 // 2. Cookie name configured for app
 // 3. Default defined by spec
-if (context != null) {
-String cookieName = context.getSessionCookieName();

Review Comment:
   Thank you for your attention to detail in the code. 
   Could you please check the modified code?



-- 
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] greeng00se commented on a diff in pull request #660: Optimize when call getSessionCookieName & getSessionUriParamName

2023-09-06 Thread via GitHub


greeng00se commented on code in PR #660:
URL: https://github.com/apache/tomcat/pull/660#discussion_r1316896601


##
java/org/apache/catalina/util/SessionConfig.java:
##
@@ -49,38 +42,30 @@ public static String getSessionCookieName(Context context) {
  * @return the parameter name for the session
  */
 public static String getSessionUriParamName(Context context) {
-
-String result = getConfiguredSessionCookieName(context);
-
-if (result == null) {
-result = DEFAULT_SESSION_PARAMETER_NAME;
-}
-
-return result;
+return getConfiguredSessionCookieName(context, 
DEFAULT_SESSION_PARAMETER_NAME);
 }
 
 
-private static String getConfiguredSessionCookieName(Context context) {
-
+private static String getConfiguredSessionCookieName(Context context, 
String defaultName) {
+if (context == null) {
+return defaultName;
+}
 // Priority is:
 // 1. Cookie name defined in context
 // 2. Cookie name configured for app
 // 3. Default defined by spec
-if (context != null) {
-String cookieName = context.getSessionCookieName();

Review Comment:
   Thank you for your commentđŸ‘đŸ»
   Could you please check the modified code?



-- 
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] parkmuhyeun commented on pull request #659: Unify constant delimiters and Refactoring for better readability

2023-09-06 Thread via GitHub


parkmuhyeun commented on PR #659:
URL: https://github.com/apache/tomcat/pull/659#issuecomment-1707887311

   TransferENCODING wasn't mentioned, so I didn't recognize it. I reverted all 
the stuff about constant names!


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



Buildbot success in on tomcat-11.0.x

2023-09-06 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/112/builds/562
Blamelist: xxeol2 
Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch main] 6e641be1d7365845b947f9a06ab520aba937b9af


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 0

  shell_9: 0

  Rsync docs to nightlies.apache.org: 0

  shell_10: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 1

  shell_11: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


-
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 #662: Simplify and enhance charset extraction from content type

2023-09-06 Thread via GitHub


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


##
java/org/apache/coyote/Request.java:
##
@@ -16,19 +16,8 @@
  */
 package org.apache.coyote;
 
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.Charset;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.atomic.AtomicReference;
-
 import jakarta.servlet.ReadListener;
 import jakarta.servlet.ServletConnection;
-
 import org.apache.tomcat.util.buf.CharsetHolder;
 import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.buf.UDecoder;

Review Comment:
   This breaks the Checkstyle enforced import order rules.



##
java/org/apache/coyote/Request.java:
##
@@ -853,24 +846,22 @@ public boolean isProcessing() {
  * @param contentType a content type header
  */
 private static String getCharsetFromContentType(String contentType) {
-
 if (contentType == null) {
 return null;
 }
 int start = contentType.indexOf("charset=");
 if (start < 0) {
 return null;
 }
-String encoding = contentType.substring(start + 8);
-int end = encoding.indexOf(';');
+start += 8;
+int end = contentType.indexOf(';', start);
+String encoding;
 if (end >= 0) {
-encoding = encoding.substring(0, end);
+encoding = contentType.substring(start, end).trim();
+} else {
+encoding = contentType.substring(start).trim();
 }
-encoding = encoding.trim();
-if ((encoding.length() > 2) && (encoding.startsWith("\"")) && 
(encoding.endsWith("\""))) {
-encoding = encoding.substring(1, encoding.length() - 1);
-}
-
-return encoding.trim();
+return encoding.replaceAll("\"", "");

Review Comment:
   This changes functionality. Granted the existing code doesn't strictly 
implement the requirements of RFC 9110 either but "code clean-up" PRs should 
not be changing functionality without explicitly drawing attention to that fact.
   
   Separately, I have concerns about the performance implications of this 
change. Srtring.replaceAll() is not cheap as it uses regular expressions.
   
   If we want to specification compliant here (and we probably should be) the 
right way to do this would be to use  o.a.t.u.http.parser.MediaType. 



##
java/org/apache/coyote/Request.java:
##
@@ -386,8 +385,7 @@ public void setLocalPort(int port) {
  * Get the character encoding used for this request.
  *
  * @return The value set via {@link #setCharset(Charset)} or if no call 
has been made to that method try to obtain
- * if from the content type.
- *
+ * if from the content type.

Review Comment:
   This breaks the standard Javadoc formatting.



-- 
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] apptie opened a new pull request, #663: Refactoring the main method of a Tomcat class to improve readability

2023-09-06 Thread via GitHub


apptie opened a new pull request, #663:
URL: https://github.com/apache/tomcat/pull/663

   Hello! 
   While learning about Tomcat, I see something that I think I can contribute 
to, so I write this PR.
   
   ## Explanation
   
   There are two commits here:
   
   - Remove the FQCN when creating a Tomcat instance
   - Change the order of equals method calls
   
   ### Remove the FQCN when creating a Tomcat instance
   
   I removed the FQCN when creating the Tomcat instance, because I was creating 
an instance of myself and determined that there were no other Tomcat classes 
inside the org.apache.catalina package.
   
   ### Change the order of equals method calls
   
   Previously, I was comparing strings based on their args(`args[i]`), and I 
thought I could reverse the order to make them a little more readable.
   
   ---
   
   If I've misunderstood something, please let me know.


-- 
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] sosow0212 opened a new pull request, #664: Improved code readability

2023-09-06 Thread via GitHub


sosow0212 opened a new pull request, #664:
URL: https://github.com/apache/tomcat/pull/664

   While seeing the code in the Coyote project, I came across this code 
snippet: 
   `if (!(chr == Constants.SP || chr == Constants.HT))`.
   
   It appears to be challenging to read, so I enhanced its readability using De 
Morgan's law.
   
   ---
   before
   `if (!(chr == Constants.SP || chr == Constants.HT))`.
   
   after
   `if (chr != Constants.SP && chr != Constants.HT)`


-- 
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 a diff in pull request #663: Refactoring the main method of a Tomcat class to improve readability

2023-09-06 Thread via GitHub


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


##
java/org/apache/catalina/startup/Tomcat.java:
##
@@ -1303,7 +1303,7 @@ public static void main(String[] args) throws Exception {
 break;
 }
 }
-org.apache.catalina.startup.Tomcat tomcat = new 
org.apache.catalina.startup.Tomcat();
+Tomcat tomcat = new Tomcat();

Review Comment:
   The removal of the FQCN is fine but as the only remaining change is rather 
small for the effort required to review and merge a PR. A PR that addressed 
this for the entire code base (I believe there is a PMD rule to check for this) 
would be useful.



##
java/org/apache/catalina/startup/Tomcat.java:
##
@@ -1290,9 +1290,9 @@ public static void main(String[] args) throws Exception {
 // Process some command line parameters
 String[] catalinaArguments = null;
 for (int i = 0; i < args.length; i++) {
-if (args[i].equals("--no-jmx")) {
+if ("--no-jmx".equals(args[i])) {

Review Comment:
   The change to equals() is subjective. I'd argue the current code is easier 
to read.



-- 
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 #661: Unify conditional statement format for some constants in http1 package

2023-09-06 Thread via GitHub


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

   See #663 - a single PR would be preferred.


-- 
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 #664: Improved code readability

2023-09-06 Thread via GitHub


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

   See #661 - a single PR would be preferred.


-- 
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 67235] NPE (NullPointerException) occurs in AsyncContextImpl.decrementInProgressAsyncCount after version 10.1.12.

2023-09-06 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=67235

bclozel  changed:

   What|Removed |Added

 CC||bclo...@vmware.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



[GitHub] [tomcat] wonyongChoi05 commented on a diff in pull request #662: Simplify and enhance charset extraction from content type

2023-09-06 Thread via GitHub


wonyongChoi05 commented on code in PR #662:
URL: https://github.com/apache/tomcat/pull/662#discussion_r1317009172


##
java/org/apache/coyote/Request.java:
##
@@ -853,24 +846,22 @@ public boolean isProcessing() {
  * @param contentType a content type header
  */
 private static String getCharsetFromContentType(String contentType) {
-
 if (contentType == null) {
 return null;
 }
 int start = contentType.indexOf("charset=");
 if (start < 0) {
 return null;
 }
-String encoding = contentType.substring(start + 8);
-int end = encoding.indexOf(';');
+start += 8;
+int end = contentType.indexOf(';', start);
+String encoding;
 if (end >= 0) {
-encoding = encoding.substring(0, end);
+encoding = contentType.substring(start, end).trim();
+} else {
+encoding = contentType.substring(start).trim();
 }
-encoding = encoding.trim();
-if ((encoding.length() > 2) && (encoding.startsWith("\"")) && 
(encoding.endsWith("\""))) {
-encoding = encoding.substring(1, encoding.length() - 1);
-}
-
-return encoding.trim();
+return encoding.replaceAll("\"", "");

Review Comment:
   I'm curious whether there are any performance advantages when using 
MediaType to comply with the specification compared to the existing code. 
Additionally, I'm interested in knowing whether the existing code already 
adhered to the specification as well as MediaType does.



-- 
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: Code clean-up - no functional change

2023-09-06 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 00656b324c Code clean-up - no functional change
00656b324c is described below

commit 00656b324c625a5aa27494a049d51da07b51aeaa
Author: Mark Thomas 
AuthorDate: Wed Sep 6 10:25:31 2023 +0100

Code clean-up - no functional change
---
 .../apache/catalina/loader/JdbcLeakPrevention.java |  23 +-
 .../catalina/loader/ParallelWebappClassLoader.java |  17 +-
 java/org/apache/catalina/loader/ResourceEntry.java |   4 +-
 .../apache/catalina/loader/WebappClassLoader.java  |  20 +-
 .../catalina/loader/WebappClassLoaderBase.java | 660 -
 java/org/apache/catalina/loader/WebappLoader.java  | 121 ++--
 6 files changed, 336 insertions(+), 509 deletions(-)

diff --git a/java/org/apache/catalina/loader/JdbcLeakPrevention.java 
b/java/org/apache/catalina/loader/JdbcLeakPrevention.java
index 1c89c5abac..3ccc10e616 100644
--- a/java/org/apache/catalina/loader/JdbcLeakPrevention.java
+++ b/java/org/apache/catalina/loader/JdbcLeakPrevention.java
@@ -26,12 +26,9 @@ import java.util.List;
 import java.util.Set;
 
 /**
- * This class is loaded by {@link WebappClassLoaderBase} to enable it to
- * deregister JDBC drivers forgotten by the web application. There are some
- * classloading hacks involved - see
- * {@link WebappClassLoaderBase#clearReferences()} for details - but the short
- * version is do not just create a new instance of this class with the new
- * keyword.
+ * This class is loaded by {@link WebappClassLoaderBase} to enable it to 
deregister JDBC drivers forgotten by the web
+ * application. There are some classloading hacks involved - see {@link 
WebappClassLoaderBase#clearReferences()} for
+ * details - but the short version is do not just create a new instance of 
this class with the new keyword.
  */
 public class JdbcLeakPrevention {
 
@@ -39,13 +36,10 @@ public class JdbcLeakPrevention {
 List driverNames = new ArrayList<>();
 
 /*
- * DriverManager.getDrivers() has a nasty side-effect of registering
- * drivers that are visible to this class loader but haven't yet been
- * loaded. Therefore, the first call to this method a) gets the list
- * of originally loaded drivers and b) triggers the unwanted
- * side-effect. The second call gets the complete list of drivers
- * ensuring that both original drivers and any loaded as a result of 
the
- * side-effects are all de-registered.
+ * DriverManager.getDrivers() has a nasty side-effect of registering 
drivers that are visible to this class
+ * loader but haven't yet been loaded. Therefore, the first call to 
this method a) gets the list of originally
+ * loaded drivers and b) triggers the unwanted side-effect. The second 
call gets the complete list of drivers
+ * ensuring that both original drivers and any loaded as a result of 
the side-effects are all de-registered.
  */
 Set originalDrivers = new HashSet<>();
 Enumeration drivers = DriverManager.getDrivers();
@@ -56,8 +50,7 @@ public class JdbcLeakPrevention {
 while (drivers.hasMoreElements()) {
 Driver driver = drivers.nextElement();
 // Only unload the drivers this web app loaded
-if (driver.getClass().getClassLoader() !=
-this.getClass().getClassLoader()) {
+if (driver.getClass().getClassLoader() != 
this.getClass().getClassLoader()) {
 continue;
 }
 // Only report drivers that were originally registered. Skip any
diff --git a/java/org/apache/catalina/loader/ParallelWebappClassLoader.java 
b/java/org/apache/catalina/loader/ParallelWebappClassLoader.java
index 9f6b469780..167f72de3e 100644
--- a/java/org/apache/catalina/loader/ParallelWebappClassLoader.java
+++ b/java/org/apache/catalina/loader/ParallelWebappClassLoader.java
@@ -44,17 +44,14 @@ public class ParallelWebappClassLoader extends 
WebappClassLoaderBase {
 
 
 /**
- * Returns a copy of this class loader without any class file
- * transformers. This is a tool often used by Java Persistence API
- * providers to inspect entity classes in the absence of any
- * instrumentation, something that can't be guaranteed within the
- * context of a {@link java.lang.instrument.ClassFileTransformer}'s
- * {@link java.lang.instrument.ClassFileTransformer#transform(ClassLoader,
- * String, Class, java.security.ProtectionDomain, byte[]) transform} 
method.
+ * Returns a copy of this class loader without any class file 
transformers. This is a tool often used by Java
+ * Persistence API providers to inspect entity classes in the absence of 
any instrumentation, something that can't
+ * be guaranteed within the context of

[tomcat] branch 10.1.x updated: Code clean-up - no functional change

2023-09-06 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 bd2e80c98b Code clean-up - no functional change
bd2e80c98b is described below

commit bd2e80c98b6f67f9968afddbc08230f6a52bedd1
Author: Mark Thomas 
AuthorDate: Wed Sep 6 11:05:44 2023 +0100

Code clean-up - no functional change
---
 .../apache/catalina/loader/JdbcLeakPrevention.java |  29 +-
 .../catalina/loader/ParallelWebappClassLoader.java |  17 +-
 java/org/apache/catalina/loader/ResourceEntry.java |   4 +-
 .../apache/catalina/loader/WebappClassLoader.java  |  20 +-
 .../catalina/loader/WebappClassLoaderBase.java | 711 -
 java/org/apache/catalina/loader/WebappLoader.java  | 133 ++--
 6 files changed, 363 insertions(+), 551 deletions(-)

diff --git a/java/org/apache/catalina/loader/JdbcLeakPrevention.java 
b/java/org/apache/catalina/loader/JdbcLeakPrevention.java
index adbf8f2b03..cdd5b8b974 100644
--- a/java/org/apache/catalina/loader/JdbcLeakPrevention.java
+++ b/java/org/apache/catalina/loader/JdbcLeakPrevention.java
@@ -26,16 +26,11 @@ import java.util.List;
 import java.util.Set;
 
 /**
- * This class is loaded by {@link WebappClassLoaderBase} to enable it to
- * deregister JDBC drivers forgotten by the web application. There are some
- * classloading hacks involved - see
- * {@link WebappClassLoaderBase#clearReferences()} for details - but the short
- * version is do not just create a new instance of this class with the new
- * keyword.
- *
- * Since this class is loaded by {@link WebappClassLoaderBase}, it cannot refer
- * to any internal Tomcat classes as that will cause the security manager to
- * complain.
+ * This class is loaded by {@link WebappClassLoaderBase} to enable it to 
deregister JDBC drivers forgotten by the web
+ * application. There are some classloading hacks involved - see {@link 
WebappClassLoaderBase#clearReferences()} for
+ * details - but the short version is do not just create a new instance of 
this class with the new keyword. Since this
+ * class is loaded by {@link WebappClassLoaderBase}, it cannot refer to any 
internal Tomcat classes as that will cause
+ * the security manager to complain.
  */
 public class JdbcLeakPrevention {
 
@@ -43,13 +38,10 @@ public class JdbcLeakPrevention {
 List driverNames = new ArrayList<>();
 
 /*
- * DriverManager.getDrivers() has a nasty side-effect of registering
- * drivers that are visible to this class loader but haven't yet been
- * loaded. Therefore, the first call to this method a) gets the list
- * of originally loaded drivers and b) triggers the unwanted
- * side-effect. The second call gets the complete list of drivers
- * ensuring that both original drivers and any loaded as a result of 
the
- * side-effects are all de-registered.
+ * DriverManager.getDrivers() has a nasty side-effect of registering 
drivers that are visible to this class
+ * loader but haven't yet been loaded. Therefore, the first call to 
this method a) gets the list of originally
+ * loaded drivers and b) triggers the unwanted side-effect. The second 
call gets the complete list of drivers
+ * ensuring that both original drivers and any loaded as a result of 
the side-effects are all de-registered.
  */
 Set originalDrivers = new HashSet<>();
 Enumeration drivers = DriverManager.getDrivers();
@@ -60,8 +52,7 @@ public class JdbcLeakPrevention {
 while (drivers.hasMoreElements()) {
 Driver driver = drivers.nextElement();
 // Only unload the drivers this web app loaded
-if (driver.getClass().getClassLoader() !=
-this.getClass().getClassLoader()) {
+if (driver.getClass().getClassLoader() != 
this.getClass().getClassLoader()) {
 continue;
 }
 // Only report drivers that were originally registered. Skip any
diff --git a/java/org/apache/catalina/loader/ParallelWebappClassLoader.java 
b/java/org/apache/catalina/loader/ParallelWebappClassLoader.java
index 9f6b469780..167f72de3e 100644
--- a/java/org/apache/catalina/loader/ParallelWebappClassLoader.java
+++ b/java/org/apache/catalina/loader/ParallelWebappClassLoader.java
@@ -44,17 +44,14 @@ public class ParallelWebappClassLoader extends 
WebappClassLoaderBase {
 
 
 /**
- * Returns a copy of this class loader without any class file
- * transformers. This is a tool often used by Java Persistence API
- * providers to inspect entity classes in the absence of any
- * instrumentation, something that can't be guaranteed within the
- * context of a {@link java.lang.instrument.ClassFileTransformer}'s
- * {@link java.lang.instrument.ClassFileTransformer#transform(ClassLoader,
- * Str

[tomcat] branch 9.0.x updated: Code clean-up - no functional change

2023-09-06 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 9213e5a57e Code clean-up - no functional change
9213e5a57e is described below

commit 9213e5a57ed1490216082d342000fe98c2be41f2
Author: Mark Thomas 
AuthorDate: Wed Sep 6 11:05:47 2023 +0100

Code clean-up - no functional change
---
 .../apache/catalina/loader/JdbcLeakPrevention.java |  29 +-
 .../catalina/loader/ParallelWebappClassLoader.java |  17 +-
 java/org/apache/catalina/loader/ResourceEntry.java |   4 +-
 .../apache/catalina/loader/WebappClassLoader.java  |  20 +-
 .../catalina/loader/WebappClassLoaderBase.java | 703 -
 java/org/apache/catalina/loader/WebappLoader.java  | 132 ++--
 6 files changed, 359 insertions(+), 546 deletions(-)

diff --git a/java/org/apache/catalina/loader/JdbcLeakPrevention.java 
b/java/org/apache/catalina/loader/JdbcLeakPrevention.java
index adbf8f2b03..cdd5b8b974 100644
--- a/java/org/apache/catalina/loader/JdbcLeakPrevention.java
+++ b/java/org/apache/catalina/loader/JdbcLeakPrevention.java
@@ -26,16 +26,11 @@ import java.util.List;
 import java.util.Set;
 
 /**
- * This class is loaded by {@link WebappClassLoaderBase} to enable it to
- * deregister JDBC drivers forgotten by the web application. There are some
- * classloading hacks involved - see
- * {@link WebappClassLoaderBase#clearReferences()} for details - but the short
- * version is do not just create a new instance of this class with the new
- * keyword.
- *
- * Since this class is loaded by {@link WebappClassLoaderBase}, it cannot refer
- * to any internal Tomcat classes as that will cause the security manager to
- * complain.
+ * This class is loaded by {@link WebappClassLoaderBase} to enable it to 
deregister JDBC drivers forgotten by the web
+ * application. There are some classloading hacks involved - see {@link 
WebappClassLoaderBase#clearReferences()} for
+ * details - but the short version is do not just create a new instance of 
this class with the new keyword. Since this
+ * class is loaded by {@link WebappClassLoaderBase}, it cannot refer to any 
internal Tomcat classes as that will cause
+ * the security manager to complain.
  */
 public class JdbcLeakPrevention {
 
@@ -43,13 +38,10 @@ public class JdbcLeakPrevention {
 List driverNames = new ArrayList<>();
 
 /*
- * DriverManager.getDrivers() has a nasty side-effect of registering
- * drivers that are visible to this class loader but haven't yet been
- * loaded. Therefore, the first call to this method a) gets the list
- * of originally loaded drivers and b) triggers the unwanted
- * side-effect. The second call gets the complete list of drivers
- * ensuring that both original drivers and any loaded as a result of 
the
- * side-effects are all de-registered.
+ * DriverManager.getDrivers() has a nasty side-effect of registering 
drivers that are visible to this class
+ * loader but haven't yet been loaded. Therefore, the first call to 
this method a) gets the list of originally
+ * loaded drivers and b) triggers the unwanted side-effect. The second 
call gets the complete list of drivers
+ * ensuring that both original drivers and any loaded as a result of 
the side-effects are all de-registered.
  */
 Set originalDrivers = new HashSet<>();
 Enumeration drivers = DriverManager.getDrivers();
@@ -60,8 +52,7 @@ public class JdbcLeakPrevention {
 while (drivers.hasMoreElements()) {
 Driver driver = drivers.nextElement();
 // Only unload the drivers this web app loaded
-if (driver.getClass().getClassLoader() !=
-this.getClass().getClassLoader()) {
+if (driver.getClass().getClassLoader() != 
this.getClass().getClassLoader()) {
 continue;
 }
 // Only report drivers that were originally registered. Skip any
diff --git a/java/org/apache/catalina/loader/ParallelWebappClassLoader.java 
b/java/org/apache/catalina/loader/ParallelWebappClassLoader.java
index 9f6b469780..167f72de3e 100644
--- a/java/org/apache/catalina/loader/ParallelWebappClassLoader.java
+++ b/java/org/apache/catalina/loader/ParallelWebappClassLoader.java
@@ -44,17 +44,14 @@ public class ParallelWebappClassLoader extends 
WebappClassLoaderBase {
 
 
 /**
- * Returns a copy of this class loader without any class file
- * transformers. This is a tool often used by Java Persistence API
- * providers to inspect entity classes in the absence of any
- * instrumentation, something that can't be guaranteed within the
- * context of a {@link java.lang.instrument.ClassFileTransformer}'s
- * {@link java.lang.instrument.ClassFileTransformer#transform(ClassLoader,
- * Strin

[tomcat] branch 8.5.x updated: Code clean-up - no functional change

2023-09-06 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 f21a460e40 Code clean-up - no functional change
f21a460e40 is described below

commit f21a460e40222b7db028d4bd0d051cd50a51c4e7
Author: Mark Thomas 
AuthorDate: Wed Sep 6 11:05:51 2023 +0100

Code clean-up - no functional change
---
 .../apache/catalina/loader/JdbcLeakPrevention.java |  29 +-
 .../catalina/loader/ParallelWebappClassLoader.java |  17 +-
 java/org/apache/catalina/loader/ResourceEntry.java |   4 +-
 .../apache/catalina/loader/WebappClassLoader.java  |  20 +-
 .../catalina/loader/WebappClassLoaderBase.java | 709 -
 java/org/apache/catalina/loader/WebappLoader.java  | 139 ++--
 6 files changed, 366 insertions(+), 552 deletions(-)

diff --git a/java/org/apache/catalina/loader/JdbcLeakPrevention.java 
b/java/org/apache/catalina/loader/JdbcLeakPrevention.java
index adbf8f2b03..cdd5b8b974 100644
--- a/java/org/apache/catalina/loader/JdbcLeakPrevention.java
+++ b/java/org/apache/catalina/loader/JdbcLeakPrevention.java
@@ -26,16 +26,11 @@ import java.util.List;
 import java.util.Set;
 
 /**
- * This class is loaded by {@link WebappClassLoaderBase} to enable it to
- * deregister JDBC drivers forgotten by the web application. There are some
- * classloading hacks involved - see
- * {@link WebappClassLoaderBase#clearReferences()} for details - but the short
- * version is do not just create a new instance of this class with the new
- * keyword.
- *
- * Since this class is loaded by {@link WebappClassLoaderBase}, it cannot refer
- * to any internal Tomcat classes as that will cause the security manager to
- * complain.
+ * This class is loaded by {@link WebappClassLoaderBase} to enable it to 
deregister JDBC drivers forgotten by the web
+ * application. There are some classloading hacks involved - see {@link 
WebappClassLoaderBase#clearReferences()} for
+ * details - but the short version is do not just create a new instance of 
this class with the new keyword. Since this
+ * class is loaded by {@link WebappClassLoaderBase}, it cannot refer to any 
internal Tomcat classes as that will cause
+ * the security manager to complain.
  */
 public class JdbcLeakPrevention {
 
@@ -43,13 +38,10 @@ public class JdbcLeakPrevention {
 List driverNames = new ArrayList<>();
 
 /*
- * DriverManager.getDrivers() has a nasty side-effect of registering
- * drivers that are visible to this class loader but haven't yet been
- * loaded. Therefore, the first call to this method a) gets the list
- * of originally loaded drivers and b) triggers the unwanted
- * side-effect. The second call gets the complete list of drivers
- * ensuring that both original drivers and any loaded as a result of 
the
- * side-effects are all de-registered.
+ * DriverManager.getDrivers() has a nasty side-effect of registering 
drivers that are visible to this class
+ * loader but haven't yet been loaded. Therefore, the first call to 
this method a) gets the list of originally
+ * loaded drivers and b) triggers the unwanted side-effect. The second 
call gets the complete list of drivers
+ * ensuring that both original drivers and any loaded as a result of 
the side-effects are all de-registered.
  */
 Set originalDrivers = new HashSet<>();
 Enumeration drivers = DriverManager.getDrivers();
@@ -60,8 +52,7 @@ public class JdbcLeakPrevention {
 while (drivers.hasMoreElements()) {
 Driver driver = drivers.nextElement();
 // Only unload the drivers this web app loaded
-if (driver.getClass().getClassLoader() !=
-this.getClass().getClassLoader()) {
+if (driver.getClass().getClassLoader() != 
this.getClass().getClassLoader()) {
 continue;
 }
 // Only report drivers that were originally registered. Skip any
diff --git a/java/org/apache/catalina/loader/ParallelWebappClassLoader.java 
b/java/org/apache/catalina/loader/ParallelWebappClassLoader.java
index 2235229d13..c1ae98029b 100644
--- a/java/org/apache/catalina/loader/ParallelWebappClassLoader.java
+++ b/java/org/apache/catalina/loader/ParallelWebappClassLoader.java
@@ -42,17 +42,14 @@ public class ParallelWebappClassLoader extends 
WebappClassLoaderBase {
 
 
 /**
- * Returns a copy of this class loader without any class file
- * transformers. This is a tool often used by Java Persistence API
- * providers to inspect entity classes in the absence of any
- * instrumentation, something that can't be guaranteed within the
- * context of a {@link java.lang.instrument.ClassFileTransformer}'s
- * {@link java.lang.instrument.ClassFileTransformer#transform(ClassLoader,
- * Strin

[Bug 67235] NPE (NullPointerException) occurs in AsyncContextImpl.decrementInProgressAsyncCount after version 10.1.12.

2023-09-06 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=67235

--- Comment #1 from Mark Thomas  ---
Are you using HTTP/2 for these requests? I'm guessing not but just wanted to
check.

-- 
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] iamjooon2 commented on pull request #652: Upgrade Readability by removing brackets and depth

2023-09-06 Thread via GitHub


iamjooon2 commented on PR #652:
URL: https://github.com/apache/tomcat/pull/652#issuecomment-1708065150

   HI @markt-asf 
   
   I read codes in apache/coyote
   
   I found 
   


-- 
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 67235] NPE (NullPointerException) occurs in AsyncContextImpl.decrementInProgressAsyncCount after version 10.1.12.

2023-09-06 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=67235

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

--- Comment #2 from Mark Thomas  ---
I am unable to re-create the error described from the information provided.

Please provide the simplest possible test case the reproduces 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



[GitHub] [tomcat] iamjooon2 commented on pull request #652: Upgrade Readability by removing brackets and depth

2023-09-06 Thread via GitHub


iamjooon2 commented on PR #652:
URL: https://github.com/apache/tomcat/pull/652#issuecomment-1708120119

   Hello from Korea @markt-asf
   I unified all of conventions in package apache/coyote
   
   1. unify conditional convention
   e.g
   ```java
   // from
   if (type == Constants.JK_AJP13_CPING_REQUEST) {
   if (protocol.isPaused()) {
   recycle();
   break;
   }
   ..
   }
   // to
   
   if (type == Constants.JK_AJP13_CPING_REQUEST && protocol.isPaused()) {
 recycle();
 break;
   }
   
   ```
   removed unnecessary depth.
   
   2. 
   unify brackets conventions in apache/coytote
   
   And...
   When I first wrote this PR, I wrote it with a pure heart that I also want to 
be helpful. I had no other intention 
   If there's anything lacking on my PR, I'd like you to leave it
   Have a good day :)


-- 
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 67235] NPE (NullPointerException) occurs in AsyncContextImpl.decrementInProgressAsyncCount after version 10.1.12.

2023-09-06 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=67235

--- Comment #3 from brigh...@toss.im ---
I did not use HTTP2.
This issue occurred when setting up SSE (Server-Sent Events), and it's expected
that this could always happen when using an asynchronous servlet.

I'm building a server using the Spring Framework, and I'll briefly attach some
sample code below that could cause this issue when running with embedded Tomcat
as the web application server.

```
class EventStreamV2Controller {

@GetMapping(value = ["/sse"], produces =
[MediaType.TEXT_EVENT_STREAM_VALUE])
fun connectStream(): SseEmitter {
val sseEmitter = SseEmitter(Duration.ofSeconds(10).toMillis())

Thread {
Thread.sleep(Duration.ofSeconds(5).toMillis())
sseEmitter.send("message")
}.start()

return sseEmitter
}
}

```

When there is an API like the one described above, if the client preemptively
terminates the SSE connection within 5 seconds after making the connection
request, an issue occurs at the point when sseEmitter.send("message") is
called.

-- 
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] iamjooon2 commented on pull request #652: Upgrade Readability by removing brackets and depth

2023-09-06 Thread via GitHub


iamjooon2 commented on PR #652:
URL: https://github.com/apache/tomcat/pull/652#issuecomment-1708163596

   My mistake!
   I rollbacked some codes.
   
   I really appreciate for your 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



[GitHub] [tomcat] Jaeyoung22 commented on pull request #661: Unify conditional statement format for some constants in http1 package

2023-09-06 Thread via GitHub


Jaeyoung22 commented on PR #661:
URL: https://github.com/apache/tomcat/pull/661#issuecomment-1708220046

   I've taken note of what you've said.
   
   ## 1. remove unnecessary parentheses throughout the package
   Personally, I find conditional statements with three or more conditions to 
be more readable with parentheses, so I changed all conditional statements with 
TWO conditions where each condition is wrapped in parentheses.
   
   ## 2. Simplify conditional expressions using DeMorgan's law
   As you mentioned, I recognized that not using DeMorgan's rule can be more 
readable, so I changed all conditional statements that use DeMorgan's rule to 
not use it. 
   Please let me know if there are any conditional statements that you think 
would be better readable if they used DeMorgan's law.
   
   ## Comment
   This is my first PR contributing to open source, so there may be some 
imperfections. If I made a mistake or did something wrong, please forgive me 
and let me know. Thank you for your review!


-- 
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 merged pull request #659: Unify constant delimiters and Refactoring for better readability

2023-09-06 Thread via GitHub


markt-asf merged PR #659:
URL: https://github.com/apache/tomcat/pull/659


-- 
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 (00656b324c -> 9c908d2c29)

2023-09-06 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 00656b324c Code clean-up - no functional change
 add 9c908d2c29 Unify constant delimiters and Refactoring for better 
readability (#659)

No new revisions were added by this update.

Summary of changes:
 java/org/apache/catalina/manager/StatusTransformer.java | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)


-
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 #659: Unify constant delimiters and Refactoring for better readability

2023-09-06 Thread via GitHub


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

   Tx for the PR. I added a commit to remove an unnecessary line of code I 
spotted while reviewing the PR.


-- 
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 9.0.x updated: Unify constant delimiters and Refactoring for better readability (#659)

2023-09-06 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 f0ce299b69 Unify constant delimiters and Refactoring for better 
readability (#659)
f0ce299b69 is described below

commit f0ce299b6958d59b2bf75ee6de570de81393cb0b
Author: Mooo 
AuthorDate: Wed Sep 6 21:36:34 2023 +0900

Unify constant delimiters and Refactoring for better readability (#659)

Use an existing constants & remove unnecessary code

Co-authored-by: Mark Thomas 
---
 java/org/apache/catalina/manager/StatusTransformer.java | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/java/org/apache/catalina/manager/StatusTransformer.java 
b/java/org/apache/catalina/manager/StatusTransformer.java
index 2fa32b9abc..d61813fba1 100644
--- a/java/org/apache/catalina/manager/StatusTransformer.java
+++ b/java/org/apache/catalina/manager/StatusTransformer.java
@@ -443,33 +443,32 @@ public class StatusTransformer {
 
 switch (stage) {
 
-case (1/*org.apache.coyote.Constants.STAGE_PARSE*/):
+case (org.apache.coyote.Constants.STAGE_PARSE):
 stageStr = "P";
 fullStatus = false;
 break;
-case (2/*org.apache.coyote.Constants.STAGE_PREPARE*/):
+case (org.apache.coyote.Constants.STAGE_PREPARE):
 stageStr = "P";
 fullStatus = false;
 break;
-case (3/*org.apache.coyote.Constants.STAGE_SERVICE*/):
+case (org.apache.coyote.Constants.STAGE_SERVICE):
 stageStr = "S";
 break;
-case (4/*org.apache.coyote.Constants.STAGE_ENDINPUT*/):
+case (org.apache.coyote.Constants.STAGE_ENDINPUT):
 stageStr = "F";
 break;
-case (5/*org.apache.coyote.Constants.STAGE_ENDOUTPUT*/):
+case (org.apache.coyote.Constants.STAGE_ENDOUTPUT):
 stageStr = "F";
 break;
-case (7/*org.apache.coyote.Constants.STAGE_ENDED*/):
+case (org.apache.coyote.Constants.STAGE_ENDED):
 stageStr = "R";
 fullStatus = false;
 break;
-case (6/*org.apache.coyote.Constants.STAGE_KEEPALIVE*/):
+case (org.apache.coyote.Constants.STAGE_KEEPALIVE):
 stageStr = "K";
-fullStatus = true;
 showRequest = false;
 break;
-case (0/*org.apache.coyote.Constants.STAGE_NEW*/):
+case (org.apache.coyote.Constants.STAGE_NEW):
 stageStr = "R";
 fullStatus = false;
 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 #660: Optimize when call getSessionCookieName & getSessionUriParamName

2023-09-06 Thread via GitHub


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


##
java/org/apache/catalina/util/SessionConfig.java:
##
@@ -49,38 +42,30 @@ public static String getSessionCookieName(Context context) {
  * @return the parameter name for the session
  */
 public static String getSessionUriParamName(Context context) {
-
-String result = getConfiguredSessionCookieName(context);
-
-if (result == null) {
-result = DEFAULT_SESSION_PARAMETER_NAME;
-}
-
-return result;
+return getConfiguredSessionCookieName(context, 
DEFAULT_SESSION_PARAMETER_NAME);
 }
 
 
-private static String getConfiguredSessionCookieName(Context context) {
-
+private static String getConfiguredSessionCookieName(Context context, 
String defaultName) {
+if (context == null) {
+return defaultName;
+}
 // Priority is:
 // 1. Cookie name defined in context
 // 2. Cookie name configured for app
 // 3. Default defined by spec
-if (context != null) {
-String cookieName = context.getSessionCookieName();

Review Comment:
   LGTM



-- 
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 10.1.x updated: Unify constant delimiters and Refactoring for better readability (#659)

2023-09-06 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 33bcb367bc Unify constant delimiters and Refactoring for better 
readability (#659)
33bcb367bc is described below

commit 33bcb367bcf5a5fc598aaf779564261c4ee4ce8c
Author: Mooo 
AuthorDate: Wed Sep 6 21:36:34 2023 +0900

Unify constant delimiters and Refactoring for better readability (#659)

Use an existing constants & remove unnecessary code

Co-authored-by: Mark Thomas 
---
 java/org/apache/catalina/manager/StatusTransformer.java | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/java/org/apache/catalina/manager/StatusTransformer.java 
b/java/org/apache/catalina/manager/StatusTransformer.java
index c32c201d7f..66c9347128 100644
--- a/java/org/apache/catalina/manager/StatusTransformer.java
+++ b/java/org/apache/catalina/manager/StatusTransformer.java
@@ -375,33 +375,32 @@ public class StatusTransformer {
 
 switch (stage) {
 
-case (1/*org.apache.coyote.Constants.STAGE_PARSE*/):
+case (org.apache.coyote.Constants.STAGE_PARSE):
 stageStr = "P";
 fullStatus = false;
 break;
-case (2/*org.apache.coyote.Constants.STAGE_PREPARE*/):
+case (org.apache.coyote.Constants.STAGE_PREPARE):
 stageStr = "P";
 fullStatus = false;
 break;
-case (3/*org.apache.coyote.Constants.STAGE_SERVICE*/):
+case (org.apache.coyote.Constants.STAGE_SERVICE):
 stageStr = "S";
 break;
-case (4/*org.apache.coyote.Constants.STAGE_ENDINPUT*/):
+case (org.apache.coyote.Constants.STAGE_ENDINPUT):
 stageStr = "F";
 break;
-case (5/*org.apache.coyote.Constants.STAGE_ENDOUTPUT*/):
+case (org.apache.coyote.Constants.STAGE_ENDOUTPUT):
 stageStr = "F";
 break;
-case (7/*org.apache.coyote.Constants.STAGE_ENDED*/):
+case (org.apache.coyote.Constants.STAGE_ENDED):
 stageStr = "R";
 fullStatus = false;
 break;
-case (6/*org.apache.coyote.Constants.STAGE_KEEPALIVE*/):
+case (org.apache.coyote.Constants.STAGE_KEEPALIVE):
 stageStr = "K";
-fullStatus = true;
 showRequest = false;
 break;
-case (0/*org.apache.coyote.Constants.STAGE_NEW*/):
+case (org.apache.coyote.Constants.STAGE_NEW):
 stageStr = "R";
 fullStatus = false;
 break;


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



[GitHub] [tomcat] markt-asf merged pull request #660: Optimize when call getSessionCookieName & getSessionUriParamName

2023-09-06 Thread via GitHub


markt-asf merged PR #660:
URL: https://github.com/apache/tomcat/pull/660


-- 
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: Optimize when call getSessionCookieName & getSessionUriParamName (#660)

2023-09-06 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 65e1c7ddc2 Optimize when call getSessionCookieName & 
getSessionUriParamName (#660)
65e1c7ddc2 is described below

commit 65e1c7ddc2604ac9afa42ac79cbc6a289bd3dc1f
Author: Herb 
AuthorDate: Wed Sep 6 21:41:53 2023 +0900

Optimize when call getSessionCookieName & getSessionUriParamName (#660)

Reduce duplicate / unnecessary code
---
 java/org/apache/catalina/util/SessionConfig.java | 27 +---
 1 file changed, 5 insertions(+), 22 deletions(-)

diff --git a/java/org/apache/catalina/util/SessionConfig.java 
b/java/org/apache/catalina/util/SessionConfig.java
index 6957285912..7720adcbf8 100644
--- a/java/org/apache/catalina/util/SessionConfig.java
+++ b/java/org/apache/catalina/util/SessionConfig.java
@@ -32,14 +32,7 @@ public class SessionConfig {
  * @return the cookie name for the context
  */
 public static String getSessionCookieName(Context context) {
-
-String result = getConfiguredSessionCookieName(context);
-
-if (result == null) {
-result = DEFAULT_SESSION_COOKIE_NAME;
-}
-
-return result;
+return getConfiguredSessionCookieName(context, 
DEFAULT_SESSION_COOKIE_NAME);
 }
 
 /**
@@ -49,19 +42,11 @@ public class SessionConfig {
  * @return the parameter name for the session
  */
 public static String getSessionUriParamName(Context context) {
-
-String result = getConfiguredSessionCookieName(context);
-
-if (result == null) {
-result = DEFAULT_SESSION_PARAMETER_NAME;
-}
-
-return result;
+return getConfiguredSessionCookieName(context, 
DEFAULT_SESSION_PARAMETER_NAME);
 }
 
 
-private static String getConfiguredSessionCookieName(Context context) {
-
+private static String getConfiguredSessionCookieName(Context context, 
String defaultName) {
 // Priority is:
 // 1. Cookie name defined in context
 // 2. Cookie name configured for app
@@ -72,15 +57,13 @@ public class SessionConfig {
 return cookieName;
 }
 
-SessionCookieConfig scc =
-context.getServletContext().getSessionCookieConfig();
+SessionCookieConfig scc = 
context.getServletContext().getSessionCookieConfig();
 cookieName = scc.getName();
 if (cookieName != null && cookieName.length() > 0) {
 return cookieName;
 }
 }
-
-return null;
+return defaultName;
 }
 
 


-
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: Unify constant delimiters and Refactoring for better readability (#659)

2023-09-06 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 6a167f4af6 Unify constant delimiters and Refactoring for better 
readability (#659)
6a167f4af6 is described below

commit 6a167f4af6a410534d932f889e222a4ec3fbca20
Author: Mooo 
AuthorDate: Wed Sep 6 21:36:34 2023 +0900

Unify constant delimiters and Refactoring for better readability (#659)

Use an existing constants & remove unnecessary code

Co-authored-by: Mark Thomas 
---
 java/org/apache/catalina/manager/StatusTransformer.java | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/java/org/apache/catalina/manager/StatusTransformer.java 
b/java/org/apache/catalina/manager/StatusTransformer.java
index 4fee0cfbd6..ebda5230e7 100644
--- a/java/org/apache/catalina/manager/StatusTransformer.java
+++ b/java/org/apache/catalina/manager/StatusTransformer.java
@@ -468,33 +468,32 @@ public class StatusTransformer {
 
 switch (stage) {
 
-case (1/*org.apache.coyote.Constants.STAGE_PARSE*/):
+case (org.apache.coyote.Constants.STAGE_PARSE):
 stageStr = "P";
 fullStatus = false;
 break;
-case (2/*org.apache.coyote.Constants.STAGE_PREPARE*/):
+case (org.apache.coyote.Constants.STAGE_PREPARE):
 stageStr = "P";
 fullStatus = false;
 break;
-case (3/*org.apache.coyote.Constants.STAGE_SERVICE*/):
+case (org.apache.coyote.Constants.STAGE_SERVICE):
 stageStr = "S";
 break;
-case (4/*org.apache.coyote.Constants.STAGE_ENDINPUT*/):
+case (org.apache.coyote.Constants.STAGE_ENDINPUT):
 stageStr = "F";
 break;
-case (5/*org.apache.coyote.Constants.STAGE_ENDOUTPUT*/):
+case (org.apache.coyote.Constants.STAGE_ENDOUTPUT):
 stageStr = "F";
 break;
-case (7/*org.apache.coyote.Constants.STAGE_ENDED*/):
+case (org.apache.coyote.Constants.STAGE_ENDED):
 stageStr = "R";
 fullStatus = false;
 break;
-case (6/*org.apache.coyote.Constants.STAGE_KEEPALIVE*/):
+case (org.apache.coyote.Constants.STAGE_KEEPALIVE):
 stageStr = "K";
-fullStatus = true;
 showRequest = false;
 break;
-case (0/*org.apache.coyote.Constants.STAGE_NEW*/):
+case (org.apache.coyote.Constants.STAGE_NEW):
 stageStr = "R";
 fullStatus = false;
 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 pull request #660: Optimize when call getSessionCookieName & getSessionUriParamName

2023-09-06 Thread via GitHub


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

   Tx for the PR.


-- 
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 10.1.x updated: Optimize when call getSessionCookieName & getSessionUriParamName (#660)

2023-09-06 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 f818862f36 Optimize when call getSessionCookieName & 
getSessionUriParamName (#660)
f818862f36 is described below

commit f818862f3605ee02556f42dd3288fca8ebf14b14
Author: Herb 
AuthorDate: Wed Sep 6 21:41:53 2023 +0900

Optimize when call getSessionCookieName & getSessionUriParamName (#660)

Reduce duplicate / unnecessary code
---
 java/org/apache/catalina/util/SessionConfig.java | 27 +---
 1 file changed, 5 insertions(+), 22 deletions(-)

diff --git a/java/org/apache/catalina/util/SessionConfig.java 
b/java/org/apache/catalina/util/SessionConfig.java
index 6957285912..7720adcbf8 100644
--- a/java/org/apache/catalina/util/SessionConfig.java
+++ b/java/org/apache/catalina/util/SessionConfig.java
@@ -32,14 +32,7 @@ public class SessionConfig {
  * @return the cookie name for the context
  */
 public static String getSessionCookieName(Context context) {
-
-String result = getConfiguredSessionCookieName(context);
-
-if (result == null) {
-result = DEFAULT_SESSION_COOKIE_NAME;
-}
-
-return result;
+return getConfiguredSessionCookieName(context, 
DEFAULT_SESSION_COOKIE_NAME);
 }
 
 /**
@@ -49,19 +42,11 @@ public class SessionConfig {
  * @return the parameter name for the session
  */
 public static String getSessionUriParamName(Context context) {
-
-String result = getConfiguredSessionCookieName(context);
-
-if (result == null) {
-result = DEFAULT_SESSION_PARAMETER_NAME;
-}
-
-return result;
+return getConfiguredSessionCookieName(context, 
DEFAULT_SESSION_PARAMETER_NAME);
 }
 
 
-private static String getConfiguredSessionCookieName(Context context) {
-
+private static String getConfiguredSessionCookieName(Context context, 
String defaultName) {
 // Priority is:
 // 1. Cookie name defined in context
 // 2. Cookie name configured for app
@@ -72,15 +57,13 @@ public class SessionConfig {
 return cookieName;
 }
 
-SessionCookieConfig scc =
-context.getServletContext().getSessionCookieConfig();
+SessionCookieConfig scc = 
context.getServletContext().getSessionCookieConfig();
 cookieName = scc.getName();
 if (cookieName != null && cookieName.length() > 0) {
 return cookieName;
 }
 }
-
-return null;
+return defaultName;
 }
 
 


-
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: Optimize when call getSessionCookieName & getSessionUriParamName (#660)

2023-09-06 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 5379510e37 Optimize when call getSessionCookieName & 
getSessionUriParamName (#660)
5379510e37 is described below

commit 5379510e372f09e0fbf87941be41f2d3dd759290
Author: Herb 
AuthorDate: Wed Sep 6 21:41:53 2023 +0900

Optimize when call getSessionCookieName & getSessionUriParamName (#660)

Reduce duplicate / unnecessary code
---
 java/org/apache/catalina/util/SessionConfig.java | 27 +---
 1 file changed, 5 insertions(+), 22 deletions(-)

diff --git a/java/org/apache/catalina/util/SessionConfig.java 
b/java/org/apache/catalina/util/SessionConfig.java
index 69a0e09ad2..932c115820 100644
--- a/java/org/apache/catalina/util/SessionConfig.java
+++ b/java/org/apache/catalina/util/SessionConfig.java
@@ -32,14 +32,7 @@ public class SessionConfig {
  * @return the cookie name for the context
  */
 public static String getSessionCookieName(Context context) {
-
-String result = getConfiguredSessionCookieName(context);
-
-if (result == null) {
-result = DEFAULT_SESSION_COOKIE_NAME;
-}
-
-return result;
+return getConfiguredSessionCookieName(context, 
DEFAULT_SESSION_COOKIE_NAME);
 }
 
 /**
@@ -49,19 +42,11 @@ public class SessionConfig {
  * @return the parameter name for the session
  */
 public static String getSessionUriParamName(Context context) {
-
-String result = getConfiguredSessionCookieName(context);
-
-if (result == null) {
-result = DEFAULT_SESSION_PARAMETER_NAME;
-}
-
-return result;
+return getConfiguredSessionCookieName(context, 
DEFAULT_SESSION_PARAMETER_NAME);
 }
 
 
-private static String getConfiguredSessionCookieName(Context context) {
-
+private static String getConfiguredSessionCookieName(Context context, 
String defaultName) {
 // Priority is:
 // 1. Cookie name defined in context
 // 2. Cookie name configured for app
@@ -72,15 +57,13 @@ public class SessionConfig {
 return cookieName;
 }
 
-SessionCookieConfig scc =
-context.getServletContext().getSessionCookieConfig();
+SessionCookieConfig scc = 
context.getServletContext().getSessionCookieConfig();
 cookieName = scc.getName();
 if (cookieName != null && cookieName.length() > 0) {
 return cookieName;
 }
 }
-
-return null;
+return defaultName;
 }
 
 


-
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: Optimize when call getSessionCookieName & getSessionUriParamName (#660)

2023-09-06 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 cab09fcf75 Optimize when call getSessionCookieName & 
getSessionUriParamName (#660)
cab09fcf75 is described below

commit cab09fcf755400ef613f7989a2b43d1ce57e13f8
Author: Herb 
AuthorDate: Wed Sep 6 21:41:53 2023 +0900

Optimize when call getSessionCookieName & getSessionUriParamName (#660)

Reduce duplicate / unnecessary code
---
 java/org/apache/catalina/util/SessionConfig.java | 27 +---
 1 file changed, 5 insertions(+), 22 deletions(-)

diff --git a/java/org/apache/catalina/util/SessionConfig.java 
b/java/org/apache/catalina/util/SessionConfig.java
index 69a0e09ad2..932c115820 100644
--- a/java/org/apache/catalina/util/SessionConfig.java
+++ b/java/org/apache/catalina/util/SessionConfig.java
@@ -32,14 +32,7 @@ public class SessionConfig {
  * @return the cookie name for the context
  */
 public static String getSessionCookieName(Context context) {
-
-String result = getConfiguredSessionCookieName(context);
-
-if (result == null) {
-result = DEFAULT_SESSION_COOKIE_NAME;
-}
-
-return result;
+return getConfiguredSessionCookieName(context, 
DEFAULT_SESSION_COOKIE_NAME);
 }
 
 /**
@@ -49,19 +42,11 @@ public class SessionConfig {
  * @return the parameter name for the session
  */
 public static String getSessionUriParamName(Context context) {
-
-String result = getConfiguredSessionCookieName(context);
-
-if (result == null) {
-result = DEFAULT_SESSION_PARAMETER_NAME;
-}
-
-return result;
+return getConfiguredSessionCookieName(context, 
DEFAULT_SESSION_PARAMETER_NAME);
 }
 
 
-private static String getConfiguredSessionCookieName(Context context) {
-
+private static String getConfiguredSessionCookieName(Context context, 
String defaultName) {
 // Priority is:
 // 1. Cookie name defined in context
 // 2. Cookie name configured for app
@@ -72,15 +57,13 @@ public class SessionConfig {
 return cookieName;
 }
 
-SessionCookieConfig scc =
-context.getServletContext().getSessionCookieConfig();
+SessionCookieConfig scc = 
context.getServletContext().getSessionCookieConfig();
 cookieName = scc.getName();
 if (cookieName != null && cookieName.length() > 0) {
 return cookieName;
 }
 }
-
-return null;
+return defaultName;
 }
 
 


-
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 #662: Simplify and enhance charset extraction from content type

2023-09-06 Thread via GitHub


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


##
java/org/apache/coyote/Request.java:
##
@@ -852,25 +854,17 @@ public boolean isProcessing() {
  *
  * @param contentType a content type header
  */
-private static String getCharsetFromContentType(String contentType) {
+private static String getCharsetFromContentType(String contentType) throws 
IOException {

Review Comment:
   The PR won't compile because of this addition.  Look at how other code (e.g. 
in Response) handles the possibility of an IOException. Hint: the method 
signature should be unchanged from the original
   
   



-- 
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] iamjooon2 commented on pull request #652: Upgrade Readability by removing brackets

2023-09-06 Thread via GitHub


iamjooon2 commented on PR #652:
URL: https://github.com/apache/tomcat/pull/652#issuecomment-1708308925

   I rollbacked some codes.
   I really appreciate for your comments. 
   
   Have a good Day


-- 
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 #661: Unify conditional statement format

2023-09-06 Thread via GitHub


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

   Thanks for the PR. It is so much more efficient to review this sort of 
change at this sort of scale.
   
   Thanks for the De Morgan's law changes. I think those conditions are a lot 
easier to follow now.
   
   I'm not sure if some of the Panama code is generated or not but I don't 
think applying this change will hurt even if it is.


-- 
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 merged pull request #661: Unify conditional statement format

2023-09-06 Thread via GitHub


markt-asf merged PR #661:
URL: https://github.com/apache/tomcat/pull/661


-- 
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: Unify conditional statement format (#661)

2023-09-06 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 e34c370a60 Unify conditional statement format (#661)
e34c370a60 is described below

commit e34c370a60d0223387f078ad9b7f147bdb00c1ff
Author: ReO <89302528+jaeyoun...@users.noreply.github.com>
AuthorDate: Wed Sep 6 22:13:18 2023 +0900

Unify conditional statement format (#661)

Remove unnecessary parentheses

Simplify some conditional statements using De Morgan's law
---
 java/org/apache/catalina/ant/AbstractCatalinaTask.java |  2 +-
 java/org/apache/catalina/connector/Request.java|  4 ++--
 java/org/apache/catalina/connector/Response.java   |  2 +-
 java/org/apache/catalina/core/ApplicationContext.java  |  4 ++--
 java/org/apache/catalina/core/ApplicationFilterFactory.java|  2 +-
 java/org/apache/catalina/core/StandardContext.java |  2 +-
 java/org/apache/catalina/filters/CsrfPreventionFilter.java |  2 +-
 java/org/apache/catalina/manager/ManagerServlet.java   |  2 +-
 java/org/apache/catalina/manager/host/HostManagerServlet.java  |  2 +-
 java/org/apache/catalina/realm/JNDIRealm.java  |  2 +-
 java/org/apache/catalina/realm/RealmBase.java  |  2 +-
 java/org/apache/coyote/ajp/AjpMessage.java |  2 +-
 java/org/apache/coyote/http11/Http11InputBuffer.java   | 10 +-
 java/org/apache/coyote/http11/filters/ChunkedInputFilter.java  |  6 +++---
 .../apache/tomcat/util/descriptor/web/SecurityConstraint.java  |  4 ++--
 java/org/apache/tomcat/util/digester/RulesBase.java|  2 +-
 .../apache/tomcat/util/net/openssl/panama/OpenSSLContext.java  |  2 +-
 .../apache/tomcat/util/net/openssl/panama/OpenSSLContext.java  |  4 ++--
 .../apache/tomcat/util/net/openssl/panama/OpenSSLContext.java  |  2 +-
 19 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/java/org/apache/catalina/ant/AbstractCatalinaTask.java 
b/java/org/apache/catalina/ant/AbstractCatalinaTask.java
index 75676e2960..61ac76e5e5 100644
--- a/java/org/apache/catalina/ant/AbstractCatalinaTask.java
+++ b/java/org/apache/catalina/ant/AbstractCatalinaTask.java
@@ -233,7 +233,7 @@ public abstract class AbstractCatalinaTask extends 
BaseRedirectorHelperTask {
 int ch = reader.read();
 if (ch < 0) {
 break;
-} else if ((ch == '\r') || (ch == '\n')) {
+} else if (ch == '\r' || ch == '\n') {
 // in Win \r\n would cause handleOutput() to be called
 // twice, the second time with an empty string,
 // producing blank lines
diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 62307c0210..af9b81fe27 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -1443,7 +1443,7 @@ public class Request implements HttpServletRequest {
 return;
 }
 Object listeners[] = context.getApplicationEventListeners();
-if ((listeners == null) || (listeners.length == 0)) {
+if (listeners == null || listeners.length == 0) {
 return;
 }
 boolean replaced = (oldValue != null);
@@ -1484,7 +1484,7 @@ public class Request implements HttpServletRequest {
 private void notifyAttributeRemoved(String name, Object value) {
 Context context = getContext();
 Object listeners[] = context.getApplicationEventListeners();
-if ((listeners == null) || (listeners.length == 0)) {
+if (listeners == null || listeners.length == 0) {
 return;
 }
 ServletRequestAttributeEvent event =
diff --git a/java/org/apache/catalina/connector/Response.java 
b/java/org/apache/catalina/connector/Response.java
index 4de1e86b40..b149f9dec4 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -1656,7 +1656,7 @@ public class Response implements HttpServletResponse {
  * @return the encoded URL
  */
 protected String toEncoded(String url, String sessionId) {
-if ((url == null) || (sessionId == null)) {
+if (url == null || sessionId == null) {
 return url;
 }
 
diff --git a/java/org/apache/catalina/core/ApplicationContext.java 
b/java/org/apache/catalina/core/ApplicationContext.java
index 682ccc123b..2ebe16c967 100644
--- a/java/org/apache/catalina/core/ApplicationContext.java
+++ b/java/org/apache/catalina/core/ApplicationContext.java
@@ -608,7 +608,7 @@ public class ApplicationContext implements ServletContext {
 
 // Notify interested application event listeners
 Object listeners[] = contex

[tomcat] branch 10.1.x updated: Unify conditional statement format (#661)

2023-09-06 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 08cb24d124 Unify conditional statement format (#661)
08cb24d124 is described below

commit 08cb24d1249768d0d438748ec03a9a1d487a168f
Author: ReO <89302528+jaeyoun...@users.noreply.github.com>
AuthorDate: Wed Sep 6 22:13:18 2023 +0900

Unify conditional statement format (#661)

Remove unnecessary parentheses

Simplify some conditional statements using De Morgan's law
---
 java/org/apache/catalina/ant/AbstractCatalinaTask.java |  2 +-
 java/org/apache/catalina/connector/Request.java|  4 ++--
 java/org/apache/catalina/connector/Response.java   |  2 +-
 java/org/apache/catalina/core/ApplicationContext.java  |  4 ++--
 java/org/apache/catalina/core/ApplicationFilterFactory.java|  2 +-
 java/org/apache/catalina/core/StandardContext.java |  2 +-
 java/org/apache/catalina/filters/CsrfPreventionFilter.java |  2 +-
 java/org/apache/catalina/manager/ManagerServlet.java   |  2 +-
 java/org/apache/catalina/manager/host/HostManagerServlet.java  |  2 +-
 java/org/apache/catalina/realm/JNDIRealm.java  |  2 +-
 java/org/apache/catalina/realm/RealmBase.java  |  2 +-
 java/org/apache/coyote/ajp/AjpMessage.java |  2 +-
 java/org/apache/coyote/http11/Http11InputBuffer.java   | 10 +-
 java/org/apache/coyote/http11/filters/ChunkedInputFilter.java  |  6 +++---
 .../apache/tomcat/util/descriptor/web/SecurityConstraint.java  |  4 ++--
 java/org/apache/tomcat/util/digester/RulesBase.java|  2 +-
 16 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/java/org/apache/catalina/ant/AbstractCatalinaTask.java 
b/java/org/apache/catalina/ant/AbstractCatalinaTask.java
index 75676e2960..61ac76e5e5 100644
--- a/java/org/apache/catalina/ant/AbstractCatalinaTask.java
+++ b/java/org/apache/catalina/ant/AbstractCatalinaTask.java
@@ -233,7 +233,7 @@ public abstract class AbstractCatalinaTask extends 
BaseRedirectorHelperTask {
 int ch = reader.read();
 if (ch < 0) {
 break;
-} else if ((ch == '\r') || (ch == '\n')) {
+} else if (ch == '\r' || ch == '\n') {
 // in Win \r\n would cause handleOutput() to be called
 // twice, the second time with an empty string,
 // producing blank lines
diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index 93be485edd..8b8659d88a 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -1506,7 +1506,7 @@ public class Request implements HttpServletRequest {
 return;
 }
 Object listeners[] = context.getApplicationEventListeners();
-if ((listeners == null) || (listeners.length == 0)) {
+if (listeners == null || listeners.length == 0) {
 return;
 }
 boolean replaced = (oldValue != null);
@@ -1547,7 +1547,7 @@ public class Request implements HttpServletRequest {
 private void notifyAttributeRemoved(String name, Object value) {
 Context context = getContext();
 Object listeners[] = context.getApplicationEventListeners();
-if ((listeners == null) || (listeners.length == 0)) {
+if (listeners == null || listeners.length == 0) {
 return;
 }
 ServletRequestAttributeEvent event =
diff --git a/java/org/apache/catalina/connector/Response.java 
b/java/org/apache/catalina/connector/Response.java
index f512ca0fd2..0006a7b5f5 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -1691,7 +1691,7 @@ public class Response implements HttpServletResponse {
  * @return the encoded URL
  */
 protected String toEncoded(String url, String sessionId) {
-if ((url == null) || (sessionId == null)) {
+if (url == null || sessionId == null) {
 return url;
 }
 
diff --git a/java/org/apache/catalina/core/ApplicationContext.java 
b/java/org/apache/catalina/core/ApplicationContext.java
index 691ce5acc6..d3841d45b2 100644
--- a/java/org/apache/catalina/core/ApplicationContext.java
+++ b/java/org/apache/catalina/core/ApplicationContext.java
@@ -608,7 +608,7 @@ public class ApplicationContext implements ServletContext {
 
 // Notify interested application event listeners
 Object listeners[] = context.getApplicationEventListeners();
-if ((listeners == null) || (listeners.length == 0)) {
+if (listeners == null || listeners.length == 0) {
 return;
 }
 ServletContextAtt

[tomcat] branch 9.0.x updated: Unify conditional statement format (#661)

2023-09-06 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 b71907391c Unify conditional statement format (#661)
b71907391c is described below

commit b71907391c0b46ee3541cd3f5d92fb6f0f0eabea
Author: ReO <89302528+jaeyoun...@users.noreply.github.com>
AuthorDate: Wed Sep 6 22:13:18 2023 +0900

Unify conditional statement format (#661)

Remove unnecessary parentheses

Simplify some conditional statements using De Morgan's law
---
 java/org/apache/catalina/ant/AbstractCatalinaTask.java |  2 +-
 java/org/apache/catalina/connector/Request.java|  4 ++--
 java/org/apache/catalina/connector/Response.java   |  2 +-
 java/org/apache/catalina/core/ApplicationContext.java  |  4 ++--
 java/org/apache/catalina/core/ApplicationFilterFactory.java|  2 +-
 java/org/apache/catalina/core/StandardContext.java |  2 +-
 java/org/apache/catalina/filters/CsrfPreventionFilter.java |  2 +-
 java/org/apache/catalina/manager/ManagerServlet.java   |  2 +-
 java/org/apache/catalina/manager/host/HostManagerServlet.java  |  2 +-
 java/org/apache/catalina/realm/JNDIRealm.java  |  2 +-
 java/org/apache/catalina/realm/RealmBase.java  |  2 +-
 java/org/apache/coyote/ajp/AjpMessage.java |  2 +-
 java/org/apache/coyote/http11/Http11InputBuffer.java   | 10 +-
 java/org/apache/coyote/http11/filters/ChunkedInputFilter.java  |  6 +++---
 .../apache/tomcat/util/descriptor/web/SecurityConstraint.java  |  4 ++--
 java/org/apache/tomcat/util/digester/RulesBase.java|  2 +-
 16 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/java/org/apache/catalina/ant/AbstractCatalinaTask.java 
b/java/org/apache/catalina/ant/AbstractCatalinaTask.java
index 75676e2960..61ac76e5e5 100644
--- a/java/org/apache/catalina/ant/AbstractCatalinaTask.java
+++ b/java/org/apache/catalina/ant/AbstractCatalinaTask.java
@@ -233,7 +233,7 @@ public abstract class AbstractCatalinaTask extends 
BaseRedirectorHelperTask {
 int ch = reader.read();
 if (ch < 0) {
 break;
-} else if ((ch == '\r') || (ch == '\n')) {
+} else if (ch == '\r' || ch == '\n') {
 // in Win \r\n would cause handleOutput() to be called
 // twice, the second time with an empty string,
 // producing blank lines
diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index eb07a8c749..8f1e4aac16 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -1563,7 +1563,7 @@ public class Request implements HttpServletRequest {
 return;
 }
 Object listeners[] = context.getApplicationEventListeners();
-if ((listeners == null) || (listeners.length == 0)) {
+if (listeners == null || listeners.length == 0) {
 return;
 }
 boolean replaced = (oldValue != null);
@@ -1604,7 +1604,7 @@ public class Request implements HttpServletRequest {
 private void notifyAttributeRemoved(String name, Object value) {
 Context context = getContext();
 Object listeners[] = context.getApplicationEventListeners();
-if ((listeners == null) || (listeners.length == 0)) {
+if (listeners == null || listeners.length == 0) {
 return;
 }
 ServletRequestAttributeEvent event =
diff --git a/java/org/apache/catalina/connector/Response.java 
b/java/org/apache/catalina/connector/Response.java
index e3c2c27339..8be3c26a95 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -1780,7 +1780,7 @@ public class Response implements HttpServletResponse {
  * @return the encoded URL
  */
 protected String toEncoded(String url, String sessionId) {
-if ((url == null) || (sessionId == null)) {
+if (url == null || sessionId == null) {
 return url;
 }
 
diff --git a/java/org/apache/catalina/core/ApplicationContext.java 
b/java/org/apache/catalina/core/ApplicationContext.java
index 409018243d..1f00282154 100644
--- a/java/org/apache/catalina/core/ApplicationContext.java
+++ b/java/org/apache/catalina/core/ApplicationContext.java
@@ -664,7 +664,7 @@ public class ApplicationContext implements ServletContext {
 
 // Notify interested application event listeners
 Object listeners[] = context.getApplicationEventListeners();
-if ((listeners == null) || (listeners.length == 0)) {
+if (listeners == null || listeners.length == 0) {
 return;
 }
 ServletContextAttri

[tomcat] branch 8.5.x updated: Unify conditional statement format (#661)

2023-09-06 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 7fcb7c9dc9 Unify conditional statement format (#661)
7fcb7c9dc9 is described below

commit 7fcb7c9dc949733dd5c273a7799ca4e46968d006
Author: ReO <89302528+jaeyoun...@users.noreply.github.com>
AuthorDate: Wed Sep 6 22:13:18 2023 +0900

Unify conditional statement format (#661)

Remove unnecessary parentheses

Simplify some conditional statements using De Morgan's law
---
 java/org/apache/catalina/ant/AbstractCatalinaTask.java |  2 +-
 java/org/apache/catalina/connector/Request.java|  4 ++--
 java/org/apache/catalina/connector/Response.java   |  2 +-
 java/org/apache/catalina/core/ApplicationContext.java  |  4 ++--
 java/org/apache/catalina/core/ApplicationFilterFactory.java|  2 +-
 java/org/apache/catalina/core/StandardContext.java |  2 +-
 java/org/apache/catalina/filters/CsrfPreventionFilter.java |  2 +-
 java/org/apache/catalina/manager/ManagerServlet.java   |  2 +-
 java/org/apache/catalina/manager/host/HostManagerServlet.java  |  2 +-
 java/org/apache/catalina/realm/JNDIRealm.java  |  2 +-
 java/org/apache/catalina/realm/RealmBase.java  |  2 +-
 java/org/apache/coyote/ajp/AjpMessage.java |  2 +-
 java/org/apache/coyote/http11/Http11InputBuffer.java   | 10 +-
 java/org/apache/coyote/http11/filters/ChunkedInputFilter.java  |  6 +++---
 .../apache/tomcat/util/descriptor/web/SecurityConstraint.java  |  4 ++--
 java/org/apache/tomcat/util/digester/RulesBase.java|  2 +-
 16 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/java/org/apache/catalina/ant/AbstractCatalinaTask.java 
b/java/org/apache/catalina/ant/AbstractCatalinaTask.java
index 75676e2960..61ac76e5e5 100644
--- a/java/org/apache/catalina/ant/AbstractCatalinaTask.java
+++ b/java/org/apache/catalina/ant/AbstractCatalinaTask.java
@@ -233,7 +233,7 @@ public abstract class AbstractCatalinaTask extends 
BaseRedirectorHelperTask {
 int ch = reader.read();
 if (ch < 0) {
 break;
-} else if ((ch == '\r') || (ch == '\n')) {
+} else if (ch == '\r' || ch == '\n') {
 // in Win \r\n would cause handleOutput() to be called
 // twice, the second time with an empty string,
 // producing blank lines
diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index f95095525b..931e2f7fe1 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -1573,7 +1573,7 @@ public class Request implements HttpServletRequest {
 return;
 }
 Object listeners[] = context.getApplicationEventListeners();
-if ((listeners == null) || (listeners.length == 0)) {
+if (listeners == null || listeners.length == 0) {
 return;
 }
 boolean replaced = (oldValue != null);
@@ -1614,7 +1614,7 @@ public class Request implements HttpServletRequest {
 private void notifyAttributeRemoved(String name, Object value) {
 Context context = getContext();
 Object listeners[] = context.getApplicationEventListeners();
-if ((listeners == null) || (listeners.length == 0)) {
+if (listeners == null || listeners.length == 0) {
 return;
 }
 ServletRequestAttributeEvent event =
diff --git a/java/org/apache/catalina/connector/Response.java 
b/java/org/apache/catalina/connector/Response.java
index 914199321c..ddc67e955f 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -1782,7 +1782,7 @@ public class Response implements HttpServletResponse {
  * @return the encoded URL
  */
 protected String toEncoded(String url, String sessionId) {
-if ((url == null) || (sessionId == null)) {
+if (url == null || sessionId == null) {
 return url;
 }
 
diff --git a/java/org/apache/catalina/core/ApplicationContext.java 
b/java/org/apache/catalina/core/ApplicationContext.java
index 1e33f41dbd..af14aefd26 100644
--- a/java/org/apache/catalina/core/ApplicationContext.java
+++ b/java/org/apache/catalina/core/ApplicationContext.java
@@ -664,7 +664,7 @@ public class ApplicationContext implements ServletContext {
 
 // Notify interested application event listeners
 Object listeners[] = context.getApplicationEventListeners();
-if ((listeners == null) || (listeners.length == 0)) {
+if (listeners == null || listeners.length == 0) {
 return;
 }
 ServletContextAttri

[GitHub] [tomcat] ChrissW-R1 opened a new pull request, #665: Update tool-wrapper.bat

2023-09-06 Thread via GitHub


ChrissW-R1 opened a new pull request, #665:
URL: https://github.com/apache/tomcat/pull/665

   Solved issue with spaces in path.
   
   If you install tomcat on windows in a path with spaces, the tool-wrapper.bat 
could be executed. This PR adds two missing qoutes to solve this issue.


-- 
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 #664: Improved code readability

2023-09-06 Thread via GitHub


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

   Included in #661 


-- 
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 closed pull request #664: Improved code readability

2023-09-06 Thread via GitHub


markt-asf closed pull request #664: Improved code readability
URL: https://github.com/apache/tomcat/pull/664


-- 
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-connectors] branch main updated: Add additional bounds and error checking when reading AJP messages.

2023-09-06 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-connectors.git


The following commit(s) were added to refs/heads/main by this push:
 new 97da2b17a Add additional bounds and error checking when reading AJP 
messages.
97da2b17a is described below

commit 97da2b17a08dacfde785cf29c8fba07194e08997
Author: Mark Thomas 
AuthorDate: Wed Sep 6 15:22:31 2023 +0100

Add additional bounds and error checking when reading AJP messages.

schultz/markt
---
 native/common/jk_ajp_common.c | 59 +++
 native/common/jk_msg_buff.c   | 15 --
 xdocs/miscellaneous/changelog.xml |  6 +++-
 3 files changed, 65 insertions(+), 15 deletions(-)

diff --git a/native/common/jk_ajp_common.c b/native/common/jk_ajp_common.c
index bd6dc46f5..1cb2c6405 100644
--- a/native/common/jk_ajp_common.c
+++ b/native/common/jk_ajp_common.c
@@ -730,6 +730,12 @@ static int ajp_unmarshal_response(jk_msg_buf_t *msg,
 JK_TRACE_EXIT(l);
 return JK_FALSE;
 }
+if (d->status == 0x) {
+jk_log(l, JK_LOG_ERROR,
+   "(%s) Not enough bytes available to read status", 
ae->worker->name);
+JK_TRACE_EXIT(l);
+return JK_FALSE;
+}
 
 d->msg = jk_b_get_string(msg);
 if (d->msg) {
@@ -743,6 +749,12 @@ static int ajp_unmarshal_response(jk_msg_buf_t *msg,
"(%s) status = %d", ae->worker->name, d->status);
 
 d->num_headers = jk_b_get_int(msg);
+if (d->num_headers == 0x) {
+jk_log(l, JK_LOG_ERROR,
+   "(%s) Not enough bytes available to read header count", 
ae->worker->name);
+JK_TRACE_EXIT(l);
+return JK_FALSE;
+}
 d->header_names = d->header_values = NULL;
 
 if (JK_IS_DEBUG_LEVEL(l))
@@ -757,9 +769,15 @@ static int ajp_unmarshal_response(jk_msg_buf_t *msg,
 if (d->header_names && d->header_values) {
 unsigned int i;
 for (i = 0; i < d->num_headers; i++) {
+/*
+ * Looking for a specific value. No need to check for errors.
+ * That will be handled by jk_b_get_string if the specific
+ * value is not found.
+ */
 unsigned short name = jk_b_pget_int(msg, msg->pos);
 
 if ((name & 0XFF00) == 0XA000) {
+/* Consume bytes just peeked with jk_b_pget_int */
 jk_b_get_int(msg);
 name = name & 0X00FF;
 if (name <= SC_RES_HEADERS_NUM) {
@@ -2076,16 +2094,26 @@ static int ajp_process_callback(jk_msg_buf_t *msg,
 return JK_AJP13_ERROR;
 }
 if (!s->response_blocked) {
-unsigned int len = (unsigned int)jk_b_get_int(msg);
+unsigned int len;
+/* Check there is sufficient data in the ajp message to read a 
valid
+ * length. It must be at least 3 bytes - the magic byte for
+ * JK_AJP13_SEND_BODY_CHUNK (1 byte) and the length of the chunk
+ * (2 bytes). The remaining part of the message is the chunk.
+ */
+if (msg->len < 3) {
+jk_log(l, JK_LOG_ERROR,
+   "(%s) Invalid AJP message. Length of AJP message "
+   "is %d, but it should be at least 3.",
+   ae->worker->name, msg->len);
+JK_TRACE_EXIT(l);
+return JK_INTERNAL_ERROR;
+}
 /*
- * Do a sanity check on len to prevent write reading beyond buffer
- * boundaries and thus revealing possible sensitive memory
+ * Once we have len, do a sanity check to prevent reading beyond
+ * buffer boundaries and thus revealing possible sensitive memory
  * contents to the client.
- * len cannot be larger than msg->len - 3 because the ajp message
- * contains the magic byte for JK_AJP13_SEND_BODY_CHUNK (1 byte)
- * and the length of the chunk (2 bytes). The remaining part of
- * the message is the chunk.
  */
+len = (unsigned int)jk_b_get_int(msg);
 if (len > (unsigned int)(msg->len - 3)) {
 jk_log(l, JK_LOG_ERROR,
"(%s) Chunk length too large. Length of AJP message "
@@ -2126,9 +2154,12 @@ static int ajp_process_callback(jk_msg_buf_t *msg,
 case JK_AJP13_GET_BODY_CHUNK:
 {
 int len = (int)jk_b_get_int(msg);
-
-if (len < 0) {
-len = 0;
+if (len == 0x) {
+jk_log(l, JK_LOG_ERROR,
+   "(%s) Invalid AJP message: Not enough bytes available 
to read chunk length",
+   ae->worker->name);
+JK_TRACE_EXIT(l);
+return JK_AJP13_ERROR;
 

[tomcat-connectors] branch main updated: Remove support for implicit mapping (rjung)

2023-09-06 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-connectors.git


The following commit(s) were added to refs/heads/main by this push:
 new 0095b6cb8 Remove support for implicit mapping (rjung)
0095b6cb8 is described below

commit 0095b6cb84f41313ee4c0364b49c766168790792
Author: Mark Thomas 
AuthorDate: Wed Sep 6 15:25:10 2023 +0100

Remove support for implicit mapping (rjung)
---
 native/apache-2.0/mod_jk.c| 19 ---
 xdocs/miscellaneous/changelog.xml |  4 
 xdocs/reference/apache.xml|  4 +---
 3 files changed, 5 insertions(+), 22 deletions(-)

diff --git a/native/apache-2.0/mod_jk.c b/native/apache-2.0/mod_jk.c
index 720d7f7fa..b990cb74e 100644
--- a/native/apache-2.0/mod_jk.c
+++ b/native/apache-2.0/mod_jk.c
@@ -2819,17 +2819,6 @@ static int jk_handler(request_rec * r)
 rconf->rule_extensions = e;
 }
 }
-else if (worker_env.num_of_workers == 1) {
-  /** We have a single worker (the common case).
-  (lb is a bit special, it should count as a single worker but
-  I'm not sure how). We also have a manual config directive that
-  explicitly give control to us. */
-worker_name = worker_env.worker_list[0];
-if (JK_IS_DEBUG_LEVEL(l))
-jk_log(l, JK_LOG_DEBUG,
-   "Single worker (%s) configuration for %s",
-   worker_name, r->uri);
-}
 else {
 if (!xconf->uw_map) {
 if (JK_IS_DEBUG_LEVEL(l))
@@ -2856,14 +2845,6 @@ static int jk_handler(request_rec * r)
 r->uri = clean_uri;
 }
 }
-
-if (worker_name == NULL && worker_env.num_of_workers) {
-worker_name = worker_env.worker_list[0];
-if (JK_IS_DEBUG_LEVEL(l))
-jk_log(l, JK_LOG_DEBUG,
-   "Using first worker (%s) from %d workers for %s",
-   worker_name, worker_env.num_of_workers, r->uri);
-}
 }
 if (worker_name)
 apr_table_setn(r->notes, JK_NOTE_WORKER_NAME, worker_name);
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index 62af3e643..d39bb7c81 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -68,6 +68,10 @@
 of module internal symbols led to crashes when conflicting with library
 symbols. Based on a patch provided by Josef Čejka. (rjung)
   
+  
+Remove support for implicit mapping of requests to workers. All 
mappings
+must now be explicit. (rjung) 
+  
 
   
   
diff --git a/xdocs/reference/apache.xml b/xdocs/reference/apache.xml
index 07101aaef..6f3fbe6b2 100644
--- a/xdocs/reference/apache.xml
+++ b/xdocs/reference/apache.xml
@@ -1099,9 +1099,7 @@ ways of defining the forwards, in general to mod_jk 
directives will win.
 
 
 SetHandler jakarta-servlet forces requests to be handled by mod_jk.
-If you neither specify any workers via JkMount and the related directives,
-not via the environment variable described below,
-the first worker in the list of all worker will be chosen. You can use 
SetHandler
+You can use SetHandler
 for example in Location blocks or with Apache 2.2 and later also in 
RewriteRule.
 
 


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



Tagging mod_jk

2023-09-06 Thread Mark Thomas

Hi all,

After a long period of inactivity we have had some bug fixes for mod_jk 
so I am planning a Tomcat Connectors tag shortly.


I need to run through my pre-tag checks and I'll tag after that - 
hopefully in a couple of hours.


If you have any final changes for Tomcat Connectors now is the time to 
commit them or let me know to delay the tag.


Mark

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



[tomcat-connectors] 02/02: Remove reference to deleted file

2023-09-06 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-connectors.git

commit c74414153e43c9886c2e2d44356516f34fed0390
Author: Mark Thomas 
AuthorDate: Wed Sep 6 16:14:06 2023 +0100

Remove reference to deleted file
---
 HOWTO-RELEASE.txt | 1 -
 1 file changed, 1 deletion(-)

diff --git a/HOWTO-RELEASE.txt b/HOWTO-RELEASE.txt
index e691a93fe..8586607d7 100644
--- a/HOWTO-RELEASE.txt
+++ b/HOWTO-RELEASE.txt
@@ -163,7 +163,6 @@ Update source for next version
 native/configure.ac: Update version in AC_INIT macro.
 native/common/jk_version.h: Update variables JK_VERMAJOR, JK_VERMINOR, 
JK_VERFIX,
 JK_VERSTRING, and JK_VERISRELEASE.
-native/iis/installer/isapi-redirector-win32-msi.ism: Update ProductVersion.
 xdocs/miscellaneous/changelog.xml: Start a new section for the new version.
 
 Remove old release distributions from www.apache.org


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



[tomcat-connectors] branch main updated (0095b6cb8 -> c74414153)

2023-09-06 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 0095b6cb8 Remove support for implicit mapping (rjung)
 new 20572f572 Add info on 1.2.49 release with estimated release date
 new c74414153 Remove reference to deleted file

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


Summary of changes:
 HOWTO-RELEASE.txt |  1 -
 xdocs/ajp/project.xml |  2 ++
 xdocs/common_howto/project.xml|  2 ++
 xdocs/index.xml   |  6 +++---
 xdocs/miscellaneous/project.xml   |  2 ++
 xdocs/news/{20200201.xml => 2023.xml} | 10 +-
 xdocs/news/project.xml|  1 +
 xdocs/project.xml |  1 +
 xdocs/reference/project.xml   |  3 ++-
 xdocs/webserver_howto/project.xml |  1 +
 10 files changed, 19 insertions(+), 10 deletions(-)
 copy xdocs/news/{20200201.xml => 2023.xml} (86%)


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



[tomcat-connectors] 01/02: Add info on 1.2.49 release with estimated release date

2023-09-06 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-connectors.git

commit 20572f572815ce9d6ceacf666de6212d6964f7eb
Author: Mark Thomas 
AuthorDate: Wed Sep 6 16:07:40 2023 +0100

Add info on 1.2.49 release with estimated release date
---
 xdocs/ajp/project.xml |  2 ++
 xdocs/common_howto/project.xml|  2 ++
 xdocs/index.xml   |  6 ++---
 xdocs/miscellaneous/project.xml   |  2 ++
 xdocs/news/2023.xml   | 48 +++
 xdocs/news/project.xml|  1 +
 xdocs/project.xml |  1 +
 xdocs/reference/project.xml   |  3 ++-
 xdocs/webserver_howto/project.xml |  1 +
 9 files changed, 62 insertions(+), 4 deletions(-)

diff --git a/xdocs/ajp/project.xml b/xdocs/ajp/project.xml
index d3851c4f2..77190d7ec 100644
--- a/xdocs/ajp/project.xml
+++ b/xdocs/ajp/project.xml
@@ -65,6 +65,8 @@
 
 
 
+
+
 
 
 
diff --git a/xdocs/common_howto/project.xml b/xdocs/common_howto/project.xml
index 141559ab1..ac8f2bcda 100644
--- a/xdocs/common_howto/project.xml
+++ b/xdocs/common_howto/project.xml
@@ -65,6 +65,8 @@
 
 
 
+
+
 
 
 
diff --git a/xdocs/index.xml b/xdocs/index.xml
index a1f40cfac..36c3941e1 100644
--- a/xdocs/index.xml
+++ b/xdocs/index.xml
@@ -60,12 +60,12 @@ manual is described in more detail below.
 
 
 
-JK-1.2.48 
released
+JK-1.2.49 released
 The Apache Tomcat team is proud to announce the immediate availability
-   of Tomcat Connectors 1.2.48 Stable. This release contains improvements and
+   of Tomcat Connectors 1.2.49 Stable. This release contains improvements and
bug fixes for issues found in previous releases.

-Download the JK 1.2.48
+Download the JK 1.2.49
release.
 
 
diff --git a/xdocs/miscellaneous/project.xml b/xdocs/miscellaneous/project.xml
index 5217c808e..913d072c6 100644
--- a/xdocs/miscellaneous/project.xml
+++ b/xdocs/miscellaneous/project.xml
@@ -65,6 +65,8 @@
 
 
 
+
+
 
 
 
diff --git a/xdocs/news/2023.xml b/xdocs/news/2023.xml
new file mode 100644
index 0..6d5c7012a
--- /dev/null
+++ b/xdocs/news/2023.xml
@@ -0,0 +1,48 @@
+
+
+
+]>
+
+
+  &project;
+
+  
+Apache Tomcat Connectors 
Project
+2023 News & Status
+  
+
+
+
+
+
+
+The Apache Tomcat team is proud to announce the immediate availability
+   of Tomcat Connectors 1.2.49. This is a maintenance release.
+
+Please see the ChangeLog
+   for a full list of changes.
+
+If you find any bugs while using this release, please fill in the
+https://bz.apache.org/bugzilla/enter_bug.cgi?product=Tomcat%20Connectors";>Bugzilla
+Bug Report.
+
+
+
+
+
diff --git a/xdocs/news/project.xml b/xdocs/news/project.xml
index 092b87044..2df7c9fc0 100644
--- a/xdocs/news/project.xml
+++ b/xdocs/news/project.xml
@@ -65,6 +65,7 @@
 
 
 
+
 
 
 
diff --git a/xdocs/project.xml b/xdocs/project.xml
index f819773d3..8b94251f3 100644
--- a/xdocs/project.xml
+++ b/xdocs/project.xml
@@ -65,6 +65,7 @@
 
 
 
+
 
 
 
diff --git a/xdocs/reference/project.xml b/xdocs/reference/project.xml
index cb493a2f9..cf5445783 100644
--- a/xdocs/reference/project.xml
+++ b/xdocs/reference/project.xml
@@ -65,9 +65,10 @@
 
 
 
+
 
 
-
+
 
 
 
diff --git a/xdocs/webserver_howto/project.xml 
b/xdocs/webserver_howto/project.xml
index 0983bc0f5..d0ca50707 100644
--- a/xdocs/webserver_howto/project.xml
+++ b/xdocs/webserver_howto/project.xml
@@ -65,6 +65,7 @@
 
 
 
+
 
 
 


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



[tomcat-connectors] branch main updated: Remove references to deleted defines

2023-09-06 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-connectors.git


The following commit(s) were added to refs/heads/main by this push:
 new 34f0d9348 Remove references to deleted defines
34f0d9348 is described below

commit 34f0d9348e80389d8aa7c7089512cd3f13275ec6
Author: Mark Thomas 
AuthorDate: Wed Sep 6 16:18:01 2023 +0100

Remove references to deleted defines
---
 HOWTO-RELEASE.txt | 16 
 1 file changed, 16 deletions(-)

diff --git a/HOWTO-RELEASE.txt b/HOWTO-RELEASE.txt
index 8586607d7..186baf7bb 100644
--- a/HOWTO-RELEASE.txt
+++ b/HOWTO-RELEASE.txt
@@ -57,22 +57,6 @@ native/configure.ac
 native/common/jk_version.h
 xdocs/miscellaneous/changelog.xml
 
-Update the JK_VERISRELEASE define in native/common/jk_version.h, here is
-a git diff that shows what I changed:
-
-Index: native/common/jk_version.h
-===
 native/common/jk_version.h  (revision 417260)
-+++ native/common/jk_version.h  (working copy)
-@@ -32,7 +32,7 @@
- #define JK_VERBETA  0
- #define JK_BETASTRING   "0"
- /* set JK_VERISRELEASE to 1 when release (do not forget to commit!) */
--#define JK_VERISRELEASE 0
-+#define JK_VERISRELEASE 1
- #define JK_VERRC0
- #define JK_RCSTRING "0"
-
 After updating revision numbers, commit your changes to git.
 
 Tag tomcat-connectors in git


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



[tomcat-connectors] branch main updated (34f0d9348 -> b9e035d4f)

2023-09-06 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 34f0d9348 Remove references to deleted defines
 new 7b13ea4d5 Fix directory paths
 new 88e806e8b Use the Tomcat Native solution to fix the CHANGES file
 new b9e035d4f Use UTF-8 consistently

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:
 tools/jkrelease.sh|  16 ++--
 xdocs/ajp/ajpv13a.xml |   2 +-
 xdocs/ajp/ajpv13ext.xml   |   2 +-
 xdocs/ajp/project.xml |   2 +-
 xdocs/common_howto/loadbalancers.xml  |   2 +-
 xdocs/common_howto/project.xml|   2 +-
 xdocs/common_howto/proxy.xml  |   2 +-
 xdocs/common_howto/quick.xml  |   2 +-
 xdocs/common_howto/timeouts.xml   |   2 +-
 xdocs/common_howto/workers.xml|   2 +-
 xdocs/empty.xml   |   2 +-
 xdocs/index.xml   |   2 +-
 xdocs/miscellaneous/changelog.xml |   2 +-
 xdocs/miscellaneous/doccontrib.xml|   2 +-
 xdocs/miscellaneous/faq.xml   |   2 +-
 xdocs/miscellaneous/jkstatustasks.xml |   2 +-
 xdocs/miscellaneous/project.xml   |   2 +-
 xdocs/miscellaneous/reporttools.xml   |   2 +-
 xdocs/news/20041100.xml   |   2 +-
 xdocs/news/20050101.xml   |   2 +-
 xdocs/news/20060101.xml   |   2 +-
 xdocs/news/20070301.xml   |   2 +-
 xdocs/news/20081001.xml   |   2 +-
 xdocs/news/20090301.xml   |   2 +-
 xdocs/news/20100101.xml   |   2 +-
 xdocs/news/20110701.xml   |   2 +-
 xdocs/news/20120301.xml   |   2 +-
 xdocs/news/20140201.xml   |   2 +-
 xdocs/news/20150101.xml   |   2 +-
 xdocs/news/20160901.xml   |   2 +-
 xdocs/news/20180301.xml   | 144 +-
 xdocs/news/20200201.xml   |   2 +-
 xdocs/news/2023.xml   |   2 +-
 xdocs/news/project.xml|   2 +-
 xdocs/project.xml |   2 +-
 xdocs/reference/apache.xml|   2 +-
 xdocs/reference/iis.xml   |   2 +-
 xdocs/reference/project.xml   |   2 +-
 xdocs/reference/status.xml|   2 +-
 xdocs/reference/uriworkermap.xml  |   2 +-
 xdocs/reference/workers.xml   |   2 +-
 xdocs/webserver_howto/apache.xml  |   8 +-
 xdocs/webserver_howto/iis.xml |   2 +-
 xdocs/webserver_howto/project.xml |   2 +-
 44 files changed, 127 insertions(+), 123 deletions(-)


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



[tomcat-connectors] 02/03: Use the Tomcat Native solution to fix the CHANGES file

2023-09-06 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-connectors.git

commit 88e806e8bbcac8241da88d148c21dda26b22ddf7
Author: Mark Thomas 
AuthorDate: Wed Sep 6 17:48:00 2023 +0100

Use the Tomcat Native solution to fix the CHANGES file
---
 tools/jkrelease.sh | 4 
 1 file changed, 4 insertions(+)

diff --git a/tools/jkrelease.sh b/tools/jkrelease.sh
index 309f7e679..ebc0845d9 100755
--- a/tools/jkrelease.sh
+++ b/tools/jkrelease.sh
@@ -412,6 +412,10 @@ do
 rm -f CHANGES
 echo "Creating the CHANGES file using '$TOOL' ..."
 ${TOOL} ../docs/miscellaneous/changelog.html > CHANGES 2>/dev/null
+# Remove page navigation data from converted file.
+cp -p CHANGES CHANGES.tmp
+awk '/Preface/ {o=1} o>0' CHANGES.tmp > CHANGES
+rm CHANGES.tmp
 if [ -f CHANGES -a -s CHANGES ]
 then
   failed=false


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



[tomcat-connectors] 03/03: Use UTF-8 consistently

2023-09-06 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-connectors.git

commit b9e035d4fa6728dced13bcae449970075196b8fc
Author: Mark Thomas 
AuthorDate: Wed Sep 6 18:00:07 2023 +0100

Use UTF-8 consistently
---
 tools/jkrelease.sh|   8 +-
 xdocs/ajp/ajpv13a.xml |   2 +-
 xdocs/ajp/ajpv13ext.xml   |   2 +-
 xdocs/ajp/project.xml |   2 +-
 xdocs/common_howto/loadbalancers.xml  |   2 +-
 xdocs/common_howto/project.xml|   2 +-
 xdocs/common_howto/proxy.xml  |   2 +-
 xdocs/common_howto/quick.xml  |   2 +-
 xdocs/common_howto/timeouts.xml   |   2 +-
 xdocs/common_howto/workers.xml|   2 +-
 xdocs/empty.xml   |   2 +-
 xdocs/index.xml   |   2 +-
 xdocs/miscellaneous/changelog.xml |   2 +-
 xdocs/miscellaneous/doccontrib.xml|   2 +-
 xdocs/miscellaneous/faq.xml   |   2 +-
 xdocs/miscellaneous/jkstatustasks.xml |   2 +-
 xdocs/miscellaneous/project.xml   |   2 +-
 xdocs/miscellaneous/reporttools.xml   |   2 +-
 xdocs/news/20041100.xml   |   2 +-
 xdocs/news/20050101.xml   |   2 +-
 xdocs/news/20060101.xml   |   2 +-
 xdocs/news/20070301.xml   |   2 +-
 xdocs/news/20081001.xml   |   2 +-
 xdocs/news/20090301.xml   |   2 +-
 xdocs/news/20100101.xml   |   2 +-
 xdocs/news/20110701.xml   |   2 +-
 xdocs/news/20120301.xml   |   2 +-
 xdocs/news/20140201.xml   |   2 +-
 xdocs/news/20150101.xml   |   2 +-
 xdocs/news/20160901.xml   |   2 +-
 xdocs/news/20180301.xml   | 144 +-
 xdocs/news/20200201.xml   |   2 +-
 xdocs/news/2023.xml   |   2 +-
 xdocs/news/project.xml|   2 +-
 xdocs/project.xml |   2 +-
 xdocs/reference/apache.xml|   2 +-
 xdocs/reference/iis.xml   |   2 +-
 xdocs/reference/project.xml   |   2 +-
 xdocs/reference/status.xml|   2 +-
 xdocs/reference/uriworkermap.xml  |   2 +-
 xdocs/reference/workers.xml   |   2 +-
 xdocs/webserver_howto/apache.xml  |   8 +-
 xdocs/webserver_howto/iis.xml |   2 +-
 xdocs/webserver_howto/project.xml |   2 +-
 44 files changed, 121 insertions(+), 121 deletions(-)

diff --git a/tools/jkrelease.sh b/tools/jkrelease.sh
index ebc0845d9..91666b81c 100755
--- a/tools/jkrelease.sh
+++ b/tools/jkrelease.sh
@@ -375,10 +375,10 @@ cd ${JK_DIST}/native
 if [ $txtgen = y ]
 then
 # Check for links, elinks or w3m
-W3MOPTS="-dump -cols 80 -t 4 -S -O iso-8859-1 -T text/html"
-ELNKOPTS="-dump -dump-width 80 -dump-charset iso-8859-1 -no-numbering -no-home 
-no-references"
-LNKOPTS="-dump -width 80 -codepage iso-8859-1 -no-g -html-numbered-links 0"
-LYXOPTS="-dump -width=80 -nolist -nostatus -noprint 
-assume_local_charset=iso-8859-1"
+W3MOPTS="-dump -cols 80 -t 4 -S -O UTF-8 -T text/html"
+ELNKOPTS="-dump -dump-width 80 -dump-charset UTF-8 -no-numbering -no-home 
-no-references"
+LNKOPTS="-dump -width 80 -codepage UTF-8 -no-g -html-numbered-links 0"
+LYXOPTS="-dump -width=80 -nolist -nostatus -noprint 
-assume_local_charset=UTF-8"
 failed=true
 for tool in `echo "w3m elinks links lynx"`
 do
diff --git a/xdocs/ajp/ajpv13a.xml b/xdocs/ajp/ajpv13a.xml
index 714f6384a..3391ca7c2 100644
--- a/xdocs/ajp/ajpv13a.xml
+++ b/xdocs/ajp/ajpv13a.xml
@@ -1,4 +1,4 @@
- 
+
 
 ]>
diff --git a/xdocs/ajp/ajpv13ext.xml b/xdocs/ajp/ajpv13ext.xml
index 8dbb8467a..de29c7798 100644
--- a/xdocs/ajp/ajpv13ext.xml
+++ b/xdocs/ajp/ajpv13ext.xml
@@ -1,4 +1,4 @@
-
+
 
 ]>
diff --git a/xdocs/ajp/project.xml b/xdocs/ajp/project.xml
index 77190d7ec..eb34ef1ef 100644
--- a/xdocs/ajp/project.xml
+++ b/xdocs/ajp/project.xml
@@ -1,4 +1,4 @@
-
+
 
-
-]>
-
-
-  &project;
-
-  
-Apache Tomcat Connectors 
Project
-2018 News & Status
-  
-
-
-
-
-
-
-The Apache Tomcat team is proud to announce the immediate availability
-   of Tomcat Connectors 1.2.46. This is a maintenance release.
-
-Please see the ChangeLog
-   for a full list of changes.
-
-If you find any bugs while using this release, please fill in the
-https://bz.apache.org/bugzilla/enter_bug.cgi?product=Tomcat%20Connectors";>Bugzilla
-Bug Report.
-
-
-
-The Apache Tomcat team is proud to announce the immediate availability
-   of Tomcat Connectors 1.2.44. This is a maintenance release.
-
-Please see the ChangeLog
-   for a full list of changes.
-
-If you find any bugs while using this release, please fill in the
-https://bz.apache.org/bugzilla/enter_bug.cgi?product=Tomcat%20Connectors";>Bugzilla
-Bug Report.
-
-
-
-The Apache Tomcat team is proud to announce the immediate availability
-   of Tomcat Connecto

[tomcat-connectors] 01/03: Fix directory paths

2023-09-06 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-connectors.git

commit 7b13ea4d579e67d068539c5ac11e7dc1d55c6e5f
Author: Mark Thomas 
AuthorDate: Wed Sep 6 16:51:29 2023 +0100

Fix directory paths
---
 tools/jkrelease.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/jkrelease.sh b/tools/jkrelease.sh
index d42ae852a..309f7e679 100755
--- a/tools/jkrelease.sh
+++ b/tools/jkrelease.sh
@@ -411,7 +411,7 @@ do
 esac
 rm -f CHANGES
 echo "Creating the CHANGES file using '$TOOL' ..."
-${TOOL} ../docs/miscellaneous/printer/changelog.html > CHANGES 2>/dev/null
+${TOOL} ../docs/miscellaneous/changelog.html > CHANGES 2>/dev/null
 if [ -f CHANGES -a -s CHANGES ]
 then
   failed=false
@@ -431,7 +431,7 @@ rm -f NEWS
 touch NEWS
 for news in `ls -r ../xdocs/news/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].xml`
 do
-  print=`echo $news | sed -e 's#xdocs/news#docs/news/printer#' -e 
's#\.xml#.html#'`
+  print=`echo $news | sed -e 's#xdocs/news#docs/news#' -e 's#\.xml#.html#'`
   echo "Adding $print to NEWS file ..."
   ${TOOL} $print >>NEWS
 done


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



[tomcat-connectors] branch main updated: Rename so tooling works

2023-09-06 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-connectors.git


The following commit(s) were added to refs/heads/main by this push:
 new ac0fd4f78 Rename so tooling works
ac0fd4f78 is described below

commit ac0fd4f785a35b7fcaba44e70fdc68436e94ad21
Author: Mark Thomas 
AuthorDate: Wed Sep 6 18:14:00 2023 +0100

Rename so tooling works
---
 tools/jkrelease.sh| 6 +-
 xdocs/ajp/project.xml | 2 +-
 xdocs/common_howto/project.xml| 2 +-
 xdocs/index.xml   | 2 +-
 xdocs/miscellaneous/project.xml   | 2 +-
 xdocs/news/{2023.xml => 20230101.xml} | 2 +-
 xdocs/news/project.xml| 2 +-
 xdocs/project.xml | 2 +-
 xdocs/reference/project.xml   | 2 +-
 xdocs/webserver_howto/project.xml | 2 +-
 10 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/tools/jkrelease.sh b/tools/jkrelease.sh
index 91666b81c..29263b665 100755
--- a/tools/jkrelease.sh
+++ b/tools/jkrelease.sh
@@ -411,11 +411,7 @@ do
 esac
 rm -f CHANGES
 echo "Creating the CHANGES file using '$TOOL' ..."
-${TOOL} ../docs/miscellaneous/changelog.html > CHANGES 2>/dev/null
-# Remove page navigation data from converted file.
-cp -p CHANGES CHANGES.tmp
-awk '/Preface/ {o=1} o>0' CHANGES.tmp > CHANGES
-rm CHANGES.tmp
+${TOOL} ../docs/miscellaneous/changelog.html | awk '/Preface/ {o=1} o>0' > 
CHANGES 2>/dev/null
 if [ -f CHANGES -a -s CHANGES ]
 then
   failed=false
diff --git a/xdocs/ajp/project.xml b/xdocs/ajp/project.xml
index eb34ef1ef..59da8eaa1 100644
--- a/xdocs/ajp/project.xml
+++ b/xdocs/ajp/project.xml
@@ -65,7 +65,7 @@
 
 
 
-
+
 
 
 
diff --git a/xdocs/common_howto/project.xml b/xdocs/common_howto/project.xml
index c30dda4e0..3b4651c11 100644
--- a/xdocs/common_howto/project.xml
+++ b/xdocs/common_howto/project.xml
@@ -65,7 +65,7 @@
 
 
 
-
+
 
 
 
diff --git a/xdocs/index.xml b/xdocs/index.xml
index 23ea05c81..7d159484a 100644
--- a/xdocs/index.xml
+++ b/xdocs/index.xml
@@ -60,7 +60,7 @@ manual is described in more detail below.
 
 
 
-JK-1.2.49 released
+JK-1.2.49 released
 The Apache Tomcat team is proud to announce the immediate availability
of Tomcat Connectors 1.2.49 Stable. This release contains improvements and
bug fixes for issues found in previous releases.
diff --git a/xdocs/miscellaneous/project.xml b/xdocs/miscellaneous/project.xml
index 4cf843297..063da08ba 100644
--- a/xdocs/miscellaneous/project.xml
+++ b/xdocs/miscellaneous/project.xml
@@ -65,7 +65,7 @@
 
 
 
-
+
 
 
 
diff --git a/xdocs/news/2023.xml b/xdocs/news/20230101.xml
similarity index 98%
rename from xdocs/news/2023.xml
rename to xdocs/news/20230101.xml
index 6b898e7b1..976d02399 100644
--- a/xdocs/news/2023.xml
+++ b/xdocs/news/20230101.xml
@@ -18,7 +18,7 @@
 
 ]>
-
+
 
   &project;
 
diff --git a/xdocs/news/project.xml b/xdocs/news/project.xml
index 5149cd6e5..6863a13ab 100644
--- a/xdocs/news/project.xml
+++ b/xdocs/news/project.xml
@@ -65,7 +65,7 @@
 
 
 
-
+
 
 
 
diff --git a/xdocs/project.xml b/xdocs/project.xml
index 533cdb60d..e867d1894 100644
--- a/xdocs/project.xml
+++ b/xdocs/project.xml
@@ -65,7 +65,7 @@
 
 
 
-
+
 
 
 
diff --git a/xdocs/reference/project.xml b/xdocs/reference/project.xml
index e63cda39e..510c30891 100644
--- a/xdocs/reference/project.xml
+++ b/xdocs/reference/project.xml
@@ -65,7 +65,7 @@
 
 
 
-
+
 
 
 
diff --git a/xdocs/webserver_howto/project.xml 
b/xdocs/webserver_howto/project.xml
index 5bb64ab5c..b5f42b64d 100644
--- a/xdocs/webserver_howto/project.xml
+++ b/xdocs/webserver_howto/project.xml
@@ -65,7 +65,7 @@
 
 
 
-
+
 
 
 


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



[tomcat-connectors] branch main updated: Skip the menu when processing news into text

2023-09-06 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-connectors.git


The following commit(s) were added to refs/heads/main by this push:
 new 3ad622409 Skip the menu when processing news into text
3ad622409 is described below

commit 3ad622409ae3335df9f353bef8ebc4d72a70fd6d
Author: Mark Thomas 
AuthorDate: Wed Sep 6 18:31:32 2023 +0100

Skip the menu when processing news into text
---
 tools/jkrelease.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/jkrelease.sh b/tools/jkrelease.sh
index 29263b665..c1f717691 100755
--- a/tools/jkrelease.sh
+++ b/tools/jkrelease.sh
@@ -433,7 +433,7 @@ for news in `ls -r 
../xdocs/news/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].xml`
 do
   print=`echo $news | sed -e 's#xdocs/news#docs/news#' -e 's#\.xml#.html#'`
   echo "Adding $print to NEWS file ..."
-  ${TOOL} $print >>NEWS
+  ${TOOL} $print | awk '/[0-9][0-9][0-9][0-9] News/ {o=1} o>0' >> NEWS
 done
 if [ ! -s NEWS ]
 then


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



[tomcat-connectors] tag JK_1_2_49 created (now 3ad622409)

2023-09-06 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


  at 3ad622409 (commit)
No new revisions were added by this update.


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



Re: [tomcat-connectors] tag JK_1_2_49 created (now 3ad622409)

2023-09-06 Thread Mark Thomas

FYI,

I'm having issues building the Windows binaries. I am getting what looks 
like a compilation error. I may need to re-tag.


Mark


On 06/09/2023 19:22, ma...@apache.org wrote:

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

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


   at 3ad622409 (commit)
No new revisions were added by this update.


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



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



Re: [tomcat-connectors] tag JK_1_2_49 created (now 3ad622409)

2023-09-06 Thread Rainer Jung
I don't have a windows build setup for mod_jk at hand right now, but if 
ou want more eyes to look at the error just post it. I am probably 
responsible for it, because I changes quite a bit if code structure to 
introduce the logging context.


Best regards,

Rainer

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



Re: [tomcat-connectors] tag JK_1_2_49 created (now 3ad622409)

2023-09-06 Thread Mark Thomas

On 06/09/2023 19:35, Rainer Jung wrote:
I don't have a windows build setup for mod_jk at hand right now, but if 
ou want more eyes to look at the error just post it. I am probably 
responsible for it, because I changes quite a bit if code structure to 
introduce the logging context.


Thanks

...
cl.exe /c /nologo -MD -W3 -O2 -Ob2 -Zi -EHsc  -DNDEBUG -DWIN32 
-D_WINNT -DWINNT -D_WIN32_WINNT=WIN7 -DWINVER=WIN7 -DHAVE_CONFIG_H 
-D_X86_=1 -DPCRE_STATIC -DJK_ISAPI -DISAPI_EXPORTS  -I.\pcre -I..\common 
-Fox86_RELEASE\ -Fdx86_RELEASE\isapi_redirect jk_isapi_plugin.c

jk_isapi_plugin.c
c:\cmsc\msvc\include\prsht.h(643) : error C2016: C requires that a 
struct or union has at least one member
c:\cmsc\msvc\include\prsht.h(643) : error C2061: syntax error : 
identifier 'NMHDR'

c:\cmsc\msvc\include\prsht.h(645) : error C2059: syntax error : '}'
c:\cmsc\msvc\include\windows.h(238) : warning C4193: #pragma 
warning(pop) : no matching '#pragma warning(push)'
jk_isapi_plugin.c(3257) : error C2065: 'CERT_CONTEXT_EX' : undeclared 
identifier
jk_isapi_plugin.c(3257) : error C2146: syntax error : missing ';' before 
identifier 'cc'

...

It could be the build environment. I know Mladen has worked on that 
since the last release so my binary build instructions may be out of date.


Mark

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



Re: [tomcat-connectors] tag JK_1_2_49 created (now 3ad622409)

2023-09-06 Thread Mark Thomas

On 06/09/2023 19:37, Mark Thomas wrote:

On 06/09/2023 19:35, Rainer Jung wrote:
I don't have a windows build setup for mod_jk at hand right now, but 
if ou want more eyes to look at the error just post it. I am probably 
responsible for it, because I changes quite a bit if code structure to 
introduce the logging context.


Thanks

...
     cl.exe /c /nologo -MD -W3 -O2 -Ob2 -Zi -EHsc  -DNDEBUG -DWIN32 
-D_WINNT -DWINNT -D_WIN32_WINNT=WIN7 -DWINVER=WIN7 -DHAVE_CONFIG_H 
-D_X86_=1 -DPCRE_STATIC -DJK_ISAPI -DISAPI_EXPORTS  -I.\pcre -I..\common 
-Fox86_RELEASE\ -Fdx86_RELEASE\isapi_redirect jk_isapi_plugin.c

jk_isapi_plugin.c
c:\cmsc\msvc\include\prsht.h(643) : error C2016: C requires that a 
struct or union has at least one member
c:\cmsc\msvc\include\prsht.h(643) : error C2061: syntax error : 
identifier 'NMHDR'

c:\cmsc\msvc\include\prsht.h(645) : error C2059: syntax error : '}'
c:\cmsc\msvc\include\windows.h(238) : warning C4193: #pragma 
warning(pop) : no matching '#pragma warning(push)'
jk_isapi_plugin.c(3257) : error C2065: 'CERT_CONTEXT_EX' : undeclared 
identifier
jk_isapi_plugin.c(3257) : error C2146: syntax error : missing ';' before 
identifier 'cc'

...

It could be the build environment. I know Mladen has worked on that 
since the last release so my binary build instructions may be out of date.


Yep, it is my build environment. I think I need to update my copy of 
CMSC. If I set WINVER to use a numerical value, the build works.


Mark

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



[tomcat] branch main updated: Extract out some of the important macros for readability

2023-09-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 55aadf3929 Extract out some of the important macros for readability
55aadf3929 is described below

commit 55aadf3929996756282baf51f447097e38de6417
Author: remm 
AuthorDate: Wed Sep 6 21:07:51 2023 +0200

Extract out some of the important macros for readability

Also rename the compatibility class for consistency.
---
 .../util/net/openssl/panama/OpenSSLContext.java|  22 ++--
 .../util/net/openssl/panama/OpenSSLEngine.java |   2 +-
 .../util/net/openssl/panama/OpenSSLLibrary.java|   3 +-
 .../net/openssl/panama/OpenSSLSessionContext.java  |  21 +---
 ..._compat_h.java => openssl_h_Compatibility.java} |   2 +-
 .../tomcat/util/openssl/openssl_h_Macros.java  | 136 +
 6 files changed, 152 insertions(+), 34 deletions(-)

diff --git 
a/modules/openssl-foreign/src/main/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java
 
b/modules/openssl-foreign/src/main/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java
index 480d289794..c0bb643e4f 100644
--- 
a/modules/openssl-foreign/src/main/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java
+++ 
b/modules/openssl-foreign/src/main/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java
@@ -52,8 +52,9 @@ import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509KeyManager;
 import javax.net.ssl.X509TrustManager;
 
-import static org.apache.tomcat.util.openssl.openssl_compat_h.*;
 import static org.apache.tomcat.util.openssl.openssl_h.*;
+import static org.apache.tomcat.util.openssl.openssl_h_Compatibility.*;
+import static org.apache.tomcat.util.openssl.openssl_h_Macros.*;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.net.AbstractEndpoint;
@@ -280,9 +281,7 @@ public class OpenSSLContext implements 
org.apache.tomcat.util.net.SSLContext {
 prot = SSL3_VERSION();
 }
 maxTlsVersion = prot;
-// # define SSL_CTX_set_max_proto_version(sslCtx, version) \
-//  SSL_CTX_ctrl(sslCtx, SSL_CTRL_SET_MAX_PROTO_VERSION, 
version, NULL)
-SSL_CTX_ctrl(sslCtx, SSL_CTRL_SET_MAX_PROTO_VERSION(), prot, 
MemorySegment.NULL);
+SSL_CTX_set_max_proto_version(sslCtx, prot);
 if (prot == TLS1_3_VERSION() && (protocol & SSL_PROTOCOL_TLSV1_2) 
> 0) {
 prot = TLS1_2_VERSION();
 }
@@ -296,9 +295,7 @@ public class OpenSSLContext implements 
org.apache.tomcat.util.net.SSLContext {
 prot = SSL3_VERSION();
 }
 minTlsVersion = prot;
-//# define SSL_CTX_set_min_proto_version(sslCtx, version) \
-// SSL_CTX_ctrl(sslCtx, SSL_CTRL_SET_MIN_PROTO_VERSION, 
version, NULL)
-SSL_CTX_ctrl(sslCtx, SSL_CTRL_SET_MIN_PROTO_VERSION(), prot, 
MemorySegment.NULL);
+SSL_CTX_set_min_proto_version(sslCtx, prot);
 
 // Disable compression, usually unsafe
 SSL_CTX_set_options(sslCtx, SSL_OP_NO_COMPRESSION());
@@ -311,14 +308,10 @@ public class OpenSSLContext implements 
org.apache.tomcat.util.net.SSLContext {
 SSL_CTX_set_options(sslCtx, SSL_OP_SINGLE_ECDH_USE());
 
 // Default session context id and cache size
-// # define SSL_CTX_sess_set_cache_size(sslCtx,t) \
-//  
SSL_CTX_ctrl(sslCtx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL)
-SSL_CTX_ctrl(sslCtx, SSL_CTRL_SET_SESS_CACHE_SIZE(), 256, 
MemorySegment.NULL);
+SSL_CTX_sess_set_cache_size(sslCtx, 256);
 
 // Session cache is disabled by default
-// # define SSL_CTX_set_session_cache_mode(sslCtx,m) \
-//  
SSL_CTX_ctrl(sslCtx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL)
-SSL_CTX_ctrl(sslCtx, SSL_CTRL_SET_SESS_CACHE_MODE(), 
SSL_SESS_CACHE_OFF(), MemorySegment.NULL);
+SSL_CTX_set_session_cache_mode(sslCtx, SSL_SESS_CACHE_OFF());
 
 // Longer session timeout
 SSL_CTX_set_timeout(sslCtx, 14400);
@@ -1287,8 +1280,7 @@ public class OpenSSLContext implements 
org.apache.tomcat.util.net.SSLContext {
 logLastError(localArena, 
"openssl.errorLoadingCertificate");
 return;
 }
-// # define SSL_CTX_add0_chain_cert(sslCtx,x509) 
SSL_CTX_ctrl(sslCtx,SSL_CTRL_CHAIN_CERT,0,(char *)(x509))
-if (SSL_CTX_ctrl(state.sslCtx, SSL_CTRL_CHAIN_CERT(), 0, 
x509certChain) <= 0) {
+if (SSL_CTX_add0_chain_cert(state.sslCtx, x509certChain) <= 0) 
{
 logLastError(localArena, "openssl.errorAddingCertificate");
 return;
 }
diff --git 
a/modul

[tomcat] branch main updated: Update description and version

2023-09-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 9d204675ef Update description and version
9d204675ef is described below

commit 9d204675efec94d7654da5d21bf78365611ac0e7
Author: remm 
AuthorDate: Wed Sep 6 21:14:45 2023 +0200

Update description and version
---
 modules/openssl-foreign/README.md | 2 +-
 modules/openssl-foreign/pom.xml   | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/openssl-foreign/README.md 
b/modules/openssl-foreign/README.md
index d766db21e2..060020d6b0 100644
--- a/modules/openssl-foreign/README.md
+++ b/modules/openssl-foreign/README.md
@@ -60,7 +60,7 @@ export JAVA_OPTS="--enable-preview 
--enable-native-access=ALL-UNNAMED"
 
 jextract is now available in its own standalone repository. Clone
 `https://github.com/openjdk/jextract` in some location and
-checkout the branch that supports Java 21. Please refer to the
+checkout the branch that supports Java 22. Please refer to the
 instructions from the repository for building. It should be the
 `panama` branch.
 
diff --git a/modules/openssl-foreign/pom.xml b/modules/openssl-foreign/pom.xml
index c1a3bb11d9..ce92d85e8d 100644
--- a/modules/openssl-foreign/pom.xml
+++ b/modules/openssl-foreign/pom.xml
@@ -26,12 +26,12 @@
 
 org.apache.tomcat
 tomcat-coyote-openssl
-Apache Tomcat OpenSSL support for Java 21
-OpenSSL support using new APIs included in Java 
21
+Apache Tomcat OpenSSL support for Java 22
+OpenSSL support using FFM API included in Java 
22
 0.1-SNAPSHOT
 
 
-9.0.78
+9.0.80
 
2021-12-02T12:00:00Z
 
 


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



svn commit: r63828 - /release/tomcat/tomcat-connectors/jk/binaries/windows/symbols/

2023-09-06 Thread markt
Author: markt
Date: Wed Sep  6 19:56:54 2023
New Revision: 63828

Log:
Drop old symbols from CDN

Removed:

release/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.46-windows-i386-symbols.zip

release/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.46-windows-i386-symbols.zip.asc

release/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.46-windows-i386-symbols.zip.sha512

release/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.46-windows-x86_64-symbols.zip

release/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.46-windows-x86_64-symbols.zip.asc

release/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.46-windows-x86_64-symbols.zip.sha512


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



svn commit: r63829 - in /dev/tomcat/tomcat-connectors/jk: ./ binaries/windows/ binaries/windows/symbols/

2023-09-06 Thread markt
Author: markt
Date: Wed Sep  6 20:04:19 2023
New Revision: 63829

Log:
Upload Tomcat Connectors 1.2.49 for voting

Added:

dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.49-windows-i386-symbols.zip
   (with props)

dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.49-windows-i386-symbols.zip.asc

dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.49-windows-i386-symbols.zip.sha512

dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.49-windows-x86_64-symbols.zip
   (with props)

dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.49-windows-x86_64-symbols.zip.asc

dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.49-windows-x86_64-symbols.zip.sha512

dev/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.49-windows-i386-iis.zip
   (with props)

dev/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.49-windows-i386-iis.zip.asc

dev/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.49-windows-i386-iis.zip.sha512

dev/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.49-windows-x86_64-iis.zip
   (with props)

dev/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.49-windows-x86_64-iis.zip.asc

dev/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.49-windows-x86_64-iis.zip.sha512
dev/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.49-src.tar.gz   (with 
props)
dev/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.49-src.tar.gz.asc
dev/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.49-src.tar.gz.sha512
dev/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.49-src.zip   (with 
props)
dev/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.49-src.zip.asc
dev/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.49-src.zip.sha512
Modified:
dev/tomcat/tomcat-connectors/jk/README.html
dev/tomcat/tomcat-connectors/jk/binaries/windows/README.html

Modified: dev/tomcat/tomcat-connectors/jk/README.html
==
--- dev/tomcat/tomcat-connectors/jk/README.html (original)
+++ dev/tomcat/tomcat-connectors/jk/README.html Wed Sep  6 20:04:19 2023
@@ -47,13 +47,13 @@ nearest mirror site!
 
 
 % pgpk -a KEYS
-% pgpv tomcat-connectors-1.2.48-src.tar.gz.asc
+% pgpv tomcat-connectors-1.2.49-src.tar.gz.asc
 or,
 % pgp -ka KEYS
-% pgp tomcat-connectors-1.2.48-src.tar.gz.asc
+% pgp tomcat-connectors-1.2.49-src.tar.gz.asc
 or,
 % gpg --import KEYS
-% gpg --verify tomcat-connectors-1.2.48-src.tar.gz.asc
+% gpg --verify tomcat-connectors-1.2.49-src.tar.gz.asc
 
 
 We provide SHA512 hashes as an alternative to validate the integrity
@@ -62,4 +62,4 @@ nearest mirror site!
href="https://www.gnu.org/software/coreutils/coreutils.html";>GNU
Coreutils.  Windows users can use https://sourceforge.net/projects/cyohash/";>Cyohash.
-
+
\ No newline at end of file

Modified: dev/tomcat/tomcat-connectors/jk/binaries/windows/README.html
==
--- dev/tomcat/tomcat-connectors/jk/binaries/windows/README.html (original)
+++ dev/tomcat/tomcat-connectors/jk/binaries/windows/README.html Wed Sep  6 
20:04:19 2023
@@ -8,6 +8,11 @@
 
 Windows Users, Read These First...
 
+Warning: TCP/IP networking must be installed
+
+TCP/IP must be correctly installed, configured and running in 
+   order to install and use Apache Tomcat Connectors on Windows.
+
 Warning about the Quality of Service driver
 
 We suggest disabling the "Quality of Service" (or QoS) network driver from 
@@ -22,7 +27,7 @@
connector to fail.
 
 
-The current stable release is 1.2.48
+The current stable release is 1.2.49
 
 See the Apache Tomcat Connectors
 http://tomcat.apache.org/connectors-doc/miscellaneous/changelog.html";>changelog
@@ -38,9 +43,9 @@ for the complete list of features and bu
(and the Dr. Watson utility) to produce useful crash analysis.
 
 You will find the source code package in the 
-   /dist/tomcat/tomcat-connectors/jk/ source tree.
-   The -src.zip file contains only source and build files, and
-   contains  no binary executable files.
+   /dist/tomcat-connectors/jk/ source tree.  The 
-src.zip file
+   contains only source and build files, and contains 
+   no binary executable files.
 
 This binary release was created with Microsoft Windows DDK 7.1,
using a more recent Platform SDK.

Added: 
dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.49-windows-i386-symbols.zip
==
Binary file - no diff available.

Propchange: 
dev/tomcat/tomcat-connectors/jk/binaries/windows/symbols/tomcat-connectors-1.2.49-windows-i386-symbols.zip
-

[VOTE] Release Apache Tomcat Connectors (JK) 1.2.49

2023-09-06 Thread Mark Thomas

Tag:
https://github.com/apache/tomcat-connectors/tree/JK_1_2_49

Source:
https://github.com/apache/tomcat-connectors/tree/JK_1_2_49

Dist:
https://dist.apache.org/repos/dist/dev/tomcat/tomcat-connectors/jk/


This is a maintenance release with a handful of bug fixes (compared to
1.2.48) and some clean-up. It also includes Windows binaries for IIS.

The significant changes are:
- Add support for request identifiers
- Remove support for iPlanet web server

The proposed JK 1.2.49 release is:
[ ] Broken - do not release
[ ] Stable - go ahead and release as 1.2.49

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



[GitHub] [tomcat] markt-asf merged pull request #652: Upgrade Readability by removing brackets

2023-09-06 Thread via GitHub


markt-asf merged PR #652:
URL: https://github.com/apache/tomcat/pull/652


-- 
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: Upgrade Readability by removing brackets (#652)

2023-09-06 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 b1fbe2cdbd Upgrade Readability by removing brackets (#652)
b1fbe2cdbd is described below

commit b1fbe2cdbd6066127c9c15ecf1688fea62cbd287
Author: iamjooon2 
AuthorDate: Thu Sep 7 05:18:22 2023 +0900

Upgrade Readability by removing brackets (#652)

Remove needless brackets
---
 java/org/apache/coyote/Request.java   | 2 +-
 java/org/apache/coyote/ajp/Constants.java | 3 +--
 java/org/apache/coyote/http11/Http11InputBuffer.java  | 4 ++--
 java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java | 2 +-
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index 0155a6b575..3bbd9fd8a6 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -867,7 +867,7 @@ public final class Request {
 encoding = encoding.substring(0, end);
 }
 encoding = encoding.trim();
-if ((encoding.length() > 2) && (encoding.startsWith("\"")) && 
(encoding.endsWith("\""))) {
+if (encoding.length() > 2 && encoding.startsWith("\"") && 
encoding.endsWith("\"")) {
 encoding = encoding.substring(1, encoding.length() - 1);
 }
 
diff --git a/java/org/apache/coyote/ajp/Constants.java 
b/java/org/apache/coyote/ajp/Constants.java
index bdda943754..f124d8ebcb 100644
--- a/java/org/apache/coyote/ajp/Constants.java
+++ b/java/org/apache/coyote/ajp/Constants.java
@@ -173,8 +173,7 @@ public final class Constants {
 
 static {
 try {
-int i;
-for (i = 0; i < SC_RESP_AJP13_MAX; i++) {
+for (int i = 0; i < SC_RESP_AJP13_MAX; i++) {
 responseTransMap.put(getResponseHeaderForCode(i), 
Integer.valueOf(0xA001 + i));
 }
 } catch (Exception e) {
diff --git a/java/org/apache/coyote/http11/Http11InputBuffer.java 
b/java/org/apache/coyote/http11/Http11InputBuffer.java
index 9c125aef58..78c9c1463b 100644
--- a/java/org/apache/coyote/http11/Http11InputBuffer.java
+++ b/java/org/apache/coyote/http11/Http11InputBuffer.java
@@ -555,7 +555,7 @@ public class Http11InputBuffer implements InputBuffer, 
ApplicationBufferHandler
 }
 }
 
-if ((end - parsingRequestLineStart) > 0) {
+if (end - parsingRequestLineStart > 0) {
 request.protocol().setBytes(byteBuffer.array(), 
parsingRequestLineStart, end - parsingRequestLineStart);
 parsingRequestLinePhase = 7;
 }
@@ -902,7 +902,7 @@ public class Http11InputBuffer implements InputBuffer, 
ApplicationBufferHandler
 }
 
 // chr is next byte of header name. Convert to lowercase.
-if ((chr >= Constants.A) && (chr <= Constants.Z)) {
+if (chr >= Constants.A && chr <= Constants.Z) {
 byteBuffer.put(pos, (byte) (chr - Constants.LC_OFFSET));
 }
 }
diff --git 
a/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java 
b/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
index c1c26607f3..4b6d2a28c9 100644
--- a/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
+++ b/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
@@ -189,7 +189,7 @@ public class UpgradeServletOutputStream extends 
ServletOutputStream {
 return;
 }
 closed = true;
-flushInternal((listener == null), false);
+flushInternal(listener == null, false);
 }
 
 


-
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: Upgrade Readability by removing brackets (#652)

2023-09-06 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 c78beae446 Upgrade Readability by removing brackets (#652)
c78beae446 is described below

commit c78beae4468db2b74a03cbfe0f01d0f994bb7eef
Author: iamjooon2 
AuthorDate: Thu Sep 7 05:18:22 2023 +0900

Upgrade Readability by removing brackets (#652)

Remove needless brackets
---
 java/org/apache/coyote/Request.java   | 2 +-
 java/org/apache/coyote/ajp/Constants.java | 3 +--
 java/org/apache/coyote/http11/Http11InputBuffer.java  | 4 ++--
 java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java | 2 +-
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index 2de47af2f5..60882622c9 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -856,7 +856,7 @@ public final class Request {
 encoding = encoding.substring(0, end);
 }
 encoding = encoding.trim();
-if ((encoding.length() > 2) && (encoding.startsWith("\"")) && 
(encoding.endsWith("\""))) {
+if (encoding.length() > 2 && encoding.startsWith("\"") && 
encoding.endsWith("\"")) {
 encoding = encoding.substring(1, encoding.length() - 1);
 }
 
diff --git a/java/org/apache/coyote/ajp/Constants.java 
b/java/org/apache/coyote/ajp/Constants.java
index bdda943754..f124d8ebcb 100644
--- a/java/org/apache/coyote/ajp/Constants.java
+++ b/java/org/apache/coyote/ajp/Constants.java
@@ -173,8 +173,7 @@ public final class Constants {
 
 static {
 try {
-int i;
-for (i = 0; i < SC_RESP_AJP13_MAX; i++) {
+for (int i = 0; i < SC_RESP_AJP13_MAX; i++) {
 responseTransMap.put(getResponseHeaderForCode(i), 
Integer.valueOf(0xA001 + i));
 }
 } catch (Exception e) {
diff --git a/java/org/apache/coyote/http11/Http11InputBuffer.java 
b/java/org/apache/coyote/http11/Http11InputBuffer.java
index e19123b3b2..aadf5823b2 100644
--- a/java/org/apache/coyote/http11/Http11InputBuffer.java
+++ b/java/org/apache/coyote/http11/Http11InputBuffer.java
@@ -559,7 +559,7 @@ public class Http11InputBuffer implements InputBuffer, 
ApplicationBufferHandler
 }
 }
 
-if ((end - parsingRequestLineStart) > 0) {
+if (end - parsingRequestLineStart > 0) {
 request.protocol().setBytes(byteBuffer.array(), 
parsingRequestLineStart, end - parsingRequestLineStart);
 parsingRequestLinePhase = 7;
 }
@@ -906,7 +906,7 @@ public class Http11InputBuffer implements InputBuffer, 
ApplicationBufferHandler
 }
 
 // chr is next byte of header name. Convert to lowercase.
-if ((chr >= Constants.A) && (chr <= Constants.Z)) {
+if (chr >= Constants.A && chr <= Constants.Z) {
 byteBuffer.put(pos, (byte) (chr - Constants.LC_OFFSET));
 }
 }
diff --git 
a/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java 
b/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
index 2f08b08362..fe8595a86c 100644
--- a/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
+++ b/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
@@ -189,7 +189,7 @@ public class UpgradeServletOutputStream extends 
ServletOutputStream {
 return;
 }
 closed = true;
-flushInternal((listener == null), false);
+flushInternal(listener == null, false);
 }
 
 


-
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: Upgrade Readability by removing brackets (#652)

2023-09-06 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 6cd7182de4 Upgrade Readability by removing brackets (#652)
6cd7182de4 is described below

commit 6cd7182de4b93d95d8f5b2581b963aed6f60646f
Author: iamjooon2 
AuthorDate: Thu Sep 7 05:18:22 2023 +0900

Upgrade Readability by removing brackets (#652)

Remove needless brackets
---
 java/org/apache/coyote/Request.java   | 2 +-
 java/org/apache/coyote/ajp/Constants.java | 3 +--
 java/org/apache/coyote/http11/Http11InputBuffer.java  | 4 ++--
 java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java | 2 +-
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index 354c4ac289..ecfdf1abb6 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -824,7 +824,7 @@ public final class Request {
 encoding = encoding.substring(0, end);
 }
 encoding = encoding.trim();
-if ((encoding.length() > 2) && (encoding.startsWith("\"")) && 
(encoding.endsWith("\""))) {
+if (encoding.length() > 2 && encoding.startsWith("\"") && 
encoding.endsWith("\"")) {
 encoding = encoding.substring(1, encoding.length() - 1);
 }
 
diff --git a/java/org/apache/coyote/ajp/Constants.java 
b/java/org/apache/coyote/ajp/Constants.java
index bdda943754..f124d8ebcb 100644
--- a/java/org/apache/coyote/ajp/Constants.java
+++ b/java/org/apache/coyote/ajp/Constants.java
@@ -173,8 +173,7 @@ public final class Constants {
 
 static {
 try {
-int i;
-for (i = 0; i < SC_RESP_AJP13_MAX; i++) {
+for (int i = 0; i < SC_RESP_AJP13_MAX; i++) {
 responseTransMap.put(getResponseHeaderForCode(i), 
Integer.valueOf(0xA001 + i));
 }
 } catch (Exception e) {
diff --git a/java/org/apache/coyote/http11/Http11InputBuffer.java 
b/java/org/apache/coyote/http11/Http11InputBuffer.java
index 002b304ccf..da3e456d2f 100644
--- a/java/org/apache/coyote/http11/Http11InputBuffer.java
+++ b/java/org/apache/coyote/http11/Http11InputBuffer.java
@@ -574,7 +574,7 @@ public class Http11InputBuffer implements InputBuffer, 
ApplicationBufferHandler
 }
 }
 
-if ((end - parsingRequestLineStart) > 0) {
+if (end - parsingRequestLineStart > 0) {
 request.protocol().setBytes(byteBuffer.array(), 
parsingRequestLineStart, end - parsingRequestLineStart);
 parsingRequestLinePhase = 7;
 }
@@ -906,7 +906,7 @@ public class Http11InputBuffer implements InputBuffer, 
ApplicationBufferHandler
 }
 
 // chr is next byte of header name. Convert to lowercase.
-if ((chr >= Constants.A) && (chr <= Constants.Z)) {
+if (chr >= Constants.A && chr <= Constants.Z) {
 byteBuffer.put(pos, (byte) (chr - Constants.LC_OFFSET));
 }
 }
diff --git 
a/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java 
b/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
index 36ee4796df..e857517e2b 100644
--- a/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
+++ b/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
@@ -189,7 +189,7 @@ public class UpgradeServletOutputStream extends 
ServletOutputStream {
 return;
 }
 closed = true;
-flushInternal((listener == null), false);
+flushInternal(listener == null, false);
 }
 
 


-
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: Upgrade Readability by removing brackets (#652)

2023-09-06 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 f8e7c14145 Upgrade Readability by removing brackets (#652)
f8e7c14145 is described below

commit f8e7c1414549b8035ba03854034d842fbe9c81e5
Author: iamjooon2 
AuthorDate: Thu Sep 7 05:18:22 2023 +0900

Upgrade Readability by removing brackets (#652)

Remove needless brackets
---
 java/org/apache/coyote/Request.java   | 2 +-
 java/org/apache/coyote/ajp/Constants.java | 3 +--
 java/org/apache/coyote/http11/Http11InputBuffer.java  | 4 ++--
 java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java | 2 +-
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index 74d4523838..0520140ef6 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -800,7 +800,7 @@ public final class Request {
 encoding = encoding.substring(0, end);
 }
 encoding = encoding.trim();
-if ((encoding.length() > 2) && (encoding.startsWith("\"")) && 
(encoding.endsWith("\""))) {
+if (encoding.length() > 2 && encoding.startsWith("\"") && 
encoding.endsWith("\"")) {
 encoding = encoding.substring(1, encoding.length() - 1);
 }
 
diff --git a/java/org/apache/coyote/ajp/Constants.java 
b/java/org/apache/coyote/ajp/Constants.java
index bdda943754..f124d8ebcb 100644
--- a/java/org/apache/coyote/ajp/Constants.java
+++ b/java/org/apache/coyote/ajp/Constants.java
@@ -173,8 +173,7 @@ public final class Constants {
 
 static {
 try {
-int i;
-for (i = 0; i < SC_RESP_AJP13_MAX; i++) {
+for (int i = 0; i < SC_RESP_AJP13_MAX; i++) {
 responseTransMap.put(getResponseHeaderForCode(i), 
Integer.valueOf(0xA001 + i));
 }
 } catch (Exception e) {
diff --git a/java/org/apache/coyote/http11/Http11InputBuffer.java 
b/java/org/apache/coyote/http11/Http11InputBuffer.java
index b3998dd858..6558d8b8d8 100644
--- a/java/org/apache/coyote/http11/Http11InputBuffer.java
+++ b/java/org/apache/coyote/http11/Http11InputBuffer.java
@@ -559,7 +559,7 @@ public class Http11InputBuffer implements InputBuffer, 
ApplicationBufferHandler
 }
 }
 
-if ((end - parsingRequestLineStart) > 0) {
+if (end - parsingRequestLineStart > 0) {
 request.protocol().setBytes(byteBuffer.array(), 
parsingRequestLineStart, end - parsingRequestLineStart);
 parsingRequestLinePhase = 7;
 }
@@ -906,7 +906,7 @@ public class Http11InputBuffer implements InputBuffer, 
ApplicationBufferHandler
 }
 
 // chr is next byte of header name. Convert to lowercase.
-if ((chr >= Constants.A) && (chr <= Constants.Z)) {
+if (chr >= Constants.A && chr <= Constants.Z) {
 byteBuffer.put(pos, (byte) (chr - Constants.LC_OFFSET));
 }
 }
diff --git 
a/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java 
b/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
index 36ee4796df..e857517e2b 100644
--- a/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
+++ b/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
@@ -189,7 +189,7 @@ public class UpgradeServletOutputStream extends 
ServletOutputStream {
 return;
 }
 closed = true;
-flushInternal((listener == null), false);
+flushInternal(listener == null, false);
 }
 
 


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



[GitHub] [tomcat] markt-asf merged pull request #662: Simplify and enhance charset extraction from content type

2023-09-06 Thread via GitHub


markt-asf merged PR #662:
URL: https://github.com/apache/tomcat/pull/662


-- 
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: Simplify and enhance charset extraction from content type (#662)

2023-09-06 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 a2ec03a342 Simplify and enhance charset extraction from content type 
(#662)
a2ec03a342 is described below

commit a2ec03a34276792b42f66182c407f2f8c791dcc1
Author: wyc 
AuthorDate: Thu Sep 7 05:24:04 2023 +0900

Simplify and enhance charset extraction from content type (#662)

Using MediaType to comply with specifications
---
 java/org/apache/coyote/Request.java | 23 +++
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index 3bbd9fd8a6..9c36b4dc18 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -17,6 +17,7 @@
 package org.apache.coyote;
 
 import java.io.IOException;
+import java.io.StringReader;
 import java.io.UnsupportedEncodingException;
 import java.nio.charset.Charset;
 import java.util.HashMap;
@@ -35,6 +36,7 @@ import org.apache.tomcat.util.buf.UDecoder;
 import org.apache.tomcat.util.http.MimeHeaders;
 import org.apache.tomcat.util.http.Parameters;
 import org.apache.tomcat.util.http.ServerCookies;
+import org.apache.tomcat.util.http.parser.MediaType;
 import org.apache.tomcat.util.net.ApplicationBufferHandler;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -857,20 +859,17 @@ public final class Request {
 if (contentType == null) {
 return null;
 }
-int start = contentType.indexOf("charset=");
-if (start < 0) {
-return null;
-}
-String encoding = contentType.substring(start + 8);
-int end = encoding.indexOf(';');
-if (end >= 0) {
-encoding = encoding.substring(0, end);
+
+MediaType mediaType = null;
+try {
+mediaType = MediaType.parseMediaType(new 
StringReader(contentType));
+} catch (IOException e) {
+// Ignore - null test below handles this
 }
-encoding = encoding.trim();
-if (encoding.length() > 2 && encoding.startsWith("\"") && 
encoding.endsWith("\"")) {
-encoding = encoding.substring(1, encoding.length() - 1);
+if (mediaType != null) {
+return mediaType.getCharset();
 }
 
-return encoding.trim();
+return null;
 }
 }


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



[tomcat] branch 9.0.x updated: Simplify and enhance charset extraction from content type (#662)

2023-09-06 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 6691ad1b22 Simplify and enhance charset extraction from content type 
(#662)
6691ad1b22 is described below

commit 6691ad1b22ee8fe190a8c2ca7594d689950341a4
Author: wyc 
AuthorDate: Thu Sep 7 05:24:04 2023 +0900

Simplify and enhance charset extraction from content type (#662)

Using MediaType to comply with specifications
---
 java/org/apache/coyote/Request.java | 23 +++
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index 0520140ef6..903b5e2804 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -17,6 +17,7 @@
 package org.apache.coyote;
 
 import java.io.IOException;
+import java.io.StringReader;
 import java.io.UnsupportedEncodingException;
 import java.nio.charset.Charset;
 import java.util.HashMap;
@@ -31,6 +32,7 @@ import org.apache.tomcat.util.buf.UDecoder;
 import org.apache.tomcat.util.http.MimeHeaders;
 import org.apache.tomcat.util.http.Parameters;
 import org.apache.tomcat.util.http.ServerCookies;
+import org.apache.tomcat.util.http.parser.MediaType;
 import org.apache.tomcat.util.net.ApplicationBufferHandler;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -790,20 +792,17 @@ public final class Request {
 if (contentType == null) {
 return null;
 }
-int start = contentType.indexOf("charset=");
-if (start < 0) {
-return null;
-}
-String encoding = contentType.substring(start + 8);
-int end = encoding.indexOf(';');
-if (end >= 0) {
-encoding = encoding.substring(0, end);
+
+MediaType mediaType = null;
+try {
+mediaType = MediaType.parseMediaType(new 
StringReader(contentType));
+} catch (IOException e) {
+// Ignore - null test below handles this
 }
-encoding = encoding.trim();
-if (encoding.length() > 2 && encoding.startsWith("\"") && 
encoding.endsWith("\"")) {
-encoding = encoding.substring(1, encoding.length() - 1);
+if (mediaType != null) {
+return mediaType.getCharset();
 }
 
-return encoding.trim();
+return null;
 }
 }


-
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: Simplify and enhance charset extraction from content type (#662)

2023-09-06 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 394643725d Simplify and enhance charset extraction from content type 
(#662)
394643725d is described below

commit 394643725da14b8c3c854c7982eb3a0a944cafe5
Author: wyc 
AuthorDate: Thu Sep 7 05:24:04 2023 +0900

Simplify and enhance charset extraction from content type (#662)

Using MediaType to comply with specifications
---
 java/org/apache/coyote/Request.java | 23 +++
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index ecfdf1abb6..e96d42414b 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -17,6 +17,7 @@
 package org.apache.coyote;
 
 import java.io.IOException;
+import java.io.StringReader;
 import java.io.UnsupportedEncodingException;
 import java.nio.charset.Charset;
 import java.util.HashMap;
@@ -32,6 +33,7 @@ import org.apache.tomcat.util.buf.UDecoder;
 import org.apache.tomcat.util.http.MimeHeaders;
 import org.apache.tomcat.util.http.Parameters;
 import org.apache.tomcat.util.http.ServerCookies;
+import org.apache.tomcat.util.http.parser.MediaType;
 import org.apache.tomcat.util.net.ApplicationBufferHandler;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -814,20 +816,17 @@ public final class Request {
 if (contentType == null) {
 return null;
 }
-int start = contentType.indexOf("charset=");
-if (start < 0) {
-return null;
-}
-String encoding = contentType.substring(start + 8);
-int end = encoding.indexOf(';');
-if (end >= 0) {
-encoding = encoding.substring(0, end);
+
+MediaType mediaType = null;
+try {
+mediaType = MediaType.parseMediaType(new 
StringReader(contentType));
+} catch (IOException e) {
+// Ignore - null test below handles this
 }
-encoding = encoding.trim();
-if (encoding.length() > 2 && encoding.startsWith("\"") && 
encoding.endsWith("\"")) {
-encoding = encoding.substring(1, encoding.length() - 1);
+if (mediaType != null) {
+return mediaType.getCharset();
 }
 
-return encoding.trim();
+return null;
 }
 }


-
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: Simplify and enhance charset extraction from content type (#662)

2023-09-06 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 5a94b930ab Simplify and enhance charset extraction from content type 
(#662)
5a94b930ab is described below

commit 5a94b930ab613e908dda65c9c95f2d0eccae8d60
Author: wyc 
AuthorDate: Thu Sep 7 05:24:04 2023 +0900

Simplify and enhance charset extraction from content type (#662)

Using MediaType to comply with specifications
---
 java/org/apache/coyote/Request.java | 23 +++
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index 60882622c9..ab7b861d6c 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -17,6 +17,7 @@
 package org.apache.coyote;
 
 import java.io.IOException;
+import java.io.StringReader;
 import java.io.UnsupportedEncodingException;
 import java.nio.charset.Charset;
 import java.util.HashMap;
@@ -35,6 +36,7 @@ import org.apache.tomcat.util.buf.UDecoder;
 import org.apache.tomcat.util.http.MimeHeaders;
 import org.apache.tomcat.util.http.Parameters;
 import org.apache.tomcat.util.http.ServerCookies;
+import org.apache.tomcat.util.http.parser.MediaType;
 import org.apache.tomcat.util.net.ApplicationBufferHandler;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -846,20 +848,17 @@ public final class Request {
 if (contentType == null) {
 return null;
 }
-int start = contentType.indexOf("charset=");
-if (start < 0) {
-return null;
-}
-String encoding = contentType.substring(start + 8);
-int end = encoding.indexOf(';');
-if (end >= 0) {
-encoding = encoding.substring(0, end);
+
+MediaType mediaType = null;
+try {
+mediaType = MediaType.parseMediaType(new 
StringReader(contentType));
+} catch (IOException e) {
+// Ignore - null test below handles this
 }
-encoding = encoding.trim();
-if (encoding.length() > 2 && encoding.startsWith("\"") && 
encoding.endsWith("\"")) {
-encoding = encoding.substring(1, encoding.length() - 1);
+if (mediaType != null) {
+return mediaType.getCharset();
 }
 
-return encoding.trim();
+return null;
 }
 }


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



[GitHub] [tomcat] greeng00se commented on pull request #660: Optimize when call getSessionCookieName & getSessionUriParamName

2023-09-06 Thread via GitHub


greeng00se commented on PR #660:
URL: https://github.com/apache/tomcat/pull/660#issuecomment-1709145552

   @markt-asf thx for good comment XD


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



Re: [VOTE] Release Apache Tomcat Connectors (JK) 1.2.49

2023-09-06 Thread Christopher Schultz

Mark,

On 9/6/23 16:13, Mark Thomas wrote:

Tag:
https://github.com/apache/tomcat-connectors/tree/JK_1_2_49

Source:
https://github.com/apache/tomcat-connectors/tree/JK_1_2_49

Dist:
https://dist.apache.org/repos/dist/dev/tomcat/tomcat-connectors/jk/


This is a maintenance release with a handful of bug fixes (compared to
1.2.48) and some clean-up. It also includes Windows binaries for IIS.

The significant changes are:
- Add support for request identifiers
- Remove support for iPlanet web server

The proposed JK 1.2.49 release is:
[ ] Broken - do not release
[ ] Stable - go ahead and release as 1.2.49


+1 for stable release

The source distribution configures and compiles with minimal warnings on 
Linux with gcc. Tested with an application in a development environment.


I did not (yet) exercise the request-identifier features.

-chris

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



[Bug 67235] NPE (NullPointerException) occurs in AsyncContextImpl.decrementInProgressAsyncCount after version 10.1.12.

2023-09-06 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=67235

--- Comment #4 from Han Li  ---
It can be reproduced. From my debug observations, it turns out that it's
ultimately due to the change of
`org.apache.coyote.AsyncStateMachine#asyncError` (Maybe not final reason). 
Since I'm not very familiar with this area, I'll try to be as descriptive as
possible :) 

Abnormal behavior:
10.1.11: execute `decreaseInProgressAsyncCount` first, then execute `recycle`
10.1.12: becomes `recycle` first, then execute `decreaseInProgressAsyncCount`.


1. When writing after 5s, an IO exception is encountered because the connection
is broken. So you end up changing the state to ERROR at
org.apache.coyote.AbstractProcessor#setErrorState:122 line, which is normal I
think and which is first time to set state.
2.An scoket ERROR event is then generated after 1) and process it
asynchronously.
The final execution reaches
org.apache.catalina.core.AsyncContextImpl#setErrorState: 393 line to notify the
listener that an exception exists. At this point, there is a listener
`StandardServletAsyncWebRequest`. This listener will eventually execute to `
org.apache.coyote.AsyncStateMachine#asyncDispatch` where will set state to
DISPATCHING. 
3.The process continues, and then it goes to
org.apache.coyote.AsyncStateMachine#asyncError. This is the problem. 10.1.11
eventually set state to ERROR, but 10.1.12 there ensure the error processing is
only started once per generation, the state is still DISPATCHING. 


Hope the analysis is right ;)

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