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 bd83b29 Simplify
bd83b29 is described below
commit bd83b290f2e94a70c9f59ec55ce5bfd5eaf743e3
Author: Mark Thomas <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]