You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/06/28 18:53:39 UTC
[tomcat] branch 10.0.x updated: sendfile needs to check stream and
connection flow control windows
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.0.x by this push:
new 2fffa31 sendfile needs to check stream and connection flow control windows
2fffa31 is described below
commit 2fffa31c697c9be26bccb50e66e2a8228b37d0ed
Author: Mark Thomas <ma...@apache.org>
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 ba59869..cbb302c 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.0.9 (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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org