You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/09/05 11:50:38 UTC

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

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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


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

Posted by ma...@apache.org.
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 <ma...@apache.org>
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<T extends Throwable> {
     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<T extends Throwable> {
 
 
     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<IllegalArgumentException> {
 
+    private static final String ENDPOINT_NAME = "Local(client->server)";
+
     private boolean sendInProgress = false;
 
 
@@ -97,4 +99,10 @@ class ConnectionSettingsLocal extends ConnectionSettingsBase<IllegalArgumentExce
     final void throwException(String msg, Http2Error error) throws IllegalArgumentException {
         throw new IllegalArgumentException(msg);
     }
+
+
+    @Override
+    final String getEndpointName() {
+        return ENDPOINT_NAME;
+    }
 }
diff --git a/java/org/apache/coyote/http2/ConnectionSettingsRemote.java b/java/org/apache/coyote/http2/ConnectionSettingsRemote.java
index e50a5d2..235446a 100644
--- a/java/org/apache/coyote/http2/ConnectionSettingsRemote.java
+++ b/java/org/apache/coyote/http2/ConnectionSettingsRemote.java
@@ -22,6 +22,8 @@ package org.apache.coyote.http2;
  */
 class ConnectionSettingsRemote extends ConnectionSettingsBase<ConnectionException> {
 
+    private static final String ENDPOINT_NAME = "Remote(server->client)";
+
     ConnectionSettingsRemote(String connectionId) {
         super(connectionId);
     }
@@ -31,4 +33,10 @@ class ConnectionSettingsRemote extends ConnectionSettingsBase<ConnectionExceptio
     final void throwException(String msg, Http2Error error) throws ConnectionException {
         throw new ConnectionException(msg, error);
     }
+
+
+    @Override
+    final String getEndpointName() {
+        return ENDPOINT_NAME;
+    }
 }
diff --git a/java/org/apache/coyote/http2/LocalStrings.properties b/java/org/apache/coyote/http2/LocalStrings.properties
index 83afc74..670dce3 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -21,7 +21,7 @@ connectionPrefaceParser.eos=Unexpected end of stream while reading opening clien
 connectionPrefaceParser.ioError=Failed to read opening client preface byte sequence
 connectionPrefaceParser.mismatch=An unexpected byte sequence was received at the start of the client preface [{0}]
 
-connectionSettings.debug=Connection [{0}], Parameter type [{1}] set to [{2}]
+connectionSettings.debug=Connection [{0}], Endpoint [{1}], Parameter type [{2}] set to [{3}]
 connectionSettings.enablePushInvalid=Connection [{0}], The requested value for enable push [{1}] is not one of the permitted values (zero or one)
 connectionSettings.headerTableSizeLimit=Connection [{0}], Attempted to set a header table size of [{1}] but the limit is 16k
 connectionSettings.maxFrameSizeInvalid=Connection [{0}], The requested maximum frame size of [{1}] is outside the permitted range of [{2}] to [{3}]


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


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

Posted by ma...@apache.org.
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 <ma...@apache.org>
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<T extends Throwable> {
     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<String> allowedTrailerHeaders =
             Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>());


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


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

Posted by ma...@apache.org.
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 <ma...@apache.org>
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 = protocol.getOverheadWindowUpdateThreshold();
 
         if (streamId == 0) {
             // Check for small increments which are inefficient
diff --git a/test/org/apache/coyote/http2/TestHttp2Section_5_2.java b/test/org/apache/coyote/http2/TestHttp2Section_5_2.java
index ad559807..7bef2f0 100644
--- a/test/org/apache/coyote/http2/TestHttp2Section_5_2.java
+++ b/test/org/apache/coyote/http2/TestHttp2Section_5_2.java
@@ -42,7 +42,7 @@ public class TestHttp2Section_5_2 extends Http2TestBase {
 
         // This test uses small window updates that will trigger the excessive
         // overhead protection so disable it.
-        http2Protocol.setOverheadWindowUpdateThreadhold(0);
+        http2Protocol.setOverheadWindowUpdateThreshold(0);
 
         // Set the default window size to 1024 bytes
         sendSettings(0, false, new SettingValue(4, 1024));
diff --git a/test/org/apache/coyote/http2/TestHttp2Section_5_3.java b/test/org/apache/coyote/http2/TestHttp2Section_5_3.java
index df74a73..20a3b30 100644
--- a/test/org/apache/coyote/http2/TestHttp2Section_5_3.java
+++ b/test/org/apache/coyote/http2/TestHttp2Section_5_3.java
@@ -54,7 +54,7 @@ public class TestHttp2Section_5_3 extends Http2TestBase {
 
         // This test uses small window updates that will trigger the excessive
         // overhead protection so disable it.
-        http2Protocol.setOverheadWindowUpdateThreadhold(0);
+        http2Protocol.setOverheadWindowUpdateThreshold(0);
 
         // Default connection window size is 64k - 1. Initial request will have
         // used 8k (56k -1). Increase it to 57k
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f5038b7..6e907c9 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -63,6 +63,11 @@
       <fix>
         <bug>63706</bug>: Avoid NPE accessing https port with plaintext. (remm)
       </fix>
+      <fix>
+        Correct typos in the names of the configuration attributes
+        <code>overheadDataThreshold</code> and
+        <code>overheadWindowUpdateThreshold</code>. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Web applications">
diff --git a/webapps/docs/config/http2.xml b/webapps/docs/config/http2.xml
index 29a6caa..ebba1b7 100644
--- a/webapps/docs/config/http2.xml
+++ b/webapps/docs/config/http2.xml
@@ -213,22 +213,22 @@
       used.</p>
     </attribute>
 
-    <attribute name="overheadDataThreadhold" required="false">
+    <attribute name="overheadDataThreshold" required="false">
       <p>The threshold below which the payload size of a non-final
       <code>DATA</code> frame will trigger an increase in the overhead count
       (see <strong>overheadCountFactor</strong>). The overhead count will be
-      increased by <code>overheadDataThreadhold/payloadSize</code> so that the
+      increased by <code>overheadDataThreshold/payloadSize</code> so that the
       smaller the <code>DATA</code> frame, the greater the increase in the
       overhead count. A value of zero or less disables the checking of non-final
       <code>DATA</code> frames. If not specified, a default value of
       <code>1024</code> will be used.</p>
     </attribute>
 
-    <attribute name="overheadWindowUpdateThreadhold" required="false">
+    <attribute name="overheadWindowUpdateThreshold" required="false">
       <p>The threshold below which the size of a <code>WINDOW_UPDATE</code>
       frame will trigger an increase in the overhead count (see
       <strong>overheadCountFactor</strong>). The overhead count will be
-      increased by <code>overheadWindowUpdateThreadhold/updateSize</code> so
+      increased by <code>overheadWindowUpdateThreshold/updateSize</code> so
       that the smaller the <code>WINDOW_UPDATE</code>, the greater the increase
       in the overhead count. A value of zero or less disables the checking of
       <code>WINDOW_UPDATE</code> frames. If not specified, a default value of


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