This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 9efe006642 Fix BZ 66842 - include DATA frames in overhead count with
async
9efe006642 is described below
commit 9efe0066424117673ec5b719e3aab10b0cead890
Author: Mark Thomas <[email protected]>
AuthorDate: Sun Aug 6 12:44:07 2023 +0100
Fix BZ 66842 - include DATA frames in overhead count with async
https://bz.apache.org/bugzilla/show_bug.cgi?id=66842
---
java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java | 3 +++
java/org/apache/coyote/http2/Http2UpgradeHandler.java | 2 +-
webapps/docs/changelog.xml | 5 +++++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
index 0a0868d477..d551bbc6ab 100644
--- a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
@@ -228,6 +228,9 @@ public class Http2AsyncUpgradeHandler extends
Http2UpgradeHandler {
log.debug(sm.getString("upgradeHandler.writeBody", connectionId,
stream.getIdAsString(),
Integer.toString(len), Boolean.valueOf(finished)));
}
+
+ reduceOverheadCount(FrameType.DATA);
+
// Need to check this now since sending end of stream will change this.
boolean writable = stream.canWrite();
byte[] header = new byte[9];
diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index bf8be7cf83..137d009fd6 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -1381,7 +1381,7 @@ class Http2UpgradeHandler extends AbstractStream
implements InternalHttpUpgradeH
}
- private void reduceOverheadCount(FrameType frameType) {
+ void reduceOverheadCount(FrameType frameType) {
// A non-overhead frame reduces the overhead count by
// Http2Protocol.DEFAULT_OVERHEAD_REDUCTION_FACTOR. A simple browser
// request is likely to have one non-overhead frame (HEADERS) and one
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 44c53200cf..c446f608db 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -144,6 +144,11 @@
called after an error during asynchronous processing with HTTP/2.
(markt)
</fix>
+ <fix>
+ <bug>66842</bug>: When using asynchronous I/O (the default), include
+ DATA frames when calculating the HTTP/2 overhead count to ensure that
+ connections are not prematurely terminated. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="WebSocket">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]