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 32518738e9 Fix 66530 - Regression in fix for BZ 66442. Ensure count is
decremented
32518738e9 is described below
commit 32518738e9b86d22dae748b6cd9f3846832fbd34
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Mar 17 09:23:05 2023 +0000
Fix 66530 - Regression in fix for BZ 66442. Ensure count is decremented
https://bz.apache.org/bugzilla/show_bug.cgi?id=66530
---
java/org/apache/coyote/http2/Http2UpgradeHandler.java | 15 ++++++++++-----
webapps/docs/changelog.xml | 7 +++++++
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 08e1b5f084..17c53583c8 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -689,7 +689,7 @@ class Http2UpgradeHandler extends AbstractStream implements
InternalHttpUpgradeH
}
stream.sentHeaders();
if (endOfStream) {
- stream.sentEndOfStream();
+ sentEndOfStream(stream);
}
}
@@ -795,10 +795,7 @@ class Http2UpgradeHandler extends AbstractStream
implements InternalHttpUpgradeH
header[3] = FrameType.DATA.getIdByte();
if (finished) {
header[4] = FLAG_END_OF_STREAM;
- stream.sentEndOfStream();
- if (!stream.isActive()) {
-
setConnectionTimeoutForStreamCount(activeRemoteStreamCount.decrementAndGet());
- }
+ sentEndOfStream(stream);
}
if (writable) {
ByteUtil.set31Bits(header, 5, stream.getIdAsInt());
@@ -818,6 +815,14 @@ class Http2UpgradeHandler extends AbstractStream
implements InternalHttpUpgradeH
}
+ protected void sentEndOfStream(Stream stream) {
+ stream.sentEndOfStream();
+ if (!stream.isActive()) {
+
setConnectionTimeoutForStreamCount(activeRemoteStreamCount.decrementAndGet());
+ }
+ }
+
+
/*
* Handles an I/O error on the socket underlying the HTTP/2 connection
when it is triggered by application code
* (usually reading the request or writing the response). Such I/O errors
are fatal so the connection is closed. The
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4cca125306..36a64c242d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -160,6 +160,13 @@
<bug>66512</bug>: Align AJP handling of invalid HTTP response headers
(they are now removed from the response) with HTTP. (markt)
</fix>
+ <fix>
+ <bug>66530</bug>: Correct a regression in the fix for bug
+ <bug>66442</bug> that meant that streams without a response body did
not
+ decrement the active stream count when completing leading to
+ <code>ERR_HTTP2_SERVER_REFUSED_STREAM</code> for some connections.
+ (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="WebSocket">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]