[tomcat] branch 8.5.x updated: Revert compression refactoring

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

remm 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 5dbfefa882 Revert compression refactoring
5dbfefa882 is described below

commit 5dbfefa88293078d578c72e3ff17c4da5389110e
Author: remm 
AuthorDate: Wed Oct 11 09:41:14 2023 +0200

Revert compression refactoring

BZ 67670
Add test case to verify content-length is not present when using the
connector compression (also that checks DefaultServlet is working with
it).
---
 java/org/apache/coyote/http11/Http11Processor.java | 13 +---
 .../catalina/servlets/TestDefaultServlet.java  | 38 ++
 webapps/docs/changelog.xml |  8 +
 3 files changed, 54 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index f8d2ffdb86..b8a06c9e19 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -1140,6 +1140,12 @@ public class Http11Processor extends AbstractProcessor {
 prepareSendfile(outputFilters);
 }
 
+// Check for compression
+boolean useCompression = false;
+if (entityBody && sendfileData == null) {
+useCompression = protocol.useCompression(request, response);
+}
+
 MimeHeaders headers = response.getMimeHeaders();
 // A SC_NO_CONTENT response may include entity headers
 if (entityBody || statusCode == HttpServletResponse.SC_NO_CONTENT) {
@@ -1171,11 +1177,8 @@ public class Http11Processor extends AbstractProcessor {
 }
 }
 
-// Check for compression
-if (entityBody && sendfileData == null) {
-if (protocol.useCompression(request, response)) {
-
outputBuffer.addActiveFilter(outputFilters[Constants.GZIP_FILTER]);
-}
+if (useCompression) {
+outputBuffer.addActiveFilter(outputFilters[Constants.GZIP_FILTER]);
 }
 
 // Add date header unless application has already set one (e.g. in a
diff --git a/test/org/apache/catalina/servlets/TestDefaultServlet.java 
b/test/org/apache/catalina/servlets/TestDefaultServlet.java
index a3fdc0904c..889f7909c6 100644
--- a/test/org/apache/catalina/servlets/TestDefaultServlet.java
+++ b/test/org/apache/catalina/servlets/TestDefaultServlet.java
@@ -40,6 +40,7 @@ import org.apache.catalina.Wrapper;
 import org.apache.catalina.startup.SimpleHttpClient;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.coyote.http11.AbstractHttp11Protocol;
 import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.descriptor.web.ErrorPage;
 import org.apache.tomcat.websocket.server.WsContextListener;
@@ -86,6 +87,43 @@ public class TestDefaultServlet extends TomcatBaseTest {
 
 }
 
+@Test
+public void testDefaultCompression() throws Exception {
+
+Tomcat tomcat = getTomcatInstance();
+((AbstractHttp11Protocol) 
tomcat.getConnector().getProtocolHandler()).setCompression("force");
+
+File appDir = new File("test/webapp");
+
+// app dir is relative to server home
+Context ctxt = tomcat.addContext("", appDir.getAbsolutePath());
+Wrapper defaultServlet = Tomcat.addServlet(ctxt, "default",
+"org.apache.catalina.servlets.DefaultServlet");
+defaultServlet.addInitParameter("fileEncoding", "ISO-8859-1");
+ctxt.addServletMappingDecoded("/", "default");
+
+ctxt.addMimeMapping("html", "text/html");
+
+tomcat.start();
+
+TestCompressedClient gzipClient = new TestCompressedClient(getPort());
+
+gzipClient.reset();
+gzipClient.setRequest(new String[] {
+"GET /index.html HTTP/1.1" + CRLF +
+"Host: localhost" + CRLF +
+"Connection: Close" + CRLF +
+"Accept-Encoding: gzip" + CRLF + CRLF });
+gzipClient.connect();
+gzipClient.processRequest();
+Assert.assertTrue(gzipClient.isResponse200());
+List responseHeaders = gzipClient.getResponseHeaders();
+Assert.assertTrue(responseHeaders.contains("Content-Encoding: gzip"));
+for (String header : responseHeaders) {
+Assert.assertFalse(header.startsWith("Content-Length: "));
+}
+}
+
 /*
  * Verify serving of gzipped resources from context root.
  */
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 3da9739316..96559a7fe6 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,14 @@
   issues do not "pop up" wrt. others).
 -->
 
+  
+
+  
+67670: Fix regression with HTTP compression after 

[tomcat] branch 8.5.x updated: Revert "Bump OpenSSL version."

2023-05-30 Thread schultz
This is an automated email from the ASF dual-hosted git repository.

schultz 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 38de8bce63 Revert "Bump OpenSSL version."
38de8bce63 is described below

commit 38de8bce63598ea33eeefcd0281443778b94cdfd
Author: Christopher Schultz 
AuthorDate: Tue May 30 13:15:04 2023 -0400

Revert "Bump OpenSSL version."

This reverts commit f2fa60d16846da45df67a419a703c10179700784.
---
 build.properties.default | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.properties.default b/build.properties.default
index ad1a2061fa..8874848e4f 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -167,7 +167,7 @@ 
jdt.loc.2=http://download.eclipse.org/eclipse/downloads/drops4/${jdt.release}/ec
 
 # - Tomcat native library -
 tomcat-native.version=1.2.36
-tomcat-native-openssl.version=1.1.1u
+tomcat-native-openssl.version=1.1.1t
 tomcat-native.src.checksum.enabled=true
 tomcat-native.src.checksum.algorithm=SHA-512
 
tomcat-native.src.checksum.value=ae89a872b8331035e01387665539a0c08096ae1abdb5dc7a25a197650a641ba3637f01437f1bee27b442c1c59c4d2fe2e5679d1595e8c5d121b9b219da2fb094


-
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: Revert "Clear SocketWrapper reference to help GC"

2023-05-20 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 ffb68373ae Revert "Clear SocketWrapper reference to help GC"
ffb68373ae is described below

commit ffb68373ae76a0c4f62e65800b544feba09fdba5
Author: lihan 
AuthorDate: Sun May 21 09:30:02 2023 +0800

Revert "Clear SocketWrapper reference to help GC"

This reverts commit 2a084c266e09b048c1a49c749cb8ab1e8feedbfc.
---
 java/org/apache/coyote/AbstractProcessor.java  | 3 ---
 java/org/apache/coyote/http11/Http11Processor.java | 1 +
 java/org/apache/tomcat/util/net/Nio2Channel.java   | 1 -
 java/org/apache/tomcat/util/net/NioChannel.java| 1 -
 4 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProcessor.java 
b/java/org/apache/coyote/AbstractProcessor.java
index 0295396112..2a28d683ed 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -709,9 +709,6 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
 public void recycle() {
 errorState = ErrorState.NONE;
 asyncStateMachine.recycle();
-// Clear fields that can be cleared to aid GC and trigger NPEs if this
-// is reused
-socketWrapper = null;
 }
 
 
diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 5cc2ecc752..b8705441e8 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -1612,6 +1612,7 @@ public class Http11Processor extends AbstractProcessor {
 inputBuffer.recycle();
 outputBuffer.recycle();
 upgradeToken = null;
+socketWrapper = null;
 sendfileData = null;
 }
 
diff --git a/java/org/apache/tomcat/util/net/Nio2Channel.java 
b/java/org/apache/tomcat/util/net/Nio2Channel.java
index 6040b8855e..a2612fd0c1 100644
--- a/java/org/apache/tomcat/util/net/Nio2Channel.java
+++ b/java/org/apache/tomcat/util/net/Nio2Channel.java
@@ -79,7 +79,6 @@ public class Nio2Channel implements AsynchronousByteChannel {
 @Override
 public void close() throws IOException {
 sc.close();
-reset(this.sc, null);
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/NioChannel.java 
b/java/org/apache/tomcat/util/net/NioChannel.java
index 777880d67d..8e3cb4f0e1 100644
--- a/java/org/apache/tomcat/util/net/NioChannel.java
+++ b/java/org/apache/tomcat/util/net/NioChannel.java
@@ -99,7 +99,6 @@ public class NioChannel implements ByteChannel, 
ScatteringByteChannel, Gathering
 @Override
 public void close() throws IOException {
 sc.close();
-reset(this.sc,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: Revert unintended change.

2023-03-14 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 df6cb41858 Revert unintended change.
df6cb41858 is described below

commit df6cb41858b032270f72a6945646a1566d98957c
Author: Mark Thomas 
AuthorDate: Tue Mar 14 19:31:31 2023 +

Revert unintended change.

This was me testing things and I failed to revert this change before
committing.
---
 java/org/apache/catalina/startup/Tomcat.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/startup/Tomcat.java 
b/java/org/apache/catalina/startup/Tomcat.java
index 0b60e03362..84565ffe23 100644
--- a/java/org/apache/catalina/startup/Tomcat.java
+++ b/java/org/apache/catalina/startup/Tomcat.java
@@ -1234,7 +1234,7 @@ public class Tomcat {
 }
 
 protected URL getWebappConfigFile(String path, String contextName) {
-File docBase = new File(server.getCatalinaBase(), path);
+File docBase = new File(path);
 if (docBase.isDirectory()) {
 return getWebappConfigFileFromDirectory(docBase, contextName);
 } else {


-
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: Revert "Have 'pre-release' indicate the the release is in progress."

2023-03-01 Thread schultz
This is an automated email from the ASF dual-hosted git repository.

schultz 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 44c503d3ea Revert "Have 'pre-release' indicate the the release is in 
progress."
44c503d3ea is described below

commit 44c503d3ea246b628f130190638954b2ead58822
Author: Christopher Schultz 
AuthorDate: Wed Mar 1 09:12:38 2023 -0500

Revert "Have 'pre-release' indicate the the release is in progress."

This reverts commit 3774f307d145298a2a9b7b2e43dcdddb5d9dd033.
---
 build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.xml b/build.xml
index 3e116f1eb9..d407be0407 100644
--- a/build.xml
+++ b/build.xml
@@ -2403,7 +2403,7 @@ asf.ldap.username=${release.asfusername}
 
+value="rtext=" />
   
 
   

[tomcat] branch 8.5.x updated: Revert "Tag for r8.5.85." This should have been in a branch.

2023-01-10 Thread schultz
This is an automated email from the ASF dual-hosted git repository.

schultz 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 02b02132aa Revert "Tag for r8.5.85." This should have been in a branch.
02b02132aa is described below

commit 02b02132aadfc3d5f6b6369f6e264fec03abba48
Author: schultz 
AuthorDate: Tue Jan 10 16:08:30 2023 -0800

Revert "Tag for r8.5.85." This should have been in a branch.

This reverts commit c22b29b4da07810269cee64c62b57796fbaeb85a.
---
 build.properties.release | 52 
 res/maven/mvn.properties.release | 27 -
 webapps/docs/changelog.xml   |  2 +-
 3 files changed, 1 insertion(+), 80 deletions(-)

diff --git a/build.properties.release b/build.properties.release
deleted file mode 100644
index 8d63d8e154..00
--- a/build.properties.release
+++ /dev/null
@@ -1,52 +0,0 @@
-# -
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# -
-
-# This file was auto-generated by the pre-release Ant target.
-
-# Any unwanted settings may be over-ridden in a build.properties file located
-# in the same directory as this file.
-
-# Set the version-dev to "" (empty string) as this is not a development 
release.
-version.dev=
-
-# Ensure consistent timestamps for reproducible builds.
-ant.tstamp.now.iso=2023-01-10T23:58:01Z
-
-# Enable insertion of detached signatures into the Windows installer.
-do.codesigning=true
-
-# Re-use the same GPG executable.
-gpg.exec=C:/Program Files (x86)/gnupg/bin/gpg.exe
-
-# Reproducible builds require the use of the build tools defined below. The
-# vendors (where appropriate) and versions must match exactly for a 
reproducible
-# build since this data is embedded in various files, particularly JAR file
-# manifests, as part of the build process.
-#
-# Apache Ant:  Apache Ant(TM) version 1.10.12 compiled on October 13 2021
-#
-# Java Name:   OpenJDK 64-Bit Server VM
-# Java Vendor: Eclipse Adoptium
-# Java Version:11.0.17+8
-
-# The following is provided for information only. Builds will be repeatable
-# whether or not the build environment in consistent with this information.
-#
-# OS:  amd64 Windows 10 10.0
-# File encoding:   Cp1252
-#
-# Release Manager: schultz
diff --git a/res/maven/mvn.properties.release b/res/maven/mvn.properties.release
deleted file mode 100644
index 27c3c12bc3..00
--- a/res/maven/mvn.properties.release
+++ /dev/null
@@ -1,27 +0,0 @@
-# -
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# -
-
-# This file was auto-generated by the pre-release Ant target.
-
-# Remove "-dev" from the version since this is not a development release.
-maven.asf.release.deploy.version=8.5.85
-
-# Re-use the same GPG executable.
-gpg.exec=C:/Program Files (x86)/gnupg/bin/gpg.exe
-
-# Set the user name to use to upload the artefacts to Nexus.
-asf.ldap.username=schultz
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index c12e35a124..06f4f23a17 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -104,7 +104,7 @@
   

[tomcat] branch 8.5.x updated: Revert "Fix the typos in the XML schemas" due to license concerns

2022-09-28 Thread ebourg
This is an automated email from the ASF dual-hosted git repository.

ebourg 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 d3c32685b9 Revert "Fix the typos in the XML schemas" due to license 
concerns
d3c32685b9 is described below

commit d3c32685b938647086f96a7baf9832541dbe5135
Author: Emmanuel Bourg 
AuthorDate: Wed Sep 28 16:10:09 2022 +0200

Revert "Fix the typos in the XML schemas" due to license concerns

This reverts commit ad7b58a80aca18c684491f724b9444bbf434d955.
---
 java/javax/servlet/jsp/resources/jspxml.xsd | 2 +-
 java/javax/servlet/resources/javaee_web_services_1_2.xsd| 2 +-
 java/javax/servlet/resources/javaee_web_services_1_3.xsd| 2 +-
 java/javax/servlet/resources/javaee_web_services_1_4.xsd| 2 +-
 java/javax/servlet/resources/javaee_web_services_client_1_2.xsd | 2 +-
 java/javax/servlet/resources/javaee_web_services_client_1_3.xsd | 2 +-
 java/javax/servlet/resources/javaee_web_services_client_1_4.xsd | 2 +-
 java/javax/servlet/resources/jsp_2_1.xsd| 2 +-
 java/javax/servlet/resources/web-app_3_0.xsd| 2 +-
 java/javax/servlet/resources/web-app_3_1.xsd| 2 +-
 java/javax/servlet/resources/web-fragment_3_0.xsd   | 2 +-
 java/javax/servlet/resources/web-fragment_3_1.xsd   | 2 +-
 java/javax/servlet/resources/web-jsptaglibrary_2_1.xsd  | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/java/javax/servlet/jsp/resources/jspxml.xsd 
b/java/javax/servlet/jsp/resources/jspxml.xsd
index 1634d208d9..0e5eba0b36 100644
--- a/java/javax/servlet/jsp/resources/jspxml.xsd
+++ b/java/javax/servlet/jsp/resources/jspxml.xsd
@@ -414,7 +414,7 @@
 jsp:useBean action or a custom action with an associated
 VariableInfo entry for this name.
 
-Exact valid combinations are not expressible in XML Schema.
+Exact valid combinations are not expressable in XML Schema.
 They are:
 
 name="Identifier" property="*"
diff --git a/java/javax/servlet/resources/javaee_web_services_1_2.xsd 
b/java/javax/servlet/resources/javaee_web_services_1_2.xsd
index ec5540dd6c..43914742ff 100644
--- a/java/javax/servlet/resources/javaee_web_services_1_2.xsd
+++ b/java/javax/servlet/resources/javaee_web_services_1_2.xsd
@@ -336,7 +336,7 @@
   com.wombat.empl.EmployeeService
 
   This may not be specified in case there is no Service
-  Endpoint Interface as is the case with directly using an
+  Enpoint Interface as is the case with directly using an
   implementation class with the @WebService annotation.
 
   When the port component is a Provider implementation
diff --git a/java/javax/servlet/resources/javaee_web_services_1_3.xsd 
b/java/javax/servlet/resources/javaee_web_services_1_3.xsd
index 71d4b33f73..d69d723e1d 100644
--- a/java/javax/servlet/resources/javaee_web_services_1_3.xsd
+++ b/java/javax/servlet/resources/javaee_web_services_1_3.xsd
@@ -332,7 +332,7 @@
   com.wombat.empl.EmployeeService
 
 This may not be specified in case there is no Service
-Endpoint Interface as is the case with directly using an
+Enpoint Interface as is the case with directly using an
 implementation class with the @WebService annotation.
 
 When the port component is a Provider implementation
diff --git a/java/javax/servlet/resources/javaee_web_services_1_4.xsd 
b/java/javax/servlet/resources/javaee_web_services_1_4.xsd
index 032e6b7492..e32c5b7d0c 100644
--- a/java/javax/servlet/resources/javaee_web_services_1_4.xsd
+++ b/java/javax/servlet/resources/javaee_web_services_1_4.xsd
@@ -332,7 +332,7 @@
   com.wombat.empl.EmployeeService
 
 This may not be specified in case there is no Service
-Endpoint Interface as is the case with directly using an
+Enpoint Interface as is the case with directly using an
 implementation class with the @WebService annotation.
 
 When the port component is a Provider implementation
diff --git a/java/javax/servlet/resources/javaee_web_services_client_1_2.xsd 
b/java/javax/servlet/resources/javaee_web_services_client_1_2.xsd
index e32af449b3..e95308a0a8 100644
--- a/java/javax/servlet/resources/javaee_web_services_client_1_2.xsd
+++ b/java/javax/servlet/resources/javaee_web_services_client_1_2.xsd
@@ -260,7 +260,7 @@
   
 
 The service-qname element declares the specific WSDL service
-element that is being referred to.  It is not specified if no
+element that is being refered to.  It is not specified if no
 wsdl-file is declared.
 
   
diff --git 

[tomcat] branch 8.5.x updated: Revert the ja <-> Shift_JIS mapping

2022-04-28 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 d87e64d3f1 Revert the ja <-> Shift_JIS mapping
d87e64d3f1 is described below

commit d87e64d3f107c5040b516c3c3dccea017bf793ba
Author: Mark Thomas 
AuthorDate: Thu Apr 28 19:26:24 2022 +0100

Revert the ja <-> Shift_JIS mapping
---
 java/org/apache/catalina/util/CharsetMapperDefault.properties | 1 -
 webapps/docs/changelog.xml| 6 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/util/CharsetMapperDefault.properties 
b/java/org/apache/catalina/util/CharsetMapperDefault.properties
index d438bcf71e..6f8bf49493 100644
--- a/java/org/apache/catalina/util/CharsetMapperDefault.properties
+++ b/java/org/apache/catalina/util/CharsetMapperDefault.properties
@@ -15,4 +15,3 @@
 
 en=ISO-8859-1
 fr=ISO-8859-1
-ja=Shift_JIS
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index b17701fa92..ed9063ff7b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -118,6 +118,12 @@
 retrieve a certificate DN, to match the output of the deprecated
 getSubjectDN().getName() that was used previously. (remm)
   
+  
+Revert the change in 8.5.76 that added a mapping of
+Shift_JIS for the ja locale to the default
+mappings used by ServletResponse.setLocale() as it
+caused regressions for applications using UTF-8. (markt)
+  
 
   
   


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



[tomcat] branch 8.5.x updated: Revert "Fix BZ 65714 - previous fix was incomplete."

2021-12-09 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 558d8ee  Revert "Fix BZ 65714 - previous fix was incomplete."
558d8ee is described below

commit 558d8eebeacd52dd5dd2e38a5899f1193370b7a7
Author: Mark Thomas 
AuthorDate: Thu Dec 9 13:56:24 2021 +

Revert "Fix BZ 65714 - previous fix was incomplete."

This reverts commit 2a725038c4b4f1df9393abdd1cd43a4370399e7c.
---
 java/org/apache/catalina/security/SecurityClassLoad.java | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/java/org/apache/catalina/security/SecurityClassLoad.java 
b/java/org/apache/catalina/security/SecurityClassLoad.java
index f6064b0..c2cb0fc 100644
--- a/java/org/apache/catalina/security/SecurityClassLoad.java
+++ b/java/org/apache/catalina/security/SecurityClassLoad.java
@@ -189,9 +189,6 @@ public final class SecurityClassLoad {
 loader.loadClass(basePackage + 
"util.net.AprEndpoint$AprSocketWrapper$AprOperationState");
 loader.loadClass(basePackage + 
"util.net.NioEndpoint$NioSocketWrapper$NioOperationState");
 loader.loadClass(basePackage + 
"util.net.Nio2Endpoint$Nio2SocketWrapper$Nio2OperationState");
-loader.loadClass(basePackage + "util.net.SecureNio2Channel");
-loader.loadClass(basePackage + "util.net.SocketBufferHandler");
-loader.loadClass(basePackage + "util.net.SocketBufferHandler$1");
 loader.loadClass(basePackage + 
"util.net.SocketWrapperBase$BlockingMode");
 loader.loadClass(basePackage + 
"util.net.SocketWrapperBase$CompletionCheck");
 loader.loadClass(basePackage + 
"util.net.SocketWrapperBase$CompletionHandlerCall");

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



Re: [tomcat] branch 8.5.x updated: Revert incorrect change in 4896083

2021-11-28 Thread Michael Osipov

Am 2021-11-28 um 14:42 schrieb ma...@apache.org:

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 417e339  Revert incorrect change in 4896083
417e339 is described below

commit 417e3396a44efd71c16b2494c4840f8b347ecf7b
Author: Mark Thomas 
AuthorDate: Sun Nov 28 13:42:24 2021 +

 Revert incorrect change in 4896083
---
  .../org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java 
b/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java
index e34c91f..bddec0c 100644
--- a/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java
+++ b/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java
@@ -65,8 +65,8 @@ public class StoreConfigLifecycleListener implements 
LifecycleListener {
  if (event.getSource() instanceof Server) {
  createMBean((Server) event.getSource());
  } else {
-log.warn("This listener must only be nested within Server elements, 
but is in [" +
-event.getLifecycle().getClass().getSimpleName() + 
"].");
+log.warn(sm.getString("storeConfigListener.notServer",
+event.getLifecycle().getClass().getSimpleName()));


This is now incorrect as well. Look at 
https://github.com/apache/tomcat/blob/48960832ca7e5c6da77d2fb83548e4f92fb37040/java/org/apache/catalina/storeconfig/LocalStrings.properties#L22. 
There is no placeholder.



-
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: Revert incorrect change in 4896083

2021-11-28 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 417e339  Revert incorrect change in 4896083
417e339 is described below

commit 417e3396a44efd71c16b2494c4840f8b347ecf7b
Author: Mark Thomas 
AuthorDate: Sun Nov 28 13:42:24 2021 +

Revert incorrect change in 4896083
---
 .../org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java 
b/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java
index e34c91f..bddec0c 100644
--- a/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java
+++ b/java/org/apache/catalina/storeconfig/StoreConfigLifecycleListener.java
@@ -65,8 +65,8 @@ public class StoreConfigLifecycleListener implements 
LifecycleListener {
 if (event.getSource() instanceof Server) {
 createMBean((Server) event.getSource());
 } else {
-log.warn("This listener must only be nested within Server 
elements, but is in [" +
-event.getLifecycle().getClass().getSimpleName() + 
"].");
+log.warn(sm.getString("storeConfigListener.notServer",
+event.getLifecycle().getClass().getSimpleName()));
 }
 } else if (Lifecycle.AFTER_STOP_EVENT.equals(event.getType())) {
 if (oname != 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: Revert clean-up. definePackage always needs to be called.

2021-07-30 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 4a2e0da  Revert clean-up. definePackage always needs to be called.
4a2e0da is described below

commit 4a2e0da8500175c219726ae56ff28412d21f730f
Author: Mark Thomas 
AuthorDate: Fri Jul 30 08:20:28 2021 +0100

Revert clean-up. definePackage always needs to be called.
---
 .../catalina/loader/WebappClassLoaderBase.java | 68 --
 1 file changed, 37 insertions(+), 31 deletions(-)

diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java 
b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
index e7a35db..16043b5 100644
--- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java
+++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
@@ -2436,40 +2436,46 @@ public abstract class WebappClassLoaderBase extends 
URLClassLoader
 }
 }
 
-if (securityManager != null) {
-// Looking up the package
-int pos = name.lastIndexOf('.');
-if (pos != -1) {
-String packageName = name.substring(0, pos);
-Package pkg = getPackage(packageName);
-
-// Define the package (if null)
-if (pkg == null) {
-try {
-if (manifest == null) {
-definePackage(packageName, null, null, null, 
null, null, null, null);
-} else {
-definePackage(packageName, manifest, codeBase);
-}
-} catch (IllegalArgumentException e) {
-// Ignore: normal error due to dual definition of 
package
-}
-pkg = getPackage(packageName);
-}
+// Looking up the package
+String packageName = null;
+int pos = name.lastIndexOf('.');
+if (pos != -1) {
+packageName = name.substring(0, pos);
+}
+
+Package pkg = null;
 
-// Checking sealing
-if (pkg != null) {
-boolean sealCheck = true;
-if (pkg.isSealed()) {
-sealCheck = pkg.isSealed(codeBase);
+if (packageName != null) {
+pkg = getPackage(packageName);
+
+// Define the package (if null)
+if (pkg == null) {
+try {
+if (manifest == null) {
+definePackage(packageName, null, null, null, null, 
null, null, null);
 } else {
-sealCheck = (manifest == null) || 
!isPackageSealed(packageName, manifest);
-}
-if (!sealCheck) {
-throw new SecurityException
-("Sealing violation loading " + name + " : 
Package "
- + packageName + " is sealed.");
+definePackage(packageName, manifest, codeBase);
 }
+} catch (IllegalArgumentException e) {
+// Ignore: normal error due to dual definition of 
package
+}
+pkg = getPackage(packageName);
+}
+}
+
+if (securityManager != null) {
+// Checking sealing
+if (pkg != null) {
+boolean sealCheck = true;
+if (pkg.isSealed()) {
+sealCheck = pkg.isSealed(codeBase);
+} else {
+sealCheck = (manifest == null) || 
!isPackageSealed(packageName, manifest);
+}
+if (!sealCheck) {
+throw new SecurityException
+("Sealing violation loading " + name + " : Package 
"
+ + packageName + " is sealed.");
 }
 }
 }

-
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: Revert "Remove unused file"

2021-06-25 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 ff1369b  Revert "Remove unused file"
ff1369b is described below

commit ff1369b653f222a1a0a21c549581dfb437538ec5
Author: Mark Thomas 
AuthorDate: Fri Jun 25 08:10:13 2021 +0100

Revert "Remove unused file"

This reverts commit 0dee371b82bf2ed18a7316430db8c25bdb3644e3.
---
 test/webapp/bug6/bug64872b-timeunit.jsp | 29 +
 1 file changed, 29 insertions(+)

diff --git a/test/webapp/bug6/bug64872b-timeunit.jsp 
b/test/webapp/bug6/bug64872b-timeunit.jsp
new file mode 100644
index 000..679925f
--- /dev/null
+++ b/test/webapp/bug6/bug64872b-timeunit.jsp
@@ -0,0 +1,29 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+--%>
+<%@ taglib uri="http://tomcat.apache.org/tag-setters; prefix="ts" %>
+
+  Bug 64872b TimeUnit test case
+  
+  <%
+  for (int i=0; i < 10; i++) {
+  %>
+01 The value of foo is []
+  <%
+  }
+  %>
+  
+
\ No newline at end of file

-
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: Revert due to uncertainty about the behavior

2021-04-20 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm 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 fecda18  Revert due to uncertainty about the behavior
fecda18 is described below

commit fecda18595c1ee2dabb1de20311b96b49ffbbff9
Author: remm 
AuthorDate: Tue Apr 20 20:49:01 2021 +0200

Revert due to uncertainty about the behavior
---
 java/org/apache/catalina/startup/ContextConfig.java | 7 +++
 webapps/docs/changelog.xml  | 4 
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/startup/ContextConfig.java 
b/java/org/apache/catalina/startup/ContextConfig.java
index 3db02f3..dd980a6 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -2051,10 +2051,9 @@ public class ContextConfig implements LifecycleListener {
 return;
 }
 
-if ((javaClass.getAccessFlags()
-& (org.apache.tomcat.util.bcel.Const.ACC_ANNOTATION
-| org.apache.tomcat.util.bcel.Const.ACC_INTERFACE)) != 
0) {
-// Skip annotations or interfaces
+if ((javaClass.getAccessFlags() &
+org.apache.tomcat.util.bcel.Const.ACC_ANNOTATION) != 0) {
+// Skip annotations.
 return;
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index b3293fa..9643360 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -125,10 +125,6 @@
 resulting in one of the deployments failing and errors being reported.
 (markt)
   
-  
-65256: HandlesTypes class sets should not include
-interfaces. (remm)
-  
 
   
   

-
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: Revert "Restore try catch around Poller.events"

2020-10-28 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 f0b2ace  Revert "Restore try catch around Poller.events"
f0b2ace is described below

commit f0b2ace0bdff0704ca2211c06c384468c79b6201
Author: Mark Thomas 
AuthorDate: Wed Oct 28 08:36:00 2020 +

Revert "Restore try catch around Poller.events"

This reverts commit 1c0738407e4c3a73b312fae279046249c2dc025d.
There was no need for me to back-port this.
---
 java/org/apache/tomcat/util/net/NioEndpoint.java | 8 
 webapps/docs/changelog.xml   | 5 -
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index fadec98..08b8a4e 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -849,15 +849,15 @@ public class NioEndpoint extends 
AbstractJsseEndpoint {
 }
 break;
 }
-// Either we timed out or we woke up, process events first
-if (keyCount == 0) {
-hasEvents = (hasEvents | events());
-}
 } catch (Throwable x) {
 ExceptionUtils.handleThrowable(x);
 log.error("",x);
 continue;
 }
+// Either we timed out or we woke up, process events first
+if (keyCount == 0) {
+hasEvents = (hasEvents | events());
+}
 
 Iterator iterator =
 keyCount > 0 ? selector.selectedKeys().iterator() : null;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 6e732eb..606603d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -91,11 +91,6 @@
 63362: Add collection of statistics for HTTP/2, WebSocket 
and
 connections upgraded via the HTTP upgrade mechanism. (markt)
   
-  
-Restore exception catch around Poller.events, as it would cause
-the NIO poller thread to exit. This is a regression caused when
-the Poller.events method was refactored. (remm)
-  
 
   
   


-
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: Revert stream memory footprint reduction and incomplete fixes

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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new c3b7372  Revert stream memory footprint reduction and incomplete fixes
c3b7372 is described below

commit c3b7372b2bd09973222d5d6d5610a5e09d1292bc
Author: Mark Thomas 
AuthorDate: Tue Sep 8 10:16:57 2020 +0100

Revert stream memory footprint reduction and incomplete fixes

Revert the changes due to the steady stream of regressions that are
being reported and.or found by the CI systems. A more robust solution is
required.
---
 java/org/apache/coyote/http2/Stream.java | 41 +++-
 webapps/docs/changelog.xml   |  5 
 2 files changed, 19 insertions(+), 27 deletions(-)

diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index 46719da..813980c 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -297,19 +297,14 @@ public class Stream extends AbstractStream implements 
HeaderEmitter {
 
 
 void doStreamCancel(String msg, Http2Error error) throws CloseNowException 
{
-// Avoid NPEs on duplicate cancellations
-StreamOutputBuffer streamOutputBuffer = this.streamOutputBuffer;
-Response coyoteResponse = this.coyoteResponse;
 StreamException se = new StreamException(msg, error, getIdAsInt());
-if (streamOutputBuffer != null && coyoteResponse != null) {
-// Prevent the application making further writes
-streamOutputBuffer.closed = true;
-// Prevent Tomcat's error handling trying to write
-coyoteResponse.setError();
-coyoteResponse.setErrorReported();
-// Trigger a reset once control returns to Tomcat
-streamOutputBuffer.reset = se;
-}
+// Prevent the application making further writes
+streamOutputBuffer.closed = true;
+// Prevent Tomcat's error handling trying to write
+coyoteResponse.setError();
+coyoteResponse.setErrorReported();
+// Trigger a reset once control returns to Tomcat
+streamOutputBuffer.reset = se;
 throw new CloseNowException(msg, se);
 }
 
@@ -477,13 +472,7 @@ public class Stream extends AbstractStream implements 
HeaderEmitter {
 name), Http2Error.PROTOCOL_ERROR, getIdAsInt());
 }
 
-// Avoid NPE if Stream has been closed on Stream specific thread
-Request coyoteRequest = this.coyoteRequest;
-if (coyoteRequest != null) {
-// HTTP/2 headers are already always lower case
-// In 8.5.x trailer headers are added to headers collection.
-coyoteRequest.getMimeHeaders().addValue(name).setString(value);
-}
+coyoteRequest.getMimeHeaders().addValue(name).setString(value);
 }
 }
 }
@@ -624,14 +613,9 @@ public class Stream extends AbstractStream implements 
HeaderEmitter {
 
 
 final boolean isContentLengthInconsistent() {
-Request coyoteRequest = this.coyoteRequest;
-// May be null when processing trailer headers after stream has been
-// closed.
-if (coyoteRequest != null) {
-long contentLengthHeader = coyoteRequest.getContentLengthLong();
-if (contentLengthHeader > -1 && contentLengthReceived != 
contentLengthHeader) {
-return true;
-}
+long contentLengthHeader = coyoteRequest.getContentLengthLong();
+if (contentLengthHeader > -1 && contentLengthReceived != 
contentLengthHeader) {
+return true;
 }
 return false;
 }
@@ -737,12 +721,15 @@ public class Stream extends AbstractStream implements 
HeaderEmitter {
 if (log.isDebugEnabled()) {
 log.debug(sm.getString("stream.recycle", getConnectionId(), 
getIdentifier()));
 }
+/*
+ * Temporarily disabled due to multiple regressions (NPEs)
 coyoteRequest = null;
 cookieHeader = null;
 coyoteResponse = null;
 inputBuffer = null;
 streamOutputBuffer = null;
 http2OutputBuffer = null;
+*/
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index a7a7430..2337deb 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -157,6 +157,11 @@
 streams to account for DATA frames containing zero-length padding.
 (markt)
   
+  
+64710: Revert the changes to reduce the memory footprint of
+closed HTTP/2 streams as they triggered multiple regressions in the 
form
+of NullPointerExceptions. (markt)
+  
 
   
   


-
To 

[tomcat] branch 8.5.x updated: Revert

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

remm 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 2808a97  Revert
2808a97 is described below

commit 2808a97cd1c524fa8e187b4bf4bbd189c80a5085
Author: remm 
AuthorDate: Wed May 13 15:48:12 2020 +0200

Revert
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index a559124..0f11f3d 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -72,8 +72,6 @@ public class CoyoteAdapter implements Adapter {
 System.getProperty("java.vm.vendor") + "/" +
 System.getProperty("java.runtime.version") + ")";
 
-private static final String INVALID_URI = "Invalid URI ";
-
 private static final EnumSet SSL_ONLY =
 EnumSet.of(SessionTrackingMode.SSL);
 
@@ -616,7 +614,7 @@ public class CoyoteAdapter implements Adapter {
 connector.getService().getContainer().logAccess(request, 
response, 0, true);
 return false;
 } else {
-response.sendError(400, INVALID_URI);
+response.sendError(400, "Invalid URI");
 }
 }
 
@@ -634,7 +632,7 @@ public class CoyoteAdapter implements Adapter {
 try {
 req.getURLDecoder().convert(decodedURI.getByteChunk(), 
connector.getEncodedSolidusHandlingInternal());
 } catch (IOException ioe) {
-response.sendError(400, INVALID_URI + ioe.getMessage());
+response.sendError(400, "Invalid URI: " + ioe.getMessage());
 }
 // Normalization
 if (normalize(req.decodedURI())) {
@@ -645,7 +643,7 @@ public class CoyoteAdapter implements Adapter {
 response.sendError(400, "Invalid URI");
 }
 } else {
-response.sendError(400, INVALID_URI);
+response.sendError(400, "Invalid URI");
 }
 } else {
 /* The URI is chars or String, and has been sent using an in-memory


-
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: Revert "Check for non-null 'methods'"

2020-02-20 Thread mgrigorov
This is an automated email from the ASF dual-hosted git repository.

mgrigorov 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 42a5701  Revert "Check for non-null 'methods'"
42a5701 is described below

commit 42a5701727cdcebb9e8e8346941d679bcda60eac
Author: Martin Tzvetanov Grigorov 
AuthorDate: Thu Feb 20 13:24:48 2020 +0200

Revert "Check for non-null 'methods'"

This reverts commit 84abf86f24142f1790b9cf5a31b8cce94822c8ce.
---
 java/javax/servlet/http/HttpServlet.java | 24 +++-
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/java/javax/servlet/http/HttpServlet.java 
b/java/javax/servlet/http/HttpServlet.java
index 2ac26cf..aedbee6 100644
--- a/java/javax/servlet/http/HttpServlet.java
+++ b/java/javax/servlet/http/HttpServlet.java
@@ -502,21 +502,19 @@ public abstract class HttpServlet extends GenericServlet {
 }
 // End of Tomcat specific hack
 
-if (methods != null) {
-for (int i = 0; i < methods.length; i++) {
-Method m = methods[i];
+for (int i=0; i

[tomcat] branch 8.5.x updated: Revert the fix for https://bz.apache.org/bugzilla/show_bug.cgi?id=63815

2019-11-25 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 d946928  Revert the fix for 
https://bz.apache.org/bugzilla/show_bug.cgi?id=63815
d946928 is described below

commit d946928f956adffa59fcf94fd759dbab6e0e38a4
Author: Mark Thomas 
AuthorDate: Mon Nov 25 20:44:37 2019 +

Revert the fix for https://bz.apache.org/bugzilla/show_bug.cgi?id=63815

This triggered various regressions, particularly with daemon.sh
---
 bin/catalina.sh| 16 
 bin/daemon.sh  |  4 ++--
 bin/tool-wrapper.sh|  2 +-
 webapps/docs/changelog.xml | 10 ++
 4 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/bin/catalina.sh b/bin/catalina.sh
index baa0bd9..5fbdb72 100755
--- a/bin/catalina.sh
+++ b/bin/catalina.sh
@@ -354,7 +354,7 @@ if [ "$1" = "debug" ] ; then
 echo "Using Security Manager"
   fi
   shift
-  exec "$_RUNJDB" "$LOGGING_CONFIG" $LOGGING_MANAGER "$JAVA_OPTS" 
"$CATALINA_OPTS" \
+  exec "$_RUNJDB" "$LOGGING_CONFIG" $LOGGING_MANAGER $JAVA_OPTS 
$CATALINA_OPTS \
 -D$ENDORSED_PROP="$JAVA_ENDORSED_DIRS" \
 -classpath "$CLASSPATH" \
 -sourcepath "$CATALINA_HOME"/../../java \
@@ -365,7 +365,7 @@ if [ "$1" = "debug" ] ; then
 -Djava.io.tmpdir="$CATALINA_TMPDIR" \
 org.apache.catalina.startup.Bootstrap "$@" start
 else
-  exec "$_RUNJDB" "$LOGGING_CONFIG" $LOGGING_MANAGER "$JAVA_OPTS" 
"$CATALINA_OPTS" \
+  exec "$_RUNJDB" "$LOGGING_CONFIG" $LOGGING_MANAGER $JAVA_OPTS 
$CATALINA_OPTS \
 -D$ENDORSED_PROP="$JAVA_ENDORSED_DIRS" \
 -classpath "$CLASSPATH" \
 -sourcepath "$CATALINA_HOME"/../../java \
@@ -384,7 +384,7 @@ elif [ "$1" = "run" ]; then
   echo "Using Security Manager"
 fi
 shift
-eval exec "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER 
"$JAVA_OPTS" "$CATALINA_OPTS" \
+eval exec "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER 
$JAVA_OPTS $CATALINA_OPTS \
   -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \
   -classpath "\"$CLASSPATH\"" \
   -Djava.security.manager \
@@ -394,7 +394,7 @@ elif [ "$1" = "run" ]; then
   -Djava.io.tmpdir="\"$CATALINA_TMPDIR\"" \
   org.apache.catalina.startup.Bootstrap "$@" start
   else
-eval exec "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER 
"$JAVA_OPTS" "$CATALINA_OPTS" \
+eval exec "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER 
$JAVA_OPTS $CATALINA_OPTS \
   -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \
   -classpath "\"$CLASSPATH\"" \
   -Dcatalina.base="\"$CATALINA_BASE\"" \
@@ -452,7 +452,7 @@ elif [ "$1" = "start" ] ; then
   echo "Using Security Manager"
 fi
 shift
-eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER 
"$JAVA_OPTS" "$CATALINA_OPTS" \
+eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER 
$JAVA_OPTS $CATALINA_OPTS \
   -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \
   -classpath "\"$CLASSPATH\"" \
   -Djava.security.manager \
@@ -464,7 +464,7 @@ elif [ "$1" = "start" ] ; then
   >> "$CATALINA_OUT" 2>&1 "&"
 
   else
-eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER 
"$JAVA_OPTS" "$CATALINA_OPTS" \
+eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER 
$JAVA_OPTS $CATALINA_OPTS \
   -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \
   -classpath "\"$CLASSPATH\"" \
   -Dcatalina.base="\"$CATALINA_BASE\"" \
@@ -517,7 +517,7 @@ elif [ "$1" = "stop" ] ; then
 fi
   fi
 
-  eval "\"$_RUNJAVA\"" $LOGGING_MANAGER "$JAVA_OPTS" \
+  eval "\"$_RUNJAVA\"" $LOGGING_MANAGER $JAVA_OPTS \
 -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \
 -classpath "\"$CLASSPATH\"" \
 -Dcatalina.base="\"$CATALINA_BASE\"" \
@@ -604,7 +604,7 @@ elif [ "$1" = "stop" ] ; then
 
 elif [ "$1" = "configtest" ] ; then
 
-eval "\"$_RUNJAVA\"" $LOGGING_MANAGER "$JAVA_OPTS" \
+eval "\"$_RUNJAVA\"" $LOGGING_MANAGER $JAVA_OPTS \
   -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \
   -classpath "\"$CLASSPATH\"" \
   -Dcatalina.base="\"$CATALINA_BASE\"" \
diff --git a/bin/daemon.sh b/bin/daemon.sh
index 3c517ba..afa4c89 100755
--- a/bin/daemon.sh
+++ b/bin/daemon.sh
@@ -208,7 +208,7 @@ case "$1" in
   -outfile "&1" \
   -errfile "&2" \
   -classpath "$CLASSPATH" \
-  "$LOGGING_CONFIG" "$JAVA_OPTS" "$CATALINA_OPTS" \
+  "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \
   -D$ENDORSED_PROP="$JAVA_ENDORSED_DIRS" \
   -Dcatalina.base="$CATALINA_BASE" \
   -Dcatalina.home="$CATALINA_HOME" \
@@ -225,7 +225,7 @@ case "$1" in
   -outfile "$CATALINA_OUT" \
   -errfile "&1" \
   -classpath "$CLASSPATH" \
-  "$LOGGING_CONFIG" "$JAVA_OPTS" "$CATALINA_OPTS" \
+  "$LOGGING_CONFIG" $JAVA_OPTS 

[tomcat] branch 8.5.x updated: Revert unnecessary change

2019-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 cfa3cbf  Revert unnecessary change
cfa3cbf is described below

commit cfa3cbf3aa7ec5816b84ee54841d75e07ff7f27f
Author: Mark Thomas 
AuthorDate: Fri Sep 6 20:31:26 2019 +0100

Revert unnecessary change
---
 BUILDING.txt | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/BUILDING.txt b/BUILDING.txt
index 1e6d354..e0811af 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -298,13 +298,11 @@ You can build them by using the following commands:
 
 Release managers will be provided with the necessary credentials by the 
PMC.
 It will also be necessary to enable TLS 1.1 and TLS 1.2 by default (they 
are
-disabled by default on Java 7) and to specify a more up to date trust store
-than that provided with the most recent Java 7 release for the build 
process
-to communicate with the code signing service. The simplest way is by 
setting
-the ANT_OPTS environment variable. E.g. (for Windows):
+disabled by default on Java 7) for the build process to communicate with 
the
+code signing service. The simplest way is by setting the ANT_OPTS
+environment variable. E.g. (for Windows):
 
-set ANT_OPTS=-Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 ^
- 
-Djavax.net.ssl.trustStore=C:\java-home\jre\lib\security\cacerts
+set ANT_OPTS=-Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2
 
  4. Build the release:
 


-
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: Revert unnecessary back-port

2019-06-04 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 a7386ee  Revert unnecessary back-port
a7386ee is described below

commit a7386ee2d6850c77e494852289107c71f6f24b91
Author: Mark Thomas 
AuthorDate: Tue Jun 4 16:28:18 2019 +0100

Revert unnecessary back-port
---
 java/org/apache/coyote/AbstractProtocol.java   | 7 ---
 .../apache/coyote/http11/upgrade/InternalHttpUpgradeHandler.java   | 4 
 2 files changed, 11 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProtocol.java 
b/java/org/apache/coyote/AbstractProtocol.java
index 4cbda42..837f805 100644
--- a/java/org/apache/coyote/AbstractProtocol.java
+++ b/java/org/apache/coyote/AbstractProtocol.java
@@ -35,7 +35,6 @@ import javax.management.ObjectName;
 import javax.servlet.http.HttpUpgradeHandler;
 import javax.servlet.http.WebConnection;
 
-import org.apache.coyote.http11.upgrade.InternalHttpUpgradeHandler;
 import org.apache.juli.logging.Log;
 import org.apache.tomcat.InstanceManager;
 import org.apache.tomcat.util.ExceptionUtils;
@@ -861,12 +860,6 @@ public abstract class AbstractProtocol implements 
ProtocolHandler,
 
upgradeToken.getContextBind().unbind(false, oldCL);
 }
 }
-if (httpUpgradeHandler instanceof 
InternalHttpUpgradeHandler) {
-if (((InternalHttpUpgradeHandler) 
httpUpgradeHandler).hasAsyncIO()) {
-// The handler will initiate all further 
I/O
-state = SocketState.LONG;
-}
-}
 }
 }
 } while ( state == SocketState.UPGRADING);
diff --git 
a/java/org/apache/coyote/http11/upgrade/InternalHttpUpgradeHandler.java 
b/java/org/apache/coyote/http11/upgrade/InternalHttpUpgradeHandler.java
index 8c5ce39..936784e 100644
--- a/java/org/apache/coyote/http11/upgrade/InternalHttpUpgradeHandler.java
+++ b/java/org/apache/coyote/http11/upgrade/InternalHttpUpgradeHandler.java
@@ -37,8 +37,4 @@ public interface InternalHttpUpgradeHandler extends 
HttpUpgradeHandler {
 void setSslSupport(SSLSupport sslSupport);
 
 void pause();
-
-default boolean hasAsyncIO() {
-return false;
-}
 }
\ No newline at end of file


-
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: Revert to the previous revision

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

remm 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 8105776  Revert to the previous revision
8105776 is described below

commit 8105776b9c4d484ea8fda8f8be8eb0f82d6c9a1f
Author: remm 
AuthorDate: Wed Mar 27 18:37:09 2019 +0100

Revert to the previous revision

This was equivalent but slightly less efficient. Also cleanup the
flushNonBlocking IOE check.
---
 java/org/apache/tomcat/util/net/Nio2Endpoint.java | 29 ++-
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/Nio2Endpoint.java 
b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
index 27891d5..c38dc70 100644
--- a/java/org/apache/tomcat/util/net/Nio2Endpoint.java
+++ b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
@@ -731,7 +731,22 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint {
 if (writeNotify) {
 return true;
 }
-return super.isReadyForWrite();
+
+if (!writePending.tryAcquire()) {
+writeInterest = true;
+return false;
+}
+
+if (socketBufferHandler.isWriteBufferEmpty() && 
nonBlockingWriteBuffer.isEmpty()) {
+writePending.release();
+return true;
+}
+
+boolean isReady = !flushNonBlockingInternal(true);
+if (!isReady) {
+writeInterest = true;
+}
+return isReady;
 }
 }
 
@@ -1233,6 +1248,7 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint {
 // indicate the end of a write
 // Uses: if (writePending.tryAcquire(socketWrapper.getTimeout(), 
TimeUnit.MILLISECONDS))
 synchronized (writeCompletionHandler) {
+checkError();
 if (writeNotify || writePending.tryAcquire()) {
 // No pending completion handler, so writing to the main 
buffer
 // is possible
@@ -1244,7 +1260,7 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint {
 // Remaining data must be buffered
 nonBlockingWriteBuffer.add(buf, off, len);
 }
-flushNonBlocking(true);
+flushNonBlockingInternal(true);
 } else {
 nonBlockingWriteBuffer.add(buf, off, len);
 }
@@ -1283,6 +1299,7 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint {
 // indicate the end of a write
 // Uses: if (writePending.tryAcquire(socketWrapper.getTimeout(), 
TimeUnit.MILLISECONDS))
 synchronized (writeCompletionHandler) {
+checkError();
 if (writeNotify || writePending.tryAcquire()) {
 // No pending completion handler, so writing to the main 
buffer
 // is possible
@@ -1292,7 +1309,7 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint {
 // Remaining data must be buffered
 nonBlockingWriteBuffer.add(from);
 }
-flushNonBlocking(true);
+flushNonBlockingInternal(true);
 } else {
 nonBlockingWriteBuffer.add(from);
 }
@@ -1357,11 +1374,11 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint {
 
 @Override
 protected boolean flushNonBlocking() throws IOException {
-return flushNonBlocking(false);
+checkError();
+return flushNonBlockingInternal(false);
 }
 
-private boolean flushNonBlocking(boolean hasPermit) throws IOException 
{
-checkError();
+private boolean flushNonBlockingInternal(boolean hasPermit) {
 synchronized (writeCompletionHandler) {
 if (writeNotify || hasPermit || writePending.tryAcquire()) {
 // The code that was notified is now writing its data


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