[tomcat] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


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

commit ad6c5db660f644751c6cded22d0f94b7ad193541
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, 20 insertions(+), 26 deletions(-)

diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index ea87346..5089456 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -300,19 +300,14 @@ 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);
 }
 
@@ -475,12 +470,8 @@ class Stream extends AbstractStream implements 
HeaderEmitter {
 }
 
 if (headerState == HEADER_STATE_TRAILER) {
-// 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
-coyoteRequest.getTrailerFields().put(name, value);
-}
+// HTTP/2 headers are already always lower case
+coyoteRequest.getTrailerFields().put(name, value);
 } else {
 coyoteRequest.getMimeHeaders().addValue(name).setString(value);
 }
@@ -656,14 +647,9 @@ 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;
 }
@@ -765,12 +751,15 @@ 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 ad9e1d2..f55163a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -176,6 +176,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)
+  
 
   
   



[tomcat] branch master updated: Revert "Simpler way to determine Graal runtime"

2020-07-22 Thread fhanik
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new cb5eaa3  Revert "Simpler way to determine Graal runtime"
cb5eaa3 is described below

commit cb5eaa3925bb4649a74a3872a9fda76fc9d102b1
Author: Filip Hanik 
AuthorDate: Wed Jul 22 11:43:43 2020 -0700

Revert "Simpler way to determine Graal runtime"

This reverts commit 098c4c81602ba1e8d5f33b0795d7caf55f70d573.

https://tomcat.markmail.org/search/?q=#query:%20list%3Aorg.apache.tomcat.dev+page:1+mid:7vo7ugmqjz2z7x5f+state:results
---
 java/org/apache/jasper/runtime/JspRuntimeLibrary.java | 16 +++-
 java/org/apache/naming/NamingContext.java | 15 ++-
 java/org/apache/tomcat/util/compat/GraalCompat.java   | 15 ++-
 3 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java 
b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
index f27ce3b..cfb6e75 100644
--- a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
+++ b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
@@ -56,7 +56,21 @@ import org.apache.tomcat.InstanceManager;
  */
 public class JspRuntimeLibrary {
 
-public static final boolean GRAAL = 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
+public static final boolean GRAAL;
+
+static {
+boolean result = false;
+try {
+Class nativeImageClazz = 
Class.forName("org.graalvm.nativeimage.ImageInfo");
+result = nativeImageClazz.getMethod("inImageCode").invoke(null) != 
null;
+// Note: This will also be true for the Graal substrate VM
+} catch (ClassNotFoundException e) {
+// Must be Graal
+} catch (ReflectiveOperationException | IllegalArgumentException e) {
+// Should never happen
+}
+GRAAL = result;
+}
 
 /**
  * Returns the value of the jakarta.servlet.error.exception request
diff --git a/java/org/apache/naming/NamingContext.java 
b/java/org/apache/naming/NamingContext.java
index 40f4085..0471279 100644
--- a/java/org/apache/naming/NamingContext.java
+++ b/java/org/apache/naming/NamingContext.java
@@ -792,7 +792,20 @@ public class NamingContext implements Context {
 // -- Protected Methods
 
 
-private static final boolean GRAAL = 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
+private static final boolean GRAAL;
+
+static {
+boolean result = false;
+try {
+Class nativeImageClazz = 
Class.forName("org.graalvm.nativeimage.ImageInfo");
+result = 
Boolean.TRUE.equals(nativeImageClazz.getMethod("inImageCode").invoke(null));
+} catch (ClassNotFoundException e) {
+// Must be Graal
+} catch (ReflectiveOperationException | IllegalArgumentException e) {
+// Should never happen
+}
+GRAAL = result;
+}
 
 /**
  * Retrieves the named object.
diff --git a/java/org/apache/tomcat/util/compat/GraalCompat.java 
b/java/org/apache/tomcat/util/compat/GraalCompat.java
index e3cb09d..9fb835a 100644
--- a/java/org/apache/tomcat/util/compat/GraalCompat.java
+++ b/java/org/apache/tomcat/util/compat/GraalCompat.java
@@ -20,7 +20,20 @@ import java.io.IOException;
 
 class GraalCompat extends Jre9Compat {
 
-private static final boolean GRAAL = 
System.getProperty("org.graalvm.nativeimage.imagecode") != null;
+private static final boolean GRAAL;
+
+static {
+boolean result = false;
+try {
+Class nativeImageClazz = 
Class.forName("org.graalvm.nativeimage.ImageInfo");
+result = 
Boolean.TRUE.equals(nativeImageClazz.getMethod("inImageCode").invoke(null));
+} catch (ClassNotFoundException e) {
+// Must be Graal
+} catch (ReflectiveOperationException | IllegalArgumentException e) {
+// Should never happen
+}
+GRAAL = result;
+}
 
 static boolean isSupported() {
 // This property does not exist for a native image


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



[tomcat] branch master updated: Revert "Update Hamcrest to 2.2"

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

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


The following commit(s) were added to refs/heads/master by this push:
 new e74d4d8  Revert "Update Hamcrest to 2.2"
e74d4d8 is described below

commit e74d4d85cc98675bfd47aa517d65de4883813c9a
Author: Martin Tzvetanov Grigorov 
AuthorDate: Tue Jun 9 10:19:21 2020 +0300

Revert "Update Hamcrest to 2.2"

This reverts commit d9434f7686667b87cce0aad5c1377551f90f79c0.

Revert temporarily the update because some tests have failed:

Testcase: initializationError took 0.001 sec
Caused an ERROR
org/hamcrest/SelfDescribing
java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
...
---
 build.properties.default | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/build.properties.default b/build.properties.default
index 5ff9cbe..19a2f0b 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -213,10 +213,10 @@ junit.jar=${junit.home}/junit-${junit.version}.jar
 
junit.loc=${base-maven.loc}/junit/junit/${junit.version}/junit-${junit.version}.jar
 
 # - Hamcrest Library, used by JUnit, version 1.3 or later 
-hamcrest.version=2.2
+hamcrest.version=1.3
 hamcrest.checksum.enabled=true
-hamcrest.checksum.algorithm=SHA-512
-hamcrest.checksum.value=e6c3f02e25070177f8101f9ca265046f8c9569f82560051dbfb1e6a28c9937b1a7453f68e9a37bfce0eb69bacf45a743d16e78add931e98195d260b8a516557e
+hamcrest.checksum.algorithm=MD5|SHA-1
+hamcrest.checksum.value=6393363b47ddcbba82321110c3e07519|42a25dc3219429f0e5d060061f71acb49bf010a0
 hamcrest.home=${base.path}/hamcrest-${hamcrest.version}
 hamcrest.jar=${hamcrest.home}/hamcrest-core-${hamcrest.version}.jar
 
hamcrest.loc=${base-maven.loc}/org/hamcrest/hamcrest-core/${hamcrest.version}/hamcrest-core-${hamcrest.version}.jar


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



[tomcat] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 43b10e3  Revert
43b10e3 is described below

commit 43b10e37e6eda920e764cc94cd0cd079e614f2ab
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 98a33e8..ab113a7 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);
 
@@ -612,7 +610,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");
 }
 }
 
@@ -630,7 +628,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(), connector.getAllowBackslash())) {
@@ -640,7 +638,7 @@ public class CoyoteAdapter implements Adapter {
 // Therefore it is not necessary to check that the URI remains
 // normalized after character decoding
 } 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 master updated: Revert unintended change

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 40fd644  Revert unintended change
40fd644 is described below

commit 40fd644b79644726a85f5ea5c70f382fc2847f36
Author: Mark Thomas 
AuthorDate: Thu Apr 30 21:10:23 2020 +0100

Revert unintended change
---
 webapps/docs/config/http.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index 2c5fea9..5e447e9 100644
--- a/webapps/docs/config/http.xml
+++ b/webapps/docs/config/http.xml
@@ -1607,9 +1607,9 @@
 
   
 
-Java Nio ConnectorNIO
-Java Nio2 ConnectorNIO2
-APR/native ConnectorAPR
+Java Nio ConnectorNIO
+Java Nio2 ConnectorNIO2
+APR/native ConnectorAPR
   
   
 Classname


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



[tomcat] branch master updated: Revert as relevant tests are already present in another class

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 47afb7c  Revert as relevant tests are already present in another class
47afb7c is described below

commit 47afb7cfe31922c57af0594a696dc5c38e3ea716
Author: remm 
AuthorDate: Thu Mar 19 18:33:52 2020 +0100

Revert as relevant tests are already present in another class
---
 .../coyote/http11/TestHttp11InputBuffer.java   | 45 --
 1 file changed, 45 deletions(-)

diff --git a/test/org/apache/coyote/http11/TestHttp11InputBuffer.java 
b/test/org/apache/coyote/http11/TestHttp11InputBuffer.java
index c9204a2..a1d50d0 100644
--- a/test/org/apache/coyote/http11/TestHttp11InputBuffer.java
+++ b/test/org/apache/coyote/http11/TestHttp11InputBuffer.java
@@ -17,15 +17,8 @@
 
 package org.apache.coyote.http11;
 
-import java.io.BufferedReader;
 import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
-import java.io.Writer;
-import java.net.Socket;
 import java.util.Enumeration;
 
 import jakarta.servlet.ServletException;
@@ -663,44 +656,6 @@ public class TestHttp11InputBuffer extends TomcatBaseTest {
 
 
 @Test
-public void testValidHttp09() throws Exception {
-
-Tomcat tomcat = getTomcatInstance();
-
-tomcat.addContext("", TEMP_DIR);
-tomcat.start();
-
-Socket socket = null;
-OutputStream os = null;
-InputStream is = null;
-BufferedReader reader = null;
-Writer writer = null;
-final String encoding = "ISO-8859-1";
-
-for (int i = 0; i < 10; i++) {
-socket = new Socket("localhost", getPort());
-os = socket.getOutputStream();
-writer = new OutputStreamWriter(os, encoding);
-writer.write("GET /");
-writer.flush();
-Thread.sleep(10);
-writer.write(CR);
-writer.flush();
-Thread.sleep(10);
-writer.write(LF);
-writer.flush();
-is = socket.getInputStream();
-reader = new BufferedReader(new InputStreamReader(is));
-String line = reader.readLine();
-Assert.assertNotNull(line);
-Assert.assertTrue(line.indexOf("404") != -1);
-socket.close();
-}
-
-}
-
-
-@Test
 public void testInvalidHttp09() {
 
 String[] request = new String[1];


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



[tomcat] branch master updated: Revert change to use a latch

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

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


The following commit(s) were added to refs/heads/master by this push:
 new b03fcaf  Revert change to use a latch
b03fcaf is described below

commit b03fcaf67a91b08e533c5bc0c460075201e6b22a
Author: remm 
AuthorDate: Mon Mar 9 21:22:32 2020 +0100

Revert change to use a latch
---
 java/org/apache/tomcat/util/net/NioEndpoint.java | 102 ++-
 webapps/docs/changelog.xml   |   7 --
 2 files changed, 63 insertions(+), 46 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index 2019680..bbcf4ca 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -722,8 +722,11 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 if 
(!socketWrapper.readOperation.process()) {
 closeSocket = true;
 }
-} else if (socketWrapper.readBlock != null) {
-socketWrapper.readBlock.countDown();
+} else if (socketWrapper.readBlocking) {
+synchronized (socketWrapper.readLock) {
+socketWrapper.readBlocking = false;
+socketWrapper.readLock.notify();
+}
 } else if (!processSocket(socketWrapper, 
SocketEvent.OPEN_READ, true)) {
 closeSocket = true;
 }
@@ -733,8 +736,11 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 if 
(!socketWrapper.writeOperation.process()) {
 closeSocket = true;
 }
-} else if (socketWrapper.writeBlock != null) {
-socketWrapper.writeBlock.countDown();
+} else if (socketWrapper.writeBlocking) {
+synchronized (socketWrapper.writeLock) {
+socketWrapper.writeBlocking = false;
+socketWrapper.writeLock.notify();
+}
 } else if (!processSocket(socketWrapper, 
SocketEvent.OPEN_WRITE, true)) {
 closeSocket = true;
 }
@@ -975,14 +981,18 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 private volatile long lastRead = System.currentTimeMillis();
 private volatile long lastWrite = lastRead;
 
-private CountDownLatch readBlock;
-private CountDownLatch writeBlock;
+private final Object readLock;
+private volatile boolean readBlocking = false;
+private final Object writeLock;
+private volatile boolean writeBlocking = false;
 
 public NioSocketWrapper(NioChannel channel, NioEndpoint endpoint) {
 super(channel, endpoint);
 nioChannels = endpoint.getNioChannels();
 poller = endpoint.getPoller();
 socketBufferHandler = channel.getBufHandler();
+readLock = (readPending == null) ? new Object() : readPending;
+writeLock = (writePending == null) ? new Object() : writePending;
 }
 
 public Poller getPoller() { return poller; }
@@ -1139,23 +1149,30 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 if (block && nRead == 0) {
 long timeout = getReadTimeout();
 try {
-readBlock = new CountDownLatch(1);
+readBlocking = true;
 registerReadInterest();
-if (timeout > 0) {
-if (!readBlock.await(timeout, TimeUnit.MILLISECONDS)) {
-throw new SocketTimeoutException();
+synchronized (readLock) {
+if (readBlocking) {
+try {
+if (timeout > 0) {
+readLock.wait(timeout);
+} else {
+readLock.wait();
+}
+} catch (InterruptedException e) {
+// Continue ...
+}
+if (readBlocking) {
+throw new SocketTimeoutException();
+}

[tomcat] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 9f1e1fa  Revert "Check for non-null 'methods'"
9f1e1fa is described below

commit 9f1e1fa3744cbb69b18536a8717da3311c40685c
Author: Martin Tzvetanov Grigorov 
AuthorDate: Thu Feb 20 13:25:43 2020 +0200

Revert "Check for non-null 'methods'"

This reverts commit 9ff6b12c3d7c99b4efc05a686f53e46aa24ad8a1.
---
 java/jakarta/servlet/http/HttpServlet.java | 44 ++
 1 file changed, 21 insertions(+), 23 deletions(-)

diff --git a/java/jakarta/servlet/http/HttpServlet.java 
b/java/jakarta/servlet/http/HttpServlet.java
index 6b9091b..56b4ce1 100644
--- a/java/jakarta/servlet/http/HttpServlet.java
+++ b/java/jakarta/servlet/http/HttpServlet.java
@@ -443,31 +443,29 @@ public abstract class HttpServlet extends GenericServlet {
 boolean allowPut = false;
 boolean allowDelete = false;
 
-if (methods != null) {
-for (final Method method : methods) {
-switch (method.getName()) {
-case "doGet": {
-allowGet = true;
-allowHead = true;
-break;
-}
-case "doPost": {
-allowPost = true;
-break;
-}
-case "doPut": {
-allowPut = true;
-break;
-}
-case "doDelete": {
-allowDelete = true;
-break;
-}
-default:
-// NO-OP
+for (int i = 0; i < methods.length; i++) {
+switch (methods[i].getName()) {
+case "doGet": {
+allowGet = true;
+allowHead = true;
+break;
 }
-
+case "doPost": {
+allowPost = true;
+break;
+}
+case "doPut": {
+allowPut = true;
+break;
+}
+case "doDelete": {
+allowDelete = true;
+break;
+}
+default:
+// NO-OP
 }
+
 }
 
 StringBuilder allow = new StringBuilder();


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



[tomcat] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new fba885d  Revert the fix for 
https://bz.apache.org/bugzilla/show_bug.cgi?id=63815
fba885d is described below

commit fba885db6191d60224f9621449dd5f036988c777
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" 

[tomcat] branch master updated: Revert debugging changes for testing BZ 63682

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 3aa05ba  Revert debugging changes for testing BZ 63682
3aa05ba is described below

commit 3aa05baa6b9cd3c907ecd55e1ebb340d8c9689ab
Author: Mark Thomas 
AuthorDate: Fri Sep 13 16:48:04 2019 +0100

Revert debugging changes for testing BZ 63682
---
 .../coyote/http2/WindowAllocationManager.java  | 42 +++---
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/java/org/apache/coyote/http2/WindowAllocationManager.java 
b/java/org/apache/coyote/http2/WindowAllocationManager.java
index ee865b0..f286430 100644
--- a/java/org/apache/coyote/http2/WindowAllocationManager.java
+++ b/java/org/apache/coyote/http2/WindowAllocationManager.java
@@ -65,40 +65,40 @@ class WindowAllocationManager {
 }
 
 void waitForStream(long timeout) throws InterruptedException {
-//if (log.isDebugEnabled()) {
-log.info(sm.getString("windowAllocationManager.waitFor.stream",
+if (log.isDebugEnabled()) {
+log.debug(sm.getString("windowAllocationManager.waitFor.stream",
 stream.getConnectionId(), stream.getIdentifier(), 
Long.toString(timeout)));
-//}
+}
 
 waitFor(STREAM, timeout);
 }
 
 
 void waitForConnection(long timeout) throws InterruptedException {
-//if (log.isDebugEnabled()) {
-log.info(sm.getString("windowAllocationManager.waitFor.connection",
+if (log.isDebugEnabled()) {
+
log.debug(sm.getString("windowAllocationManager.waitFor.connection",
 stream.getConnectionId(), stream.getIdentifier(), 
Long.toString(timeout)));
-//}
+}
 
 waitFor(CONNECTION, timeout);
 }
 
 
 void waitForStreamNonBlocking() {
-//if (log.isDebugEnabled()) {
-
log.info(sm.getString("windowAllocationManager.waitForNonBlocking.stream",
+if (log.isDebugEnabled()) {
+
log.debug(sm.getString("windowAllocationManager.waitForNonBlocking.stream",
 stream.getConnectionId(), stream.getIdentifier()));
-//}
+}
 
 waitForNonBlocking(STREAM);
 }
 
 
 void waitForConnectionNonBlocking() {
-//if (log.isDebugEnabled()) {
-
log.info(sm.getString("windowAllocationManager.waitForNonBlocking.connection",
+if (log.isDebugEnabled()) {
+
log.debug(sm.getString("windowAllocationManager.waitForNonBlocking.connection",
 stream.getConnectionId(), stream.getIdentifier()));
-//}
+}
 
 waitForNonBlocking(CONNECTION);
 }
@@ -171,10 +171,10 @@ class WindowAllocationManager {
 
 
 private void notify(int notifyTarget) {
-//if (log.isDebugEnabled()) {
-log.info(sm.getString("windowAllocationManager.notify", 
stream.getConnectionId(),
+if (log.isDebugEnabled()) {
+log.debug(sm.getString("windowAllocationManager.notify", 
stream.getConnectionId(),
 stream.getIdentifier(), Integer.toString(waitingFor), 
Integer.toString(notifyTarget)));
-//}
+}
 
 synchronized (stream) {
 if ((notifyTarget & waitingFor) > NONE) {
@@ -186,17 +186,17 @@ class WindowAllocationManager {
 waitingFor = NONE;
 if (stream.getCoyoteResponse().getWriteListener() == null) {
 // Blocking, so use notify to release StreamOutputBuffer
-//if (log.isDebugEnabled()) {
-
log.info(sm.getString("windowAllocationManager.notified",
+if (log.isDebugEnabled()) {
+
log.debug(sm.getString("windowAllocationManager.notified",
 stream.getConnectionId(), 
stream.getIdentifier()));
-//}
+}
 stream.notify();
 } else {
 // Non-blocking so dispatch
-//if (log.isDebugEnabled()) {
-
log.info(sm.getString("windowAllocationManager.dispatched",
+if (log.isDebugEnabled()) {
+
log.debug(sm.getString("windowAllocationManager.dispatched",
 stream.getConnectionId(), 
stream.getIdentifier()));
-//}
+}
 
stream.getCoyoteResponse().action(ActionCode.DISPATCH_WRITE, null);
 // Need to explicitly execute dispatches on the 
StreamProcessor
 // as this thread is being processed by an UpgradeProcessor


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

[tomcat] branch master updated: Revert ISE fix after review

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 628ab62  Revert ISE fix after review
628ab62 is described below

commit 628ab627bd23edea5e80ff5b01958e9bfd4e16fa
Author: remm 
AuthorDate: Tue Jun 4 13:14:21 2019 +0200

Revert ISE fix after review
---
 .../coyote/http2/WindowAllocationManager.java  | 25 ++
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/java/org/apache/coyote/http2/WindowAllocationManager.java 
b/java/org/apache/coyote/http2/WindowAllocationManager.java
index 3ddd742..56acab9 100644
--- a/java/org/apache/coyote/http2/WindowAllocationManager.java
+++ b/java/org/apache/coyote/http2/WindowAllocationManager.java
@@ -146,12 +146,11 @@ class WindowAllocationManager {
 } else if (waitingFor == waitTarget) {
 // NO-OP
 // Non-blocking post-processing may attempt to flush
-} else if ((waitTarget & waitingFor) == NONE) {
-waitingFor |= waitTarget;
 } else {
 throw new 
IllegalStateException(sm.getString("windowAllocationManager.waitFor.ise",
 stream.getConnectionId(), stream.getIdentifier()));
 }
+
 }
 }
 
@@ -172,19 +171,17 @@ class WindowAllocationManager {
 }
 stream.notify();
 } else {
-waitingFor &= ~notifyTarget;
-if (waitingFor == NONE) {
-// Non-blocking so dispatch
-if (log.isDebugEnabled()) {
-
log.debug(sm.getString("windowAllocationManager.dispatched",
-stream.getConnectionId(), 
stream.getIdentifier()));
-}
-
stream.getCoyoteResponse().action(ActionCode.DISPATCH_WRITE, null);
-// Need to explicitly execute dispatches on the 
StreamProcessor
-// as this thread is being processed by an 
UpgradeProcessor
-// which won't see this dispatch
-
stream.getCoyoteResponse().action(ActionCode.DISPATCH_EXECUTE, null);
+waitingFor = NONE;
+// Non-blocking so dispatch
+if (log.isDebugEnabled()) {
+
log.debug(sm.getString("windowAllocationManager.dispatched",
+stream.getConnectionId(), 
stream.getIdentifier()));
 }
+
stream.getCoyoteResponse().action(ActionCode.DISPATCH_WRITE, null);
+// Need to explicitly execute dispatches on the 
StreamProcessor
+// as this thread is being processed by an UpgradeProcessor
+// which won't see this dispatch
+
stream.getCoyoteResponse().action(ActionCode.DISPATCH_EXECUTE, null);
 }
 }
 }


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



[tomcat] branch master updated: Revert "Use https instead of http" :(

2019-05-21 Thread csutherl
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 4ef8148  Revert "Use https instead of http" :(
4ef8148 is described below

commit 4ef814827cbb1401a324b4785f0e80bae8656103
Author: Coty Sutherland 
AuthorDate: Tue May 21 08:13:10 2019 -0400

Revert "Use https instead of http" :(

This reverts commit beb2dca83bb4084432fd3b44e06973730ad4dc7d.
---
 build.properties.default | 10 +-
 build.xml|  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/build.properties.default b/build.properties.default
index cc217b6..1bacc19 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -90,7 +90,7 @@ compile.debug=true
 # Do not pass -deprecation (-Xlint:deprecation) flag to javac
 compile.deprecation=false
 
-base-apache.loc.1=https://www.apache.org/dyn/closer.lua?action=download=
+base-apache.loc.1=http://www.apache.org/dyn/closer.lua?action=download=
 base-apache.loc.2=https://archive.apache.org/dist
 base-commons.loc.1=${base-apache.loc.1}/commons
 base-commons.loc.2=${base-apache.loc.2}/commons
@@ -126,8 +126,8 @@ 
wsdl4j-lib.loc=${base-maven.loc}/wsdl4j/wsdl4j/${wsdl4j-lib.version}/wsdl4j-${ws
 # See https://wiki.apache.org/tomcat/JDTCoreBatchCompiler before updating
 #
 # Checksum is from "SHA512 Checksums for 4.10" link at
-# https://download.eclipse.org/eclipse/downloads/drops4/R-4.10-201812060815/
-# 
https://download.eclipse.org/eclipse/downloads/drops4/R-4.10-201812060815/checksum/eclipse-4.10-SUMSSHA512
+# http://download.eclipse.org/eclipse/downloads/drops4/R-4.10-201812060815/
+# 
http://download.eclipse.org/eclipse/downloads/drops4/R-4.10-201812060815/checksum/eclipse-4.10-SUMSSHA512
 #
 jdt.version=4.10
 jdt.release=R-4.10-201812060815
@@ -137,8 +137,8 @@ 
jdt.checksum.value=6528d1933d752f909e61456f1a3cbb3ae3999d263701a459e6f4fc33f97f7
 jdt.home=${base.path}/ecj-${jdt.version}
 jdt.jar=${jdt.home}/ecj-${jdt.version}.jar
 # The download will be moved to the archive area eventually. We are taking 
care of that in advance.
-jdt.loc.1=https://archive.eclipse.org/eclipse/downloads/drops4/${jdt.release}/ecj-${jdt.version}.jar
-jdt.loc.2=https://download.eclipse.org/eclipse/downloads/drops4/${jdt.release}/ecj-${jdt.version}.jar
+jdt.loc.1=http://archive.eclipse.org/eclipse/downloads/drops4/${jdt.release}/ecj-${jdt.version}.jar
+jdt.loc.2=http://download.eclipse.org/eclipse/downloads/drops4/${jdt.release}/ecj-${jdt.version}.jar
 
 # - Tomcat native library -
 tomcat-native.version=1.2.21
diff --git a/build.xml b/build.xml
index 4d76077..6e91e91 100644
--- a/build.xml
+++ b/build.xml
@@ -1971,7 +1971,7 @@ Apache Tomcat ${version} native binaries for Win64 
AMD64/EMT64 platform.
   
   
   
-  https://docs.oracle.com/javase/8/docs/api/"/>
+  http://docs.oracle.com/javase/8/docs/api/"/>
   https://commons.apache.org/proper/commons-io/javadocs/api-release/"/>
   https://javaee.github.io/javaee-spec/javadocs/"/>
   


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



[tomcat] branch master updated: Revert as not directly related

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

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


The following commit(s) were added to refs/heads/master by this push:
 new c198ccc  Revert as not directly related
c198ccc is described below

commit c198ccc3cb2a9f098fb644779148fda103088275
Author: remm 
AuthorDate: Sun May 5 11:54:23 2019 +0200

Revert as not directly related
---
 test/org/apache/coyote/http2/Http2TestBase.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/coyote/http2/Http2TestBase.java 
b/test/org/apache/coyote/http2/Http2TestBase.java
index e4ff857..3a0c8d9 100644
--- a/test/org/apache/coyote/http2/Http2TestBase.java
+++ b/test/org/apache/coyote/http2/Http2TestBase.java
@@ -540,7 +540,7 @@ public abstract class Http2TestBase extends TomcatBaseTest {
 http2Protocol.setWriteTimeout(2000);
 http2Protocol.setKeepAliveTimeout(5000);
 http2Protocol.setStreamReadTimeout(1000);
-http2Protocol.setStreamWriteTimeout(1500);
+http2Protocol.setStreamWriteTimeout(1000);
 http2Protocol.setMaxConcurrentStreams(maxConcurrentStreams);
 connector.addUpgradeProtocol(http2Protocol);
 }


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



[tomcat] branch master updated: Revert processing change

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

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


The following commit(s) were added to refs/heads/master by this push:
 new c3c6686  Revert processing change
c3c6686 is described below

commit c3c66860b8e994584bdfb7dd62c219f53967792e
Author: remm 
AuthorDate: Tue Apr 16 10:03:02 2019 +0200

Revert processing change

The close refactoring is enough to ensure connections are properly
closed.
---
 java/org/apache/coyote/http2/Http2AsyncParser.java | 8 +---
 java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2AsyncParser.java 
b/java/org/apache/coyote/http2/Http2AsyncParser.java
index 448f3ce..2c764f8 100644
--- a/java/org/apache/coyote/http2/Http2AsyncParser.java
+++ b/java/org/apache/coyote/http2/Http2AsyncParser.java
@@ -31,14 +31,16 @@ import 
org.apache.tomcat.util.net.SocketWrapperBase.CompletionState;
 class Http2AsyncParser extends Http2Parser {
 
 private final SocketWrapperBase socketWrapper;
+private final Http2AsyncUpgradeHandler upgradeHandler;
 private Throwable error = null;
 private final ByteBuffer header;
 private final ByteBuffer framePaylod;
 
-Http2AsyncParser(String connectionId, Input input, Output output, 
SocketWrapperBase socketWrapper) {
+Http2AsyncParser(String connectionId, Input input, Output output, 
SocketWrapperBase socketWrapper, Http2AsyncUpgradeHandler upgradeHandler) {
 super(connectionId, input, output);
 this.socketWrapper = socketWrapper;
 socketWrapper.getSocketBufferHandler().expand(input.getMaxFrameSize());
+this.upgradeHandler = upgradeHandler;
 header = ByteBuffer.allocate(9);
 framePaylod = ByteBuffer.allocate(input.getMaxFrameSize());
 }
@@ -226,7 +228,7 @@ class Http2AsyncParser extends Http2Parser {
 if (state == CompletionState.DONE) {
 // The call was not completed inline, so must start reading 
new frames
 // or process the stream exception
-socketWrapper.processSocket(SocketEvent.OPEN_READ, false);
+upgradeHandler.upgradeDispatch(SocketEvent.OPEN_READ);
 }
 }
 
@@ -238,7 +240,7 @@ class Http2AsyncParser extends Http2Parser {
 log.debug(sm.getString("http2Parser.error", connectionId, 
Integer.valueOf(streamId), frameType), e);
 }
 if (state == null || state == CompletionState.DONE) {
-socketWrapper.processSocket(SocketEvent.ERROR, true);
+upgradeHandler.upgradeDispatch(SocketEvent.ERROR);
 }
 }
 
diff --git a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
index de80eb1..f4559a3 100644
--- a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
@@ -69,7 +69,7 @@ public class Http2AsyncUpgradeHandler extends 
Http2UpgradeHandler {
 
 @Override
 protected Http2Parser getParser(String connectionId) {
-return new Http2AsyncParser(connectionId, this, this, socketWrapper);
+return new Http2AsyncParser(connectionId, this, this, socketWrapper, 
this);
 }
 
 


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



[tomcat] branch master updated: Revert change as the issue seems different, despite similarities

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 284a540  Revert change as the issue seems different, despite 
similarities
284a540 is described below

commit 284a540aa73824529e931751bb4815c89ae1768a
Author: remm 
AuthorDate: Mon Apr 15 13:35:39 2019 +0200

Revert change as the issue seems different, despite similarities
---
 java/org/apache/coyote/http2/Http2Parser.java | 4 ++--
 test/org/apache/coyote/http2/TestStream.java  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2Parser.java 
b/java/org/apache/coyote/http2/Http2Parser.java
index 967175f..f5e1986 100644
--- a/java/org/apache/coyote/http2/Http2Parser.java
+++ b/java/org/apache/coyote/http2/Http2Parser.java
@@ -580,13 +580,13 @@ class Http2Parser {
 // going to be thrown.
 hpackDecoder.getHeaderEmitter().validateHeaders();
 
+output.headersEnd(streamId);
+
 if (headersEndStream) {
 output.receivedEndOfStream(streamId);
 headersEndStream = false;
 }
 
-output.headersEnd(streamId);
-
 // Reset size for new request if the buffer was previously expanded
 if (headerReadBuffer.capacity() > 
Constants.DEFAULT_HEADER_READ_BUFFER_SIZE) {
 headerReadBuffer = 
ByteBuffer.allocate(Constants.DEFAULT_HEADER_READ_BUFFER_SIZE);
diff --git a/test/org/apache/coyote/http2/TestStream.java 
b/test/org/apache/coyote/http2/TestStream.java
index 0afaebc..2d03035 100644
--- a/test/org/apache/coyote/http2/TestStream.java
+++ b/test/org/apache/coyote/http2/TestStream.java
@@ -121,8 +121,8 @@ public class TestStream extends Http2TestBase {
 "3-HeadersStart\n" +
 "3-Header-[x-trailer-2]-[Trailer value two]\n" +
 "3-Header-[x-trailer-1]-[Trailer value one]\n" +
-"3-EndOfStream\n" +
-"3-HeadersEnd\n", output.getTrace());
+"3-HeadersEnd\n" +
+"3-EndOfStream\n", output.getTrace());
 }
 
 


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



[tomcat] branch master updated: Revert workaround to what looks like a ContextConfig bug around docBase

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 765e0bd  Revert workaround to what looks like a ContextConfig bug 
around docBase
765e0bd is described below

commit 765e0bdbb5c082ad1ff31b349f43796aad08efae
Author: Mark Thomas 
AuthorDate: Fri Apr 12 16:51:26 2019 +0100

Revert workaround to what looks like a ContextConfig bug around docBase
---
 .../org/apache/catalina/webresources/TestAbstractArchiveResource.java | 4 ++--
 test/org/apache/catalina/webresources/TestFileResource.java   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java 
b/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java
index e573d91..9c59fd8 100644
--- a/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java
+++ b/test/org/apache/catalina/webresources/TestAbstractArchiveResource.java
@@ -48,7 +48,7 @@ public class TestAbstractArchiveResource extends 
TomcatBaseTest {
 
expectedURL.append(docBase.getCanonicalFile().toURI().toURL().toString());
 
expectedURL.append("*/WEB-INF/lib/test.jar!/META-INF/resources/index.html");
 
-
Assert.assertTrue(expectedURL.toString().equalsIgnoreCase(webResource.getURL().toString()));
+Assert.assertEquals(expectedURL.toString(), 
webResource.getURL().toString());
 }
 
 
@@ -71,7 +71,7 @@ public class TestAbstractArchiveResource extends 
TomcatBaseTest {
 
expectedURL.append(docBase.getCanonicalFile().toURI().toURL().toString());
 expectedURL.append("WEB-INF/lib/test-lib.jar!/META-INF/tags/echo.tag");
 
-
Assert.assertTrue(expectedURL.toString().equalsIgnoreCase(webResource.getURL().toString()));
+Assert.assertEquals(expectedURL.toString(), 
webResource.getURL().toString());
 }
 
 }
diff --git a/test/org/apache/catalina/webresources/TestFileResource.java 
b/test/org/apache/catalina/webresources/TestFileResource.java
index 2bd7ef3..315212a 100644
--- a/test/org/apache/catalina/webresources/TestFileResource.java
+++ b/test/org/apache/catalina/webresources/TestFileResource.java
@@ -40,6 +40,6 @@ public class TestFileResource extends TomcatBaseTest {
 
 // Build the expected location the same way the webapp base dir is 
built
 File f = new File("test/webapp/WEB-INF/classes");
-
Assert.assertTrue(f.getCanonicalFile().toURI().toURL().toString().equalsIgnoreCase(out.toString().trim()));
+Assert.assertEquals(f.getCanonicalFile().toURI().toURL().toString(), 
out.toString().trim());
 }
 }


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



[tomcat] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 4ee72e6  Revert to the previous revision
4ee72e6 is described below

commit 4ee72e6512e7442de9c9fdfd3e17c207e42bec37
Author: remm 
AuthorDate: Wed Mar 27 17:50:10 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 3397e18..b27ca4e 100644
--- a/java/org/apache/tomcat/util/net/Nio2Endpoint.java
+++ b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
@@ -744,7 +744,22 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint

[tomcat] branch master updated: Revert log level back to normal

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 8b15d85  Revert log level back to normal
8b15d85 is described below

commit 8b15d85dd759c47fdcc86a1d9bdf839f64629f40
Author: remm 
AuthorDate: Tue Mar 12 09:55:53 2019 +0100

Revert log level back to normal
---
 conf/logging.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/conf/logging.properties b/conf/logging.properties
index fc52083..e8b7b16 100644
--- a/conf/logging.properties
+++ b/conf/logging.properties
@@ -73,7 +73,7 @@ 
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].ha
 #org.apache.jasper.compiler.TldLocationsCache.level = FINE
 
 # To see debug messages for HTTP/2 handling, uncomment the following line:
-org.apache.coyote.http2.level = FINE
+#org.apache.coyote.http2.level = FINE
 
 # To see debug messages for WebSocket handling, uncomment the following line:
 #org.apache.tomcat.websocket.level = FINE


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



[tomcat] branch master updated: Revert again for now

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 23d554f  Revert again for now
23d554f is described below

commit 23d554fa045ee5d980b2919b34bf77c0da4d4f15
Author: remm 
AuthorDate: Fri Mar 1 11:28:52 2019 +0100

Revert again for now
---
 java/org/apache/tomcat/util/net/Nio2Endpoint.java | 77 +--
 1 file changed, 30 insertions(+), 47 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/Nio2Endpoint.java 
b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
index 982dd44..b1dbb7c 100644
--- a/java/org/apache/tomcat/util/net/Nio2Endpoint.java
+++ b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
@@ -476,7 +476,6 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint 
readCompletionHandler;
 private final Semaphore readPending = new Semaphore(1);
 private boolean readInterest = false; // Guarded by 
readCompletionHandler
-private boolean readNotify = false;
 
 private final CompletionHandler 
writeCompletionHandler;
 private final CompletionHandler 
gatheringWriteCompletionHandler;
@@ -494,7 +493,6 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint() {
 @Override
 public void completed(Integer nBytes, ByteBuffer attachment) {
+boolean readNotify = false;
 if (log.isDebugEnabled()) {
 log.debug("Socket: [" + Nio2SocketWrapper.this + "], 
Interest: [" + readInterest + "]");
 }
-readNotify = false;
 synchronized (readCompletionHandler) {
 if (nBytes.intValue() < 0) {
 failed(new EOFException(), attachment);
@@ -744,10 +742,6 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint 0) {
-if (readNotify) {
-// The code that was notified is now reading its data
-readNotify = false;
-}
 // This may be sufficient to complete the request and we
 // don't want to trigger another read since if there is no
 // more data to read and this request takes a while to
@@ -822,7 +810,7 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint 0) {
-if (readNotify) {
-// The code that was notified is now reading its data
-readNotify = false;
-}
 // This may be sufficient to complete the request and we
 // don't want to trigger another read since if there is no
 // more data to read and this request takes a while to
@@ -891,7 +873,7 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint 0) {
 nRead = populateReadBuffer(to);
-} else if (nRead == 0 && !block) {
+} else if (nRead == 0 && !block && 
ContainerThreadMarker.isContainerThread()) {
 readInterest = true;
 }
 }
@@ -1494,10 +1476,6 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint