buildbot success in on tomcat-trunk

2019-09-05 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/4577

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] 138d4edba9aa59d0d9987391445a64ada33cc6b9
Blamelist: Mark Thomas 

Build succeeded!

Sincerely,
 -The Buildbot




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



[Bug 63724] Compile JSP to class when using Tiles and custom tag fails

2019-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63724

Mark Thomas  changed:

   What|Removed |Added

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

--- Comment #7 from Mark Thomas  ---
Thanks for the test case. It made it much easier to be sure that the issue was
fixed.

Fixed in:
- master for 9.0.25 onwards

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



[tomcat] branch master updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63724

2019-09-05 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 138d4ed  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63724
138d4ed is described below

commit 138d4edba9aa59d0d9987391445a64ada33cc6b9
Author: Mark Thomas 
AuthorDate: Thu Sep 5 19:36:42 2019 +0100

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63724

Correct a regression introduced in 9.0.21 that broke compilation of JSPs
in some configurations.
---
 java/org/apache/jasper/compiler/JspUtil.java   |  4 +-
 .../compiler/TestJspUtilMakeJavaPackage.java   | 63 ++
 webapps/docs/changelog.xml |  8 +++
 3 files changed, 73 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/jasper/compiler/JspUtil.java 
b/java/org/apache/jasper/compiler/JspUtil.java
index 96bd538..a82fdc6 100644
--- a/java/org/apache/jasper/compiler/JspUtil.java
+++ b/java/org/apache/jasper/compiler/JspUtil.java
@@ -742,8 +742,8 @@ public class JspUtil {
 String classNameComponents[] = path.split("/");
 StringBuilder legalClassNames = new StringBuilder();
 for (int i = 0; i < classNameComponents.length; i++) {
-if(0 < classNameComponents[i].length()) {
-if(0 < i) {
+if (classNameComponents[i].length() > 0) {
+if (legalClassNames.length() > 0) {
 legalClassNames.append('.');
 }
 
legalClassNames.append(makeJavaIdentifier(classNameComponents[i]));
diff --git a/test/org/apache/jasper/compiler/TestJspUtilMakeJavaPackage.java 
b/test/org/apache/jasper/compiler/TestJspUtilMakeJavaPackage.java
new file mode 100644
index 000..c02837f
--- /dev/null
+++ b/test/org/apache/jasper/compiler/TestJspUtilMakeJavaPackage.java
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+package org.apache.jasper.compiler;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+
+@RunWith(Parameterized.class)
+public class TestJspUtilMakeJavaPackage {
+
+@Parameterized.Parameters(name = "{index}: input[{0}], expected [{1}]")
+public static Collection parameters() {
+List parameterSets = new ArrayList<>();
+
+parameterSets.add(new Object[] { "/foo", "foo"});
+parameterSets.add(new Object[] { "//foo", "foo"});
+parameterSets.add(new Object[] { "//foo//", "foo"});
+parameterSets.add(new Object[] { "/foo//", "foo"});
+parameterSets.add(new Object[] { "/foo/", "foo"});
+parameterSets.add(new Object[] { "foo/", "foo"});
+
+parameterSets.add(new Object[] { "/foo/bar", "foo.bar"});
+parameterSets.add(new Object[] { "//foo/bar", "foo.bar"});
+parameterSets.add(new Object[] { "//foo//bar", "foo.bar"});
+parameterSets.add(new Object[] { "/foo//bar", "foo.bar"});
+parameterSets.add(new Object[] { "/foo/bar", "foo.bar"});
+parameterSets.add(new Object[] { "foo/bar", "foo.bar"});
+
+return parameterSets;
+}
+
+@Parameter(0)
+public String input;
+
+@Parameter(1)
+public String expected;
+
+@Test
+public void doTest() {
+Assert.assertEquals(expected, JspUtil.makeJavaPackage(input));
+}
+}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 99504d0..36581f5 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -83,6 +83,14 @@
   
 
   
+  
+
+  
+63724: Correct a regression introduced in 9.0.21 that broke
+compilation of JSPs in some configurations. (markt)
+  
+
+  
   
 
   


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



buildbot success in on tomcat-85-trunk

2019-09-05 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-85-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-85-trunk/builds/1915

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-85-commit' 
triggered this build
Build Source Stamp: [branch 8.5.x] b297676fcd34dcf494a7d2a1de12f88a0cc9bc48
Blamelist: Mark Thomas 

Build succeeded!

Sincerely,
 -The Buildbot




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



[tomcat] branch 8.5.x updated: Fix NPEs in tests. Align with 9.0.x.

2019-09-05 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 b297676  Fix NPEs in tests. Align with 9.0.x.
b297676 is described below

commit b297676fcd34dcf494a7d2a1de12f88a0cc9bc48
Author: Mark Thomas 
AuthorDate: Thu Sep 5 16:38:06 2019 +0100

Fix NPEs in tests. Align with 9.0.x.
---
 test/org/apache/coyote/http2/TestAbstractStream.java | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/test/org/apache/coyote/http2/TestAbstractStream.java 
b/test/org/apache/coyote/http2/TestAbstractStream.java
index 30b9258..9a44868 100644
--- a/test/org/apache/coyote/http2/TestAbstractStream.java
+++ b/test/org/apache/coyote/http2/TestAbstractStream.java
@@ -28,7 +28,7 @@ public class TestAbstractStream {
 @Test
 public void testDependenciesFig3() {
 // Setup
-Http2UpgradeHandler handler = new Http2UpgradeHandler(null, null, 
null);
+Http2UpgradeHandler handler = new Http2UpgradeHandler(new 
Http2Protocol(), null, null);
 Stream a = new Stream(Integer.valueOf(1), handler);
 Stream b = new Stream(Integer.valueOf(2), handler);
 Stream c = new Stream(Integer.valueOf(3), handler);
@@ -59,7 +59,7 @@ public class TestAbstractStream {
 @Test
 public void testDependenciesFig4() {
 // Setup
-Http2UpgradeHandler handler = new Http2UpgradeHandler(null, null, 
null);
+Http2UpgradeHandler handler = new Http2UpgradeHandler(new 
Http2Protocol(), null, null);
 Stream a = new Stream(Integer.valueOf(1), handler);
 Stream b = new Stream(Integer.valueOf(2), handler);
 Stream c = new Stream(Integer.valueOf(3), handler);
@@ -90,7 +90,7 @@ public class TestAbstractStream {
 @Test
 public void testDependenciesFig5NonExclusive() {
 // Setup
-Http2UpgradeHandler handler = new Http2UpgradeHandler(null, null, 
null);
+Http2UpgradeHandler handler = new Http2UpgradeHandler(new 
Http2Protocol(), null, null);
 Stream a = new Stream(Integer.valueOf(1), handler);
 Stream b = new Stream(Integer.valueOf(2), handler);
 Stream c = new Stream(Integer.valueOf(3), handler);
@@ -132,7 +132,7 @@ public class TestAbstractStream {
 @Test
 public void testDependenciesFig5Exclusive() {
 // Setup
-Http2UpgradeHandler handler = new Http2UpgradeHandler(null, null, 
null);
+Http2UpgradeHandler handler = new Http2UpgradeHandler(new 
Http2Protocol(), null, null);
 Stream a = new Stream(Integer.valueOf(1), handler);
 Stream b = new Stream(Integer.valueOf(2), handler);
 Stream c = new Stream(Integer.valueOf(3), handler);
@@ -174,7 +174,7 @@ public class TestAbstractStream {
 @Test
 public void testCircular01() {
 // Setup
-Http2UpgradeHandler handler = new Http2UpgradeHandler(null, null, 
null);
+Http2UpgradeHandler handler = new Http2UpgradeHandler(new 
Http2Protocol(), null, null);
 Stream a = new Stream(Integer.valueOf(1), handler);
 Stream b = new Stream(Integer.valueOf(2), handler);
 Stream c = new Stream(Integer.valueOf(3), handler);
@@ -204,7 +204,7 @@ public class TestAbstractStream {
 @Test
 public void testCircular02() {
 // Setup
-Http2UpgradeHandler handler = new Http2UpgradeHandler(null, null, 
null);
+Http2UpgradeHandler handler = new Http2UpgradeHandler(new 
Http2Protocol(), null, null);
 Stream a = new Stream(Integer.valueOf(1), handler);
 Stream b = new Stream(Integer.valueOf(2), handler);
 Stream c = new Stream(Integer.valueOf(3), handler);
@@ -250,7 +250,7 @@ public class TestAbstractStream {
 @Test
 public void testCircular03() {
 // Setup
-Http2UpgradeHandler handler = new Http2UpgradeHandler(null, null, 
null);
+Http2UpgradeHandler handler = new Http2UpgradeHandler(new 
Http2Protocol(), null, null);
 Stream a = new Stream(Integer.valueOf(1), handler);
 Stream b = new Stream(Integer.valueOf(3), handler);
 Stream c = new Stream(Integer.valueOf(5), handler);
@@ -270,7 +270,7 @@ public class TestAbstractStream {
 Assert.assertEquals(b, d.getParentStream());
 
 // This triggers the StackOverflowError
-c.isDescendant(d);
+Assert.assertTrue(c.isDescendant(d));
 
 // Check children
 Assert.assertEquals(1,  handler.getChildStreams().size());


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



buildbot failure in on tomcat-85-trunk

2019-09-05 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-85-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-85-trunk/builds/1914

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-85-commit' 
triggered this build
Build Source Stamp: [branch 8.5.x] fbbbfc03c8b9b26dff68c19fe9d8f5f95303928a
Blamelist: Mark Thomas 

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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



buildbot failure in on tomcat-trunk

2019-09-05 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-trunk while building 
tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/4576

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] 3a5556feff7e2be96e53c630f3c3e73a31adc975
Blamelist: Mark Thomas 

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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



[Bug 63724] Compile JSP to class when using Tiles and custom tag fails

2019-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63724

Carlos Hager  changed:

   What|Removed |Added

 Status|NEEDINFO|NEW

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



[Bug 63724] Compile JSP to class when using Tiles and custom tag fails

2019-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63724

--- Comment #6 from Carlos Hager  ---
Created attachment 36763
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36763=edit
stacktrace of the example project

stacktrace of the example project

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



[Bug 63690] [HTTP/2] The socket [*] associated with this connection has been closed.

2019-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63690

Mark Thomas  changed:

   What|Removed |Added

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

--- Comment #18 from Mark Thomas  ---
I've made a couple of changes in light of my research.

1. I have added some code to ensure that, if a larger than default initial
window size is configured, then Tomcat will follow the initial SETTINGS frame
(typically in the same TCP packet) with a WINDOW_UPDATE frame to increase the
size of the flow control window for the connection.

2. I have switched to using the average size of the current and previous DATA
and WINDOW_UPDATE frames to test against their respective thresholds. This
allows some smaller frames (e.g. those caused by the buggering behaviour seen
here) when surrounded by larger frames but will still close the connection
quickly if lots of small frames are used.

These changes will are in:
- master for 9.0.25 onwards
- 8.5.x for 8.5.46 onwards

I'm still hopeful that Chrome will make some changes to reduce the number of
small, non-final DATA frames it sends during an upload.

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



[Bug 63724] Compile JSP to class when using Tiles and custom tag fails

2019-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63724

--- Comment #5 from Carlos Hager  ---
(In reply to Mark Thomas from comment #1)
> Please provide the simplest possible example (which is probably going to be
> a WAR file) - including source - that demonstrates this issue.

Hi Mark, thank for the quick reply. I have attached the source code of the
project (war had 4mb and was being blocked) and 2 prints while debugging.

On the method JspUtil().makeJavaPackage, the split method used to not
considerate the first "/" of the String. But the new refactor it does take this
situation in count, causing the make a java package with "..", how you can see
in the stacktrace.

Stacktrace:

An error occurred at line: [1] in the generated java file:
[/Users/carloshager/Library/Caches/IntelliJIdea2019.2/tomcat/Unnamed_error-example/work/Catalina/localhost/error_example/org/apache/jsp/tag/meta//WEB_002dINF/customTldResource_tld/main/jsPerformanceLog_tag.java]
The declared package "" does not match the expected package
"org.apache.jsp.tag.meta.WEB_002dINF.customTldResource_tld.main"

An error occurred at line: [9] in the generated java file:
[/Users/carloshager/Library/Caches/IntelliJIdea2019.2/tomcat/Unnamed_error-example/work/Catalina/localhost/error_example/org/apache/jsp/tag/meta//WEB_002dINF/customTldResource_tld/main/jsPerformanceLog_tag.java]
Syntax error on token ".", delete this token

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



[tomcat] branch 8.5.x updated (0e87d92 -> fbbbfc0)

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

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


from 0e87d92  Add setting direction to debug logging.
 new 068cc31  Improve debug logging
 new 7e344a6  Keep connection flow control window consistent with initial 
window size.
 new fbbbfc0  Workaround 
https://bz.apache.org/bugzilla/show_bug.cgi?id=63690

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


Summary of changes:
 .../apache/coyote/http2/Http2UpgradeHandler.java   | 80 ++
 webapps/docs/changelog.xml | 13 
 webapps/docs/config/http2.xml  | 29 
 3 files changed, 95 insertions(+), 27 deletions(-)


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



[tomcat] 01/03: Improve debug logging

2019-09-05 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

commit 068cc317c5fb4663514201c921b9c192fcb0e1d0
Author: Mark Thomas 
AuthorDate: Thu Sep 5 13:28:45 2019 +0100

Improve debug logging
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 8867b58..d99e150 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -251,7 +251,7 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
 } catch (Http2Exception e) {
 String msg = sm.getString("upgradeHandler.invalidPreface", 
connectionId);
 if (log.isDebugEnabled()) {
-log.debug(msg);
+log.debug(msg, e);
 }
 throw new ProtocolException(msg);
 }


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



[tomcat] 02/03: Keep connection flow control window consistent with initial window size.

2019-09-05 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

commit 7e344a6f84d9e30340ac532d011c244293e2f15f
Author: Mark Thomas 
AuthorDate: Thu Sep 5 14:48:46 2019 +0100

Keep connection flow control window consistent with initial window size.

If the HTTP/2 connection requires an initial window size larger than the
default, send a WINDOW_UPDATE to increase the flow control window for
the connection so that the initial size of the flow control window for
the connection is consistent with the increased value.
---
 .../apache/coyote/http2/Http2UpgradeHandler.java   | 33 ++
 webapps/docs/changelog.xml |  6 
 2 files changed, 39 insertions(+)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index d99e150..adeafa9 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -568,11 +568,21 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
 }
 
 
+/**
+ * Write the initial settings frame and any necessary supporting frames. If
+ * the initial settings increase the initial window size, it will also be
+ * necessary to send a WINDOW_UPDATE frame to increase the size of the flow
+ * control window for the connection (stream 0).
+ */
 private void writeSettings() {
 // Send the initial settings frame
 try {
 byte[] settings = localSettings.getSettingsFrameForPending();
 socketWrapper.write(true, settings, 0, settings.length);
+byte[] windowUpdateFrame = createWindowUpdateForSettings();
+if (windowUpdateFrame.length > 0) {
+socketWrapper.write(true,  windowUpdateFrame, 0 , 
windowUpdateFrame.length);
+}
 socketWrapper.flush(true);
 } catch (IOException ioe) {
 String msg = sm.getString("upgradeHandler.sendPrefaceFail", 
connectionId);
@@ -584,6 +594,29 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
 }
 
 
+/**
+ * @return  The WINDOW_UPDATE frame if one is required or an empty array if
+ *  no WINDOW_UPDATE is required.
+ */
+protected byte[] createWindowUpdateForSettings() {
+// Build a WINDOW_UPDATE frame if one is required. If not, create an
+// empty byte array.
+byte[] windowUpdateFrame;
+int increment = protocol.getInitialWindowSize() - 
ConnectionSettingsBase.DEFAULT_INITIAL_WINDOW_SIZE;
+if (increment > 0) {
+// Build window update frame for stream 0
+windowUpdateFrame = new byte[13];
+ByteUtil.setThreeBytes(windowUpdateFrame, 0,  4);
+windowUpdateFrame[3] = FrameType.WINDOW_UPDATE.getIdByte();
+ByteUtil.set31Bits(windowUpdateFrame, 9, increment);
+} else {
+windowUpdateFrame = new byte[0];
+}
+
+return windowUpdateFrame;
+}
+
+
 private void writeGoAwayFrame(int maxStreamId, long errorCode, byte[] 
debugMsg)
 throws IOException {
 byte[] fixedPayload = new byte[8];
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index d6d889b..16c6b8c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -64,6 +64,12 @@
 overheadDataThreshold and
 overheadWindowUpdateThreshold. (markt)
   
+  
+If the HTTP/2 connection requires an initial window size larger than 
the
+default, send a WINDOW_UPDATE to increase the flow control window for 
the
+connection so that the initial size of the flow control window for the
+connection is consistent with the increased value. (markt)
+  
 
   
   


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



[tomcat] 03/03: Workaround https://bz.apache.org/bugzilla/show_bug.cgi?id=63690

2019-09-05 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

commit fbbbfc03c8b9b26dff68c19fe9d8f5f95303928a
Author: Mark Thomas 
AuthorDate: Thu Sep 5 12:27:24 2019 +0100

Workaround https://bz.apache.org/bugzilla/show_bug.cgi?id=63690

Use the average of the current and previous sizes when calculating
overhead for HTTP/2 DATA and WINDOW_UPDATE frames to avoid false
positives as a result of client side buffering behaviour that causes a
small percentage of non-final DATA frames to be smaller than expected.
---
 .../apache/coyote/http2/Http2UpgradeHandler.java   | 45 --
 webapps/docs/changelog.xml |  7 
 webapps/docs/config/http2.xml  | 29 +++---
 3 files changed, 55 insertions(+), 26 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index adeafa9..0b7c05a 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -156,6 +156,8 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
 
 // Track 'overhead' frames vs 'request/response' frames
 private final AtomicLong overheadCount = new AtomicLong(-10);
+private volatile int lastNonFinalDataPayload;
+private volatile int lastWindowUpdate;
 
 
 /**
@@ -176,6 +178,9 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
 this.adapter = adapter;
 this.connectionId = 
Integer.toString(connectionIdGenerator.getAndIncrement());
 
+lastNonFinalDataPayload = protocol.getOverheadDataThreshold() * 2;
+lastWindowUpdate = protocol.getOverheadWindowUpdateThreshold() * 2;
+
 remoteSettings = new ConnectionSettingsRemote(connectionId);
 localSettings = new ConnectionSettingsLocal(connectionId);
 
@@ -1492,15 +1497,21 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
 // .. but lots of small payloads are inefficient so that will increase
 // the overhead count unless it is the final DATA frame where small
 // payloads are expected.
+
+// See also https://bz.apache.org/bugzilla/show_bug.cgi?id=63690
+// The buffering behaviour of some clients means that small data frames
+// are much more frequent (roughly 1 in 20) than expected. Use an
+// average over two frames to avoid false positives.
 if (!endOfStream) {
 int overheadThreshold = protocol.getOverheadDataThreshold();
-if (payloadSize < overheadThreshold) {
-if (payloadSize == 0) {
-// Avoid division by zero
-overheadCount.addAndGet(overheadThreshold);
-} else {
-overheadCount.addAndGet(overheadThreshold / payloadSize);
-}
+int average = (lastNonFinalDataPayload >> 1) + (payloadSize >> 1);
+lastNonFinalDataPayload = payloadSize;
+// Avoid division by zero
+if (average == 0) {
+average = 1;
+}
+if (average < overheadThreshold) {
+overheadCount.addAndGet(overheadThreshold / average);
 }
 }
 
@@ -1735,13 +1746,25 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
 
 @Override
 public void incrementWindowSize(int streamId, int increment) throws 
Http2Exception {
+// See also https://bz.apache.org/bugzilla/show_bug.cgi?id=63690
+// The buffering behaviour of some clients means that small data frames
+// are much more frequent (roughly 1 in 20) than expected. Some clients
+// issue a Window update for every DATA frame so a similar pattern may
+// be observed. Use an average over two frames to avoid false 
positives.
+
+int average = (lastWindowUpdate >> 1) + (increment >> 1);
 int overheadThreshold = protocol.getOverheadWindowUpdateThreshold();
+lastWindowUpdate = increment;
+// Avoid division by zero
+if (average == 0) {
+average = 1;
+}
 
 if (streamId == 0) {
 // Check for small increments which are inefficient
-if (increment < overheadThreshold) {
+if (average < overheadThreshold) {
 // The smaller the increment, the larger the overhead
-overheadCount.addAndGet(overheadThreshold / increment);
+overheadCount.addAndGet(overheadThreshold / average);
 }
 
 incrementWindowSize(increment);
@@ -1749,13 +1772,13 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
 Stream stream = getStream(streamId, 

[Bug 63724] Compile JSP to class when using Tiles and custom tag fails

2019-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63724

--- Comment #4 from Carlos Hager  ---
Created attachment 36762
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36762=edit
print of debug showing how it was when used to work

the local split method wasn't considering the the first "/" and the package
name was being build properly

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



[Bug 63724] Compile JSP to class when using Tiles and custom tag fails

2019-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63724

--- Comment #3 from Carlos Hager  ---
Created attachment 36761
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36761=edit
print of debug showing why it fails

print of debug showing why it fails, when new split method is considering the
first "/" and adding and extra "." to the package name causing the fail

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



[tomcat] 01/03: Improve debug logging

2019-09-05 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

commit 702705ea06172fbb3358770b98f7e4da7e294515
Author: Mark Thomas 
AuthorDate: Thu Sep 5 13:28:45 2019 +0100

Improve debug logging
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 15385f6..f395d10 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -235,7 +235,7 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 } catch (Http2Exception e) {
 String msg = sm.getString("upgradeHandler.invalidPreface", 
connectionId);
 if (log.isDebugEnabled()) {
-log.debug(msg);
+log.debug(msg, e);
 }
 throw new ProtocolException(msg);
 }


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



[tomcat] 03/03: Workaround https://bz.apache.org/bugzilla/show_bug.cgi?id=63690

2019-09-05 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

commit 3a5556feff7e2be96e53c630f3c3e73a31adc975
Author: Mark Thomas 
AuthorDate: Thu Sep 5 12:27:24 2019 +0100

Workaround https://bz.apache.org/bugzilla/show_bug.cgi?id=63690

Use the average of the current and previous sizes when calculating
overhead for HTTP/2 DATA and WINDOW_UPDATE frames to avoid false
positives as a result of client side buffering behaviour that causes a
small percentage of non-final DATA frames to be smaller than expected.
---
 .../apache/coyote/http2/Http2UpgradeHandler.java   | 45 --
 webapps/docs/changelog.xml |  7 
 webapps/docs/config/http2.xml  | 29 +++---
 3 files changed, 55 insertions(+), 26 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 9753ebc..10a1f65 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -142,6 +142,8 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 
 // Track 'overhead' frames vs 'request/response' frames
 private final AtomicLong overheadCount = new AtomicLong(-10);
+private volatile int lastNonFinalDataPayload;
+private volatile int lastWindowUpdate;
 
 
 Http2UpgradeHandler(Http2Protocol protocol, Adapter adapter, Request 
coyoteRequest) {
@@ -150,6 +152,9 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 this.adapter = adapter;
 this.connectionId = 
Integer.toString(connectionIdGenerator.getAndIncrement());
 
+lastNonFinalDataPayload = protocol.getOverheadDataThreshold() * 2;
+lastWindowUpdate = protocol.getOverheadWindowUpdateThreshold() * 2;
+
 remoteSettings = new ConnectionSettingsRemote(connectionId);
 localSettings = new ConnectionSettingsLocal(connectionId);
 
@@ -1372,15 +1377,21 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 // .. but lots of small payloads are inefficient so that will increase
 // the overhead count unless it is the final DATA frame where small
 // payloads are expected.
+
+// See also https://bz.apache.org/bugzilla/show_bug.cgi?id=63690
+// The buffering behaviour of some clients means that small data frames
+// are much more frequent (roughly 1 in 20) than expected. Use an
+// average over two frames to avoid false positives.
 if (!endOfStream) {
 int overheadThreshold = protocol.getOverheadDataThreshold();
-if (payloadSize < overheadThreshold) {
-if (payloadSize == 0) {
-// Avoid division by zero
-overheadCount.addAndGet(overheadThreshold);
-} else {
-overheadCount.addAndGet(overheadThreshold / payloadSize);
-}
+int average = (lastNonFinalDataPayload >> 1) + (payloadSize >> 1);
+lastNonFinalDataPayload = payloadSize;
+// Avoid division by zero
+if (average == 0) {
+average = 1;
+}
+if (average < overheadThreshold) {
+overheadCount.addAndGet(overheadThreshold / average);
 }
 }
 
@@ -1615,13 +1626,25 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 
 @Override
 public void incrementWindowSize(int streamId, int increment) throws 
Http2Exception {
+// See also https://bz.apache.org/bugzilla/show_bug.cgi?id=63690
+// The buffering behaviour of some clients means that small data frames
+// are much more frequent (roughly 1 in 20) than expected. Some clients
+// issue a Window update for every DATA frame so a similar pattern may
+// be observed. Use an average over two frames to avoid false 
positives.
+
+int average = (lastWindowUpdate >> 1) + (increment >> 1);
 int overheadThreshold = protocol.getOverheadWindowUpdateThreshold();
+lastWindowUpdate = increment;
+// Avoid division by zero
+if (average == 0) {
+average = 1;
+}
 
 if (streamId == 0) {
 // Check for small increments which are inefficient
-if (increment < overheadThreshold) {
+if (average < overheadThreshold) {
 // The smaller the increment, the larger the overhead
-overheadCount.addAndGet(overheadThreshold / increment);
+overheadCount.addAndGet(overheadThreshold / average);
 }
 
 incrementWindowSize(increment);
@@ -1629,13 +1652,13 @@ class Http2UpgradeHandler extends AbstractStream 

[tomcat] 02/03: Keep connection flow control window consistent with initial window size.

2019-09-05 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

commit 69d7c0435c17444d5314da2d237e7468538e869a
Author: Mark Thomas 
AuthorDate: Thu Sep 5 14:48:46 2019 +0100

Keep connection flow control window consistent with initial window size.

If the HTTP/2 connection requires an initial window size larger than the
default, send a WINDOW_UPDATE to increase the flow control window for
the connection so that the initial size of the flow control window for
the connection is consistent with the increased value.
---
 .../coyote/http2/Http2AsyncUpgradeHandler.java |  4 +--
 .../apache/coyote/http2/Http2UpgradeHandler.java   | 33 ++
 webapps/docs/changelog.xml |  6 
 3 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
index 92ad29c..545292f 100644
--- a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
@@ -105,10 +105,10 @@ public class Http2AsyncUpgradeHandler extends 
Http2UpgradeHandler {
 
 @Override
 protected void writeSettings() {
-// Send the initial settings frame
 socketWrapper.write(BlockingMode.SEMI_BLOCK, 
protocol.getWriteTimeout(),
 TimeUnit.MILLISECONDS, null, SocketWrapperBase.COMPLETE_WRITE, 
errorCompletion,
-ByteBuffer.wrap(localSettings.getSettingsFrameForPending()));
+ByteBuffer.wrap(localSettings.getSettingsFrameForPending()),
+ByteBuffer.wrap(createWindowUpdateForSettings()));
 if (error != null) {
 String msg = sm.getString("upgradeHandler.sendPrefaceFail", 
connectionId);
 if (log.isDebugEnabled()) {
diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index f395d10..9753ebc 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -560,11 +560,21 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 }
 
 
+/**
+ * Write the initial settings frame and any necessary supporting frames. If
+ * the initial settings increase the initial window size, it will also be
+ * necessary to send a WINDOW_UPDATE frame to increase the size of the flow
+ * control window for the connection (stream 0).
+ */
 protected void writeSettings() {
 // Send the initial settings frame
 try {
 byte[] settings = localSettings.getSettingsFrameForPending();
 socketWrapper.write(true, settings, 0, settings.length);
+byte[] windowUpdateFrame = createWindowUpdateForSettings();
+if (windowUpdateFrame.length > 0) {
+socketWrapper.write(true,  windowUpdateFrame, 0 , 
windowUpdateFrame.length);
+}
 socketWrapper.flush(true);
 } catch (IOException ioe) {
 String msg = sm.getString("upgradeHandler.sendPrefaceFail", 
connectionId);
@@ -576,6 +586,29 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 }
 
 
+/**
+ * @return  The WINDOW_UPDATE frame if one is required or an empty array if
+ *  no WINDOW_UPDATE is required.
+ */
+protected byte[] createWindowUpdateForSettings() {
+// Build a WINDOW_UPDATE frame if one is required. If not, create an
+// empty byte array.
+byte[] windowUpdateFrame;
+int increment = protocol.getInitialWindowSize() - 
ConnectionSettingsBase.DEFAULT_INITIAL_WINDOW_SIZE;
+if (increment > 0) {
+// Build window update frame for stream 0
+windowUpdateFrame = new byte[13];
+ByteUtil.setThreeBytes(windowUpdateFrame, 0,  4);
+windowUpdateFrame[3] = FrameType.WINDOW_UPDATE.getIdByte();
+ByteUtil.set31Bits(windowUpdateFrame, 9, increment);
+} else {
+windowUpdateFrame = new byte[0];
+}
+
+return windowUpdateFrame;
+}
+
+
 protected void writeGoAwayFrame(int maxStreamId, long errorCode, byte[] 
debugMsg)
 throws IOException {
 byte[] fixedPayload = new byte[8];
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 6e907c9..b91c956 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -68,6 +68,12 @@
 overheadDataThreshold and
 overheadWindowUpdateThreshold. (markt)
   
+  
+If the HTTP/2 connection requires an initial window size larger than 
the
+default, send a WINDOW_UPDATE to increase the flow control window for 
the
+connection so that the initial size of the 

[tomcat] branch master updated (64c14b1 -> 3a5556f)

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

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


from 64c14b1  Add setting direction to debug logging.
 new 702705e  Improve debug logging
 new 69d7c04  Keep connection flow control window consistent with initial 
window size.
 new 3a5556f  Workaround 
https://bz.apache.org/bugzilla/show_bug.cgi?id=63690

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


Summary of changes:
 .../coyote/http2/Http2AsyncUpgradeHandler.java |  4 +-
 .../apache/coyote/http2/Http2UpgradeHandler.java   | 80 ++
 webapps/docs/changelog.xml | 13 
 webapps/docs/config/http2.xml  | 29 
 4 files changed, 97 insertions(+), 29 deletions(-)


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



buildbot success in on tomcat-trunk

2019-09-05 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/4575

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] 64c14b18bdd6088c623e29d27a88cbfff0e8598b
Blamelist: Mark Thomas 

Build succeeded!

Sincerely,
 -The Buildbot




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



[Bug 63724] Compile JSP to class when using Tiles and custom tag fails

2019-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63724

--- Comment #2 from Carlos Hager  ---
Created attachment 36760
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36760=edit
source code of the project to be tested

simple project which works till version 9.0.20 and fail with the higher
versions 

using gradle 4.10.X to generate the war to be deployed run: $ gradle clean
build war

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



[tomcat] 01/03: Fix various typos in threshold

2019-09-05 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

commit 781a67f8a8976ef649f581a765d627871219f710
Author: Mark Thomas 
AuthorDate: Thu Sep 5 12:38:52 2019 +0100

Fix various typos in threshold
---
 java/org/apache/coyote/http2/Http2Protocol.java| 24 +++---
 .../apache/coyote/http2/Http2UpgradeHandler.java   |  6 +++---
 .../apache/coyote/http2/TestHttp2Section_5_2.java  |  2 +-
 .../apache/coyote/http2/TestHttp2Section_5_3.java  |  2 +-
 webapps/docs/changelog.xml |  5 +
 webapps/docs/config/http2.xml  |  8 
 6 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2Protocol.java 
b/java/org/apache/coyote/http2/Http2Protocol.java
index a8556f6..e8b9ae3 100644
--- a/java/org/apache/coyote/http2/Http2Protocol.java
+++ b/java/org/apache/coyote/http2/Http2Protocol.java
@@ -86,8 +86,8 @@ public class Http2Protocol implements UpgradeProtocol {
 private int maxTrailerSize = Constants.DEFAULT_MAX_TRAILER_SIZE;
 private int overheadCountFactor = DEFAULT_OVERHEAD_COUNT_FACTOR;
 private int overheadContinuationThreshold = 
DEFAULT_OVERHEAD_CONTINUATION_THRESHOLD;
-private int overheadDataThreadhold = DEFAULT_OVERHEAD_DATA_THRESHOLD;
-private int overheadWindowUpdateThreadhold = 
DEFAULT_OVERHEAD_WINDOW_UPDATE_THRESHOLD;
+private int overheadDataThreshold = DEFAULT_OVERHEAD_DATA_THRESHOLD;
+private int overheadWindowUpdateThreshold = 
DEFAULT_OVERHEAD_WINDOW_UPDATE_THRESHOLD;
 
 private boolean initiatePingDisabled = false;
 // Compression
@@ -322,33 +322,33 @@ public class Http2Protocol implements UpgradeProtocol {
 }
 
 
-public int getOverheadContinuationThreshhold() {
+public int getOverheadContinuationThreshold() {
 return overheadContinuationThreshold;
 }
 
 
-public void setOverheadContinuationThreshhold(int 
overheadContinuationThreshold) {
+public void setOverheadContinuationThreshold(int 
overheadContinuationThreshold) {
 this.overheadContinuationThreshold = overheadContinuationThreshold;
 }
 
 
-public int getOverheadDataThreadhold() {
-return overheadDataThreadhold;
+public int getOverheadDataThreshold() {
+return overheadDataThreshold;
 }
 
 
-public void setOverheadDataThreadhold(int overheadDataThreadhold) {
-this.overheadDataThreadhold = overheadDataThreadhold;
+public void setOverheadDataThreshold(int overheadDataThreshold) {
+this.overheadDataThreshold = overheadDataThreshold;
 }
 
 
-public int getOverheadWindowUpdateThreadhold() {
-return overheadWindowUpdateThreadhold;
+public int getOverheadWindowUpdateThreshold() {
+return overheadWindowUpdateThreshold;
 }
 
 
-public void setOverheadWindowUpdateThreadhold(int 
overheadWindowUpdateThreadhold) {
-this.overheadWindowUpdateThreadhold = overheadWindowUpdateThreadhold;
+public void setOverheadWindowUpdateThreshold(int 
overheadWindowUpdateThreshold) {
+this.overheadWindowUpdateThreshold = overheadWindowUpdateThreshold;
 }
 
 
diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 383417b..8867b58 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -1460,7 +1460,7 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
 // the overhead count unless it is the final DATA frame where small
 // payloads are expected.
 if (!endOfStream) {
-int overheadThreshold = protocol.getOverheadDataThreadhold();
+int overheadThreshold = protocol.getOverheadDataThreshold();
 if (payloadSize < overheadThreshold) {
 if (payloadSize == 0) {
 // Avoid division by zero
@@ -1590,7 +1590,7 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
 // they are small and the frame isn't the final header frame then that
 // is indicative of an abusive client
 if (!endOfHeaders) {
-int overheadThreshold = 
getProtocol().getOverheadContinuationThreshhold();
+int overheadThreshold = 
getProtocol().getOverheadContinuationThreshold();
 if (payloadSize < overheadThreshold) {
 if (payloadSize == 0) {
 // Avoid division by zero
@@ -1702,7 +1702,7 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
 
 @Override
 public void incrementWindowSize(int streamId, int increment) throws 
Http2Exception {
-int overheadThreshold = protocol.getOverheadWindowUpdateThreadhold();
+int overheadThreshold = 

[tomcat] branch 8.5.x updated (720b8c6 -> 0e87d92)

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

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


from 720b8c6  Describe how Tomcat inherits its cryptographic support from 
the available libraries.
 new 781a67f  Fix various typos in threshold
 new 4cb34dd  Remove duplicate definition of initial window size
 new 0e87d92  Add setting direction to debug logging.

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


Summary of changes:
 .../coyote/http2/ConnectionSettingsBase.java   |  6 ++--
 .../coyote/http2/ConnectionSettingsLocal.java  |  8 ++
 .../coyote/http2/ConnectionSettingsRemote.java |  8 ++
 java/org/apache/coyote/http2/Http2Protocol.java| 32 ++
 .../apache/coyote/http2/Http2UpgradeHandler.java   |  6 ++--
 .../apache/coyote/http2/LocalStrings.properties|  2 +-
 .../apache/coyote/http2/TestHttp2Section_5_2.java  |  2 +-
 .../apache/coyote/http2/TestHttp2Section_5_3.java  |  2 +-
 webapps/docs/changelog.xml |  5 
 webapps/docs/config/http2.xml  |  8 +++---
 10 files changed, 50 insertions(+), 29 deletions(-)


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



[tomcat] 02/03: Remove duplicate definition of initial window size

2019-09-05 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

commit 4cb34ddd20c3941ad041ae30c37b9ac17265c390
Author: Mark Thomas 
AuthorDate: Wed Sep 4 22:10:21 2019 +0100

Remove duplicate definition of initial window size
---
 java/org/apache/coyote/http2/ConnectionSettingsBase.java | 2 +-
 java/org/apache/coyote/http2/Http2Protocol.java  | 8 +++-
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/http2/ConnectionSettingsBase.java 
b/java/org/apache/coyote/http2/ConnectionSettingsBase.java
index cc4ca57..429cf14 100644
--- a/java/org/apache/coyote/http2/ConnectionSettingsBase.java
+++ b/java/org/apache/coyote/http2/ConnectionSettingsBase.java
@@ -37,7 +37,7 @@ public abstract class ConnectionSettingsBase {
 protected static final long UNLIMITED = ((long)1 << 32); // Use the 
maximum possible
 protected static final int MAX_HEADER_TABLE_SIZE = 1 << 16;
 
-// Defaults
+// Defaults (defined by the specification)
 protected static final int DEFAULT_HEADER_TABLE_SIZE = 
Hpack.DEFAULT_TABLE_SIZE;
 protected static final boolean DEFAULT_ENABLE_PUSH = true;
 protected static final long DEFAULT_MAX_CONCURRENT_STREAMS = UNLIMITED;
diff --git a/java/org/apache/coyote/http2/Http2Protocol.java 
b/java/org/apache/coyote/http2/Http2Protocol.java
index e8b9ae3..694d424 100644
--- a/java/org/apache/coyote/http2/Http2Protocol.java
+++ b/java/org/apache/coyote/http2/Http2Protocol.java
@@ -51,8 +51,6 @@ public class Http2Protocol implements UpgradeProtocol {
 // Maximum amount of streams which can be concurrently executed over
 // a single connection
 static final int DEFAULT_MAX_CONCURRENT_STREAM_EXECUTION = 20;
-// This default is defined by the HTTP/2 specification
-static final int DEFAULT_INITIAL_WINDOW_SIZE = (1 << 16) - 1;
 
 static final int DEFAULT_OVERHEAD_COUNT_FACTOR = 1;
 static final int DEFAULT_OVERHEAD_CONTINUATION_THRESHOLD = 1024;
@@ -74,9 +72,9 @@ public class Http2Protocol implements UpgradeProtocol {
 
 private long maxConcurrentStreams = DEFAULT_MAX_CONCURRENT_STREAMS;
 private int maxConcurrentStreamExecution = 
DEFAULT_MAX_CONCURRENT_STREAM_EXECUTION;
-// If a lower initial value is required, set it here but DO NOT change the
-// default defined above.
-private int initialWindowSize = DEFAULT_INITIAL_WINDOW_SIZE;
+// To advertise a different default to the client specify it here but DO 
NOT
+// change the default defined in ConnectionSettingsBase.
+private int initialWindowSize = 
ConnectionSettingsBase.DEFAULT_INITIAL_WINDOW_SIZE;
 // Limits
 private Set allowedTrailerHeaders =
 Collections.newSetFromMap(new ConcurrentHashMap());


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



[tomcat] 03/03: Add setting direction to debug logging.

2019-09-05 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

commit 0e87d92a574c53ff392ebc792710c8ba53aea321
Author: Mark Thomas 
AuthorDate: Wed Sep 4 23:52:54 2019 +0100

Add setting direction to debug logging.
---
 java/org/apache/coyote/http2/ConnectionSettingsBase.java   | 4 +++-
 java/org/apache/coyote/http2/ConnectionSettingsLocal.java  | 8 
 java/org/apache/coyote/http2/ConnectionSettingsRemote.java | 8 
 java/org/apache/coyote/http2/LocalStrings.properties   | 2 +-
 4 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/ConnectionSettingsBase.java 
b/java/org/apache/coyote/http2/ConnectionSettingsBase.java
index 429cf14..8021b01 100644
--- a/java/org/apache/coyote/http2/ConnectionSettingsBase.java
+++ b/java/org/apache/coyote/http2/ConnectionSettingsBase.java
@@ -64,7 +64,7 @@ public abstract class ConnectionSettingsBase {
 public void set(Setting setting, long value) throws T {
 if (log.isDebugEnabled()) {
 log.debug(sm.getString("connectionSettings.debug",
-connectionId, setting, Long.toString(value)));
+connectionId, getEndpointName(), setting, 
Long.toString(value)));
 }
 
 switch(setting) {
@@ -215,4 +215,6 @@ public abstract class ConnectionSettingsBase {
 
 
 abstract void throwException(String msg, Http2Error error) throws T;
+
+abstract String getEndpointName();
 }
diff --git a/java/org/apache/coyote/http2/ConnectionSettingsLocal.java 
b/java/org/apache/coyote/http2/ConnectionSettingsLocal.java
index 54e2aa1..dd2e449 100644
--- a/java/org/apache/coyote/http2/ConnectionSettingsLocal.java
+++ b/java/org/apache/coyote/http2/ConnectionSettingsLocal.java
@@ -32,6 +32,8 @@ import java.util.Map;
  */
 public class ConnectionSettingsLocal extends 
ConnectionSettingsBase {
 
+private static final String ENDPOINT_NAME = "Local(client->server)";
+
 private boolean sendInProgress = false;
 
 
@@ -97,4 +99,10 @@ public class ConnectionSettingsLocal extends 
ConnectionSettingsBase {
 
+private static final String ENDPOINT_NAME = "Remote(server->client)";
+
 public ConnectionSettingsRemote(String connectionId) {
 super(connectionId);
 }
@@ -31,4 +33,10 @@ public class ConnectionSettingsRemote extends 
ConnectionSettingsBase

[tomcat] 03/03: Add setting direction to debug logging.

2019-09-05 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

commit 64c14b18bdd6088c623e29d27a88cbfff0e8598b
Author: Mark Thomas 
AuthorDate: Wed Sep 4 23:52:54 2019 +0100

Add setting direction to debug logging.
---
 java/org/apache/coyote/http2/ConnectionSettingsBase.java   | 4 +++-
 java/org/apache/coyote/http2/ConnectionSettingsLocal.java  | 8 
 java/org/apache/coyote/http2/ConnectionSettingsRemote.java | 8 
 java/org/apache/coyote/http2/LocalStrings.properties   | 2 +-
 4 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/ConnectionSettingsBase.java 
b/java/org/apache/coyote/http2/ConnectionSettingsBase.java
index 515219e..ed0dcd3 100644
--- a/java/org/apache/coyote/http2/ConnectionSettingsBase.java
+++ b/java/org/apache/coyote/http2/ConnectionSettingsBase.java
@@ -64,7 +64,7 @@ abstract class ConnectionSettingsBase {
 final void set(Setting setting, long value) throws T {
 if (log.isDebugEnabled()) {
 log.debug(sm.getString("connectionSettings.debug",
-connectionId, setting, Long.toString(value)));
+connectionId, getEndpointName(), setting, 
Long.toString(value)));
 }
 
 switch(setting) {
@@ -215,4 +215,6 @@ abstract class ConnectionSettingsBase {
 
 
 abstract void throwException(String msg, Http2Error error) throws T;
+
+abstract String getEndpointName();
 }
diff --git a/java/org/apache/coyote/http2/ConnectionSettingsLocal.java 
b/java/org/apache/coyote/http2/ConnectionSettingsLocal.java
index af7ff8c..64e68bb 100644
--- a/java/org/apache/coyote/http2/ConnectionSettingsLocal.java
+++ b/java/org/apache/coyote/http2/ConnectionSettingsLocal.java
@@ -32,6 +32,8 @@ import java.util.Map;
  */
 class ConnectionSettingsLocal extends 
ConnectionSettingsBase {
 
+private static final String ENDPOINT_NAME = "Local(client->server)";
+
 private boolean sendInProgress = false;
 
 
@@ -97,4 +99,10 @@ class ConnectionSettingsLocal extends 
ConnectionSettingsBase {
 
+private static final String ENDPOINT_NAME = "Remote(server->client)";
+
 ConnectionSettingsRemote(String connectionId) {
 super(connectionId);
 }
@@ -31,4 +33,10 @@ class ConnectionSettingsRemote extends 
ConnectionSettingsBase

[tomcat] 01/03: Fix various typos in threshold

2019-09-05 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

commit d22648b1d7c2b263dae5480a254a64d8c5d66716
Author: Mark Thomas 
AuthorDate: Thu Sep 5 12:38:52 2019 +0100

Fix various typos in threshold
---
 java/org/apache/coyote/http2/Http2Protocol.java| 24 +++---
 .../apache/coyote/http2/Http2UpgradeHandler.java   |  6 +++---
 .../apache/coyote/http2/TestHttp2Section_5_2.java  |  2 +-
 .../apache/coyote/http2/TestHttp2Section_5_3.java  |  2 +-
 webapps/docs/changelog.xml |  5 +
 webapps/docs/config/http2.xml  |  8 
 6 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2Protocol.java 
b/java/org/apache/coyote/http2/Http2Protocol.java
index ce84ce5..6232f35 100644
--- a/java/org/apache/coyote/http2/Http2Protocol.java
+++ b/java/org/apache/coyote/http2/Http2Protocol.java
@@ -86,8 +86,8 @@ public class Http2Protocol implements UpgradeProtocol {
 private int maxTrailerSize = Constants.DEFAULT_MAX_TRAILER_SIZE;
 private int overheadCountFactor = DEFAULT_OVERHEAD_COUNT_FACTOR;
 private int overheadContinuationThreshold = 
DEFAULT_OVERHEAD_CONTINUATION_THRESHOLD;
-private int overheadDataThreadhold = DEFAULT_OVERHEAD_DATA_THRESHOLD;
-private int overheadWindowUpdateThreadhold = 
DEFAULT_OVERHEAD_WINDOW_UPDATE_THRESHOLD;
+private int overheadDataThreshold = DEFAULT_OVERHEAD_DATA_THRESHOLD;
+private int overheadWindowUpdateThreshold = 
DEFAULT_OVERHEAD_WINDOW_UPDATE_THRESHOLD;
 
 private boolean initiatePingDisabled = false;
 private boolean useSendfile = true;
@@ -326,33 +326,33 @@ public class Http2Protocol implements UpgradeProtocol {
 }
 
 
-public int getOverheadContinuationThreshhold() {
+public int getOverheadContinuationThreshold() {
 return overheadContinuationThreshold;
 }
 
 
-public void setOverheadContinuationThreshhold(int 
overheadContinuationThreshold) {
+public void setOverheadContinuationThreshold(int 
overheadContinuationThreshold) {
 this.overheadContinuationThreshold = overheadContinuationThreshold;
 }
 
 
-public int getOverheadDataThreadhold() {
-return overheadDataThreadhold;
+public int getOverheadDataThreshold() {
+return overheadDataThreshold;
 }
 
 
-public void setOverheadDataThreadhold(int overheadDataThreadhold) {
-this.overheadDataThreadhold = overheadDataThreadhold;
+public void setOverheadDataThreshold(int overheadDataThreshold) {
+this.overheadDataThreshold = overheadDataThreshold;
 }
 
 
-public int getOverheadWindowUpdateThreadhold() {
-return overheadWindowUpdateThreadhold;
+public int getOverheadWindowUpdateThreshold() {
+return overheadWindowUpdateThreshold;
 }
 
 
-public void setOverheadWindowUpdateThreadhold(int 
overheadWindowUpdateThreadhold) {
-this.overheadWindowUpdateThreadhold = overheadWindowUpdateThreadhold;
+public void setOverheadWindowUpdateThreshold(int 
overheadWindowUpdateThreshold) {
+this.overheadWindowUpdateThreshold = overheadWindowUpdateThreshold;
 }
 
 
diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index b131765..15385f6 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -1340,7 +1340,7 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 // the overhead count unless it is the final DATA frame where small
 // payloads are expected.
 if (!endOfStream) {
-int overheadThreshold = protocol.getOverheadDataThreadhold();
+int overheadThreshold = protocol.getOverheadDataThreshold();
 if (payloadSize < overheadThreshold) {
 if (payloadSize == 0) {
 // Avoid division by zero
@@ -1470,7 +1470,7 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 // they are small and the frame isn't the final header frame then that
 // is indicative of an abusive client
 if (!endOfHeaders) {
-int overheadThreshold = 
getProtocol().getOverheadContinuationThreshhold();
+int overheadThreshold = 
getProtocol().getOverheadContinuationThreshold();
 if (payloadSize < overheadThreshold) {
 if (payloadSize == 0) {
 // Avoid division by zero
@@ -1582,7 +1582,7 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 
 @Override
 public void incrementWindowSize(int streamId, int increment) throws 
Http2Exception {
-int overheadThreshold = protocol.getOverheadWindowUpdateThreadhold();
+int overheadThreshold = 

[tomcat] 02/03: Remove duplicate definition of initial window size

2019-09-05 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

commit 2af43631faeebc13202f87081dbe75ea276371d0
Author: Mark Thomas 
AuthorDate: Wed Sep 4 22:10:21 2019 +0100

Remove duplicate definition of initial window size
---
 java/org/apache/coyote/http2/ConnectionSettingsBase.java | 2 +-
 java/org/apache/coyote/http2/Http2Protocol.java  | 8 +++-
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/http2/ConnectionSettingsBase.java 
b/java/org/apache/coyote/http2/ConnectionSettingsBase.java
index 3cf2d8d..515219e 100644
--- a/java/org/apache/coyote/http2/ConnectionSettingsBase.java
+++ b/java/org/apache/coyote/http2/ConnectionSettingsBase.java
@@ -37,7 +37,7 @@ abstract class ConnectionSettingsBase {
 static final long UNLIMITED = ((long)1 << 32); // Use the maximum possible
 static final int MAX_HEADER_TABLE_SIZE = 1 << 16;
 
-// Defaults
+// Defaults (defined by the specification)
 static final int DEFAULT_HEADER_TABLE_SIZE = Hpack.DEFAULT_TABLE_SIZE;
 static final boolean DEFAULT_ENABLE_PUSH = true;
 static final long DEFAULT_MAX_CONCURRENT_STREAMS = UNLIMITED;
diff --git a/java/org/apache/coyote/http2/Http2Protocol.java 
b/java/org/apache/coyote/http2/Http2Protocol.java
index 6232f35..9597b79 100644
--- a/java/org/apache/coyote/http2/Http2Protocol.java
+++ b/java/org/apache/coyote/http2/Http2Protocol.java
@@ -51,8 +51,6 @@ public class Http2Protocol implements UpgradeProtocol {
 // Maximum amount of streams which can be concurrently executed over
 // a single connection
 static final int DEFAULT_MAX_CONCURRENT_STREAM_EXECUTION = 20;
-// This default is defined by the HTTP/2 specification
-static final int DEFAULT_INITIAL_WINDOW_SIZE = (1 << 16) - 1;
 
 static final int DEFAULT_OVERHEAD_COUNT_FACTOR = 1;
 static final int DEFAULT_OVERHEAD_CONTINUATION_THRESHOLD = 1024;
@@ -74,9 +72,9 @@ public class Http2Protocol implements UpgradeProtocol {
 
 private long maxConcurrentStreams = DEFAULT_MAX_CONCURRENT_STREAMS;
 private int maxConcurrentStreamExecution = 
DEFAULT_MAX_CONCURRENT_STREAM_EXECUTION;
-// If a lower initial value is required, set it here but DO NOT change the
-// default defined above.
-private int initialWindowSize = DEFAULT_INITIAL_WINDOW_SIZE;
+// To advertise a different default to the client specify it here but DO 
NOT
+// change the default defined in ConnectionSettingsBase.
+private int initialWindowSize = 
ConnectionSettingsBase.DEFAULT_INITIAL_WINDOW_SIZE;
 // Limits
 private Set allowedTrailerHeaders =
 Collections.newSetFromMap(new ConcurrentHashMap());


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



[tomcat] branch master updated (8d7aba9 -> 64c14b1)

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

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


from 8d7aba9  Describe how Tomcat inherits its cryptographic support from 
the available libraries.
 new d22648b  Fix various typos in threshold
 new 2af4363  Remove duplicate definition of initial window size
 new 64c14b1  Add setting direction to debug logging.

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


Summary of changes:
 .../coyote/http2/ConnectionSettingsBase.java   |  6 ++--
 .../coyote/http2/ConnectionSettingsLocal.java  |  8 ++
 .../coyote/http2/ConnectionSettingsRemote.java |  8 ++
 java/org/apache/coyote/http2/Http2Protocol.java| 32 ++
 .../apache/coyote/http2/Http2UpgradeHandler.java   |  6 ++--
 .../apache/coyote/http2/LocalStrings.properties|  2 +-
 .../apache/coyote/http2/TestHttp2Section_5_2.java  |  2 +-
 .../apache/coyote/http2/TestHttp2Section_5_3.java  |  2 +-
 webapps/docs/changelog.xml |  5 
 webapps/docs/config/http2.xml  |  8 +++---
 10 files changed, 50 insertions(+), 29 deletions(-)


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