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 <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 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 = 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 3b14890..0a4c571 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 115f12a..d6d889b 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -59,6 +59,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 8a8ae70..9efafbd 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org