This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 87ff1fc115 Treat SETTINGS_INITIAL_WINDOW_SIZE overflow as a connection
error (#1131)
87ff1fc115 is described below
commit 87ff1fc115e43dd49ba20eec6e6d915e4f99f0b1
Author: Arturo Bernal <[email protected]>
AuthorDate: Thu Nov 12 12:26:14 2026 +0100
Treat SETTINGS_INITIAL_WINDOW_SIZE overflow as a connection error (#1131)
Per RFC 9113 section 6.9.2, a change to SETTINGS_INITIAL_WINDOW_SIZE
that causes any flow-control window to exceed the maximum size must be
treated as a connection error of type FLOW_CONTROL_ERROR. The previous
code closed only the affected stream with RST_STREAM, which is a stream
error and not compliant with the specification.
---
java/org/apache/coyote/http2/Http2UpgradeHandler.java | 6 ++++--
test/org/apache/coyote/http2/TestHttp2Section_6_9.java | 9 ++++-----
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 602333ebca..60c6fad099 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -1970,9 +1970,11 @@ class Http2UpgradeHandler extends AbstractStream
implements InternalHttpUpgradeH
try {
stream.incrementWindowSize(diff);
} catch (Http2Exception h2e) {
- ((Stream) stream).close(new StreamException(
+ // Per RFC 9113 section 6.9.2, a change to
SETTINGS_INITIAL_WINDOW_SIZE that
+ // causes any flow-control window to exceed the maximum
size is a connection error.
+ throw new ConnectionException(
sm.getString("upgradeHandler.windowSizeTooBig",
connectionId, stream.getIdAsString()),
- h2e.getError(), stream.getIdAsInt()));
+ Http2Error.FLOW_CONTROL_ERROR);
}
}
} else if (setting == Setting.NO_RFC7540_PRIORITIES) {
diff --git a/test/org/apache/coyote/http2/TestHttp2Section_6_9.java
b/test/org/apache/coyote/http2/TestHttp2Section_6_9.java
index 966bf88d24..28ad585761 100644
--- a/test/org/apache/coyote/http2/TestHttp2Section_6_9.java
+++ b/test/org/apache/coyote/http2/TestHttp2Section_6_9.java
@@ -263,11 +263,10 @@ public class TestHttp2Section_6_9 extends Http2TestBase {
// Increase the flow control window but keep it under the limit
sendWindowUpdate(3, 1 << 30);
- // Now increase beyond the limit via a settings frame
+ // Now increase beyond the limit via a settings frame.
+ // Per RFC 9113 section 6.9.2 this must be treated as a connection
error
+ // of type FLOW_CONTROL_ERROR, not a stream error.
sendSettings(0, false, new SettingValue(4, 1 << 30));
- // Ack
- parser.readFrame();
- Assert.assertEquals("3-RST-[" +
Http2Error.FLOW_CONTROL_ERROR.getCode() + "]\n", output.getTrace());
-
+ handleGoAwayResponse(3, Http2Error.FLOW_CONTROL_ERROR);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]