This is an automated email from the ASF dual-hosted git repository.
markt 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 aaac41d sendfile needs to check stream and connection flow control
windows
aaac41d is described below
commit aaac41d281df19c735f4c0bb906f8e085e01080f
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Jun 28 19:51:38 2021 +0100
sendfile needs to check stream and connection flow control windows
---
java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java | 2 +-
webapps/docs/changelog.xml | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
index 6d7e3eb..6c5ddde 100644
--- a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
@@ -374,7 +374,7 @@ public class Http2AsyncUpgradeHandler extends
Http2UpgradeHandler {
failed (e, sendfile);
return;
}
- int frameSize = Integer.min(getMaxFrameSize(),
sendfile.streamReservation);
+ int frameSize = Integer.min(getMaxFrameSize(),
Integer.min(sendfile.streamReservation, sendfile.connectionReservation));
boolean finished = (frameSize == sendfile.left) &&
sendfile.stream.getCoyoteResponse().getTrailerFields() == null;
// Need to check this now since sending end of stream will change
this.
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e8f3b2d..3d75a8e 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,17 @@
issues do not "pop up" wrt. others).
-->
<section name="Tomcat 10.1.0-M3 (markt)" rtext="in development">
+ <subsection name="Coyote">
+ <changelog>
+ <fix>
+ When writing an HTTP/2 response via sendfile (only enabled when
+ <code>useAsyncIO</code> is true) the connection flow control window was
+ sometimes ignored leading to various error conditions. sendfile now
+ checks both the stream and connection flow control windows before
+ writing. (markt)
+ </fix>
+ </changelog>
+ </subsection>
<subsection name="Web applications">
<changelog>
<fix>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]