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 47a27e4 Simplify 47a27e4 is described below commit 47a27e47e94acc2e66545032fa5a4c5420b204d7 Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Jul 1 19:05:20 2021 +0100 Simplify The logic used to obtain connectionReservation and streamReservartion means that streamReservation >= connectionReservation --- java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java index 6c5ddde..000d3ab 100644 --- a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java +++ b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java @@ -312,7 +312,9 @@ public class Http2AsyncUpgradeHandler extends Http2UpgradeHandler { } catch (IOException e) { return SendfileState.ERROR; } - // Actually perform the write + + // connectionReservation will always be smaller than or the same as + // streamReservation int frameSize = Integer.min(getMaxFrameSize(), sendfile.connectionReservation); boolean finished = (frameSize == sendfile.left) && sendfile.stream.getCoyoteResponse().getTrailerFields() == null; @@ -374,7 +376,10 @@ public class Http2AsyncUpgradeHandler extends Http2UpgradeHandler { failed (e, sendfile); return; } - int frameSize = Integer.min(getMaxFrameSize(), Integer.min(sendfile.streamReservation, sendfile.connectionReservation)); + + // connectionReservation will always be smaller than or the same as + // streamReservation + int frameSize = Integer.min(getMaxFrameSize(), 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. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org