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/07/23 13:34:20 UTC
[tomcat] branch 8.5.x updated: Fix BZ 65460
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new b392b39 Fix BZ 65460
b392b39 is described below
commit b392b3931d98f5d66a981ab9018f3bc1d8bb9f62
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Jul 23 14:28:38 2021 +0100
Fix BZ 65460
https://bz.apache.org/bugzilla/show_bug.cgi?id=65460
Correct a regression introduced in 8.5.69 in the change to reduce the
number of small HTTP/2 window updates sent for streams. A logic error
meant that small window updates for the connection were not flushed.
This meant that the connection flow window may not update quite as
quickly as the ideal.
---
java/org/apache/coyote/http2/Http2UpgradeHandler.java | 5 ++++-
webapps/docs/changelog.xml | 7 +++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index b994e92..4b0eb56 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -826,6 +826,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH
frame[3] = FrameType.WINDOW_UPDATE.getIdByte();
ByteUtil.set31Bits(frame, 9, increment);
socketWrapper.write(true, frame, 0, frame.length);
+ boolean needFlush = true;
// No need to send update from closed stream
if (stream instanceof Stream && ((Stream) stream).canWrite()) {
int streamIncrement = ((Stream) stream).getWindowUpdateSizeToWrite(increment);
@@ -840,6 +841,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH
try {
socketWrapper.write(true, frame, 0, frame.length);
socketWrapper.flush(true);
+ needFlush = false;
} catch (IOException ioe) {
if (applicationInitiated) {
handleAppInitiatedIOException(ioe);
@@ -848,7 +850,8 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH
}
}
}
- } else {
+ }
+ if (needFlush) {
socketWrapper.flush(true);
}
}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 5bc3d47..98c415c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -136,6 +136,13 @@
request to finish processing rather than the thread pool creating a new
thread to process the new request. (markt)
</fix>
+ <fix>
+ <bug>65460</bug>: Correct a regression introduced in the previous
+ release in the change to reduce the number of small HTTP/2 window
+ updates sent for streams. A logic error meant that small window updates
+ for the connection were not flushed. This meant that the connection flow
+ window may not update quite as quickly as the ideal. (markt)
+ </fix>
</changelog>
</subsection>
</section>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org