From 5ff79b0bf1164ff3124873a52a6979b9097794a4 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Tue, 15 Oct 2019 11:23:53 +1100 Subject: [PATCH] Issue #4142 - changes from review Signed-off-by: Lachlan Roberts --- .../eclipse/jetty/http2/parser/WindowRateControl.java | 5 +++++ .../http2-server/src/main/config/etc/jetty-http2.xml | 11 +++-------- .../http2-server/src/main/config/etc/jetty-http2c.xml | 11 +++-------- .../http2-server/src/main/config/modules/http2.mod | 2 +- .../http2-server/src/main/config/modules/http2c.mod | 2 +- 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/WindowRateControl.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/WindowRateControl.java index 00a2c769737..7a198637cbc 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/WindowRateControl.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/WindowRateControl.java @@ -39,6 +39,11 @@ public class WindowRateControl implements RateControl private final int maxEvents; private final long window; + public static WindowRateControl ofSecond(int maxEvents) + { + return new WindowRateControl(maxEvents, Duration.ofSeconds(1)); + } + public WindowRateControl(int maxEvents, Duration window) { this.maxEvents = maxEvents; diff --git a/jetty-http2/http2-server/src/main/config/etc/jetty-http2.xml b/jetty-http2/http2-server/src/main/config/etc/jetty-http2.xml index 7bcc76e28a4..c213d35fe29 100644 --- a/jetty-http2/http2-server/src/main/config/etc/jetty-http2.xml +++ b/jetty-http2/http2-server/src/main/config/etc/jetty-http2.xml @@ -11,14 +11,9 @@ - - - - - 1 - - - + + + diff --git a/jetty-http2/http2-server/src/main/config/etc/jetty-http2c.xml b/jetty-http2/http2-server/src/main/config/etc/jetty-http2c.xml index 68f7e470cde..e4c9ad69f99 100644 --- a/jetty-http2/http2-server/src/main/config/etc/jetty-http2c.xml +++ b/jetty-http2/http2-server/src/main/config/etc/jetty-http2c.xml @@ -10,14 +10,9 @@ - - - - - 1 - - - + + + diff --git a/jetty-http2/http2-server/src/main/config/modules/http2.mod b/jetty-http2/http2-server/src/main/config/modules/http2.mod index fae583a370f..ccc7d7b520c 100644 --- a/jetty-http2/http2-server/src/main/config/modules/http2.mod +++ b/jetty-http2/http2-server/src/main/config/modules/http2.mod @@ -34,4 +34,4 @@ etc/jetty-http2.xml # jetty.http2.maxSettingsKeys=64 ## Max number of bad frames and pings per second -# jetty.http2.rateControl=20 +# jetty.http2.rateControlWindow=20 diff --git a/jetty-http2/http2-server/src/main/config/modules/http2c.mod b/jetty-http2/http2-server/src/main/config/modules/http2c.mod index ff763760b4f..82e0a67d1b9 100644 --- a/jetty-http2/http2-server/src/main/config/modules/http2c.mod +++ b/jetty-http2/http2-server/src/main/config/modules/http2c.mod @@ -29,4 +29,4 @@ etc/jetty-http2c.xml # jetty.http2.maxSettingsKeys=64 ## Max number of bad frames and pings per second -# jetty.http2.rateControl=20 +# jetty.http2.rateControlWindow=20