From 10ef07b9e7fa35b71200b02cb07eb6fd767e91e7 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Fri, 6 Aug 2021 13:01:57 +0200 Subject: [PATCH] Fixes #6369 - Increment default jetty.http2.rateControl.maxEventsPerSecond Incremented rateControl.maxEventsPerSecond to 50. Fixed mistakes in the http2c module. Signed-off-by: Simone Bordet (cherry picked from commit 784293aa6d3e8c0bee77264258ac64ac48a4836f) --- .../http2-server/src/main/config/etc/jetty-http2.xml | 2 +- .../http2-server/src/main/config/etc/jetty-http2c.xml | 6 +++--- .../http2-server/src/main/config/modules/http2.mod | 2 +- .../http2-server/src/main/config/modules/http2c.mod | 8 ++++---- .../server/AbstractHTTP2ServerConnectionFactory.java | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) 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 3110c911d9d..78904fd4bba 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 @@ -12,7 +12,7 @@ - + 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 86b10ada984..a13cf3970f6 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 @@ -8,11 +8,11 @@ - - + + - + 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 f1742041b51..2447ef364ec 100644 --- a/jetty-http2/http2-server/src/main/config/modules/http2.mod +++ b/jetty-http2/http2-server/src/main/config/modules/http2.mod @@ -33,5 +33,5 @@ etc/jetty-http2.xml ## Specifies the maximum number of bad frames and pings per second, ## after which a session is closed to avoid denial of service attacks. -# jetty.http2.rateControl.maxEventsPerSecond=20 +# jetty.http2.rateControl.maxEventsPerSecond=50 # end::documentation[] 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 f1a6fc4f55a..eb40a13ed66 100644 --- a/jetty-http2/http2-server/src/main/config/modules/http2c.mod +++ b/jetty-http2/http2-server/src/main/config/modules/http2c.mod @@ -20,16 +20,16 @@ etc/jetty-http2c.xml ## Specifies the maximum number of concurrent requests per session. # jetty.http2c.maxConcurrentStreams=128 - ## Specifies the initial stream receive window (client to server) in bytes. +## Specifies the initial stream receive window (client to server) in bytes. # jetty.http2c.initialStreamRecvWindow=524288 ## Specifies the initial session receive window (client to server) in bytes. -# jetty.http2.initialSessionRecvWindow=1232896 +# jetty.http2c.initialSessionRecvWindow=1232896 ## Specifies the maximum number of keys in all SETTINGS frames received by a session. -# jetty.http2.maxSettingsKeys=64 +# jetty.http2c.maxSettingsKeys=64 ## Specifies the maximum number of bad frames and pings per second, ## after which a session is closed to avoid denial of service attacks. -# jetty.http2.rateControl.maxEventsPerSecond=20 +# jetty.http2c.rateControl.maxEventsPerSecond=50 # end::documentation[] diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/AbstractHTTP2ServerConnectionFactory.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/AbstractHTTP2ServerConnectionFactory.java index ff386f198fa..1436e118831 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/AbstractHTTP2ServerConnectionFactory.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/AbstractHTTP2ServerConnectionFactory.java @@ -61,7 +61,7 @@ public abstract class AbstractHTTP2ServerConnectionFactory extends AbstractConne private int maxFrameLength = Frame.DEFAULT_MAX_LENGTH; private int maxSettingsKeys = SettingsFrame.DEFAULT_MAX_KEYS; private boolean connectProtocolEnabled = true; - private RateControl.Factory rateControlFactory = new WindowRateControl.Factory(20); + private RateControl.Factory rateControlFactory = new WindowRateControl.Factory(50); private FlowControlStrategy.Factory flowControlStrategyFactory = () -> new BufferingFlowControlStrategy(0.5F); private long streamIdleTimeout; private boolean useInputDirectByteBuffers;