This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 8d2ddd76ee Refactor decrement using a common method
8d2ddd76ee is described below
commit 8d2ddd76ee0b47c51cbae88d0d85de86a7daca4c
Author: remm <[email protected]>
AuthorDate: Thu Oct 19 14:50:05 2023 +0200
Refactor decrement using a common method
---
.../org/apache/coyote/http2/Http2AsyncUpgradeHandler.java | 2 +-
java/org/apache/coyote/http2/Http2UpgradeHandler.java | 15 ++++++++++-----
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
index d551bbc6ab..331c111428 100644
--- a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
@@ -157,7 +157,7 @@ public class Http2AsyncUpgradeHandler extends
Http2UpgradeHandler {
boolean active = state.isActive();
state.sendReset();
if (active) {
- activeRemoteStreamCount.decrementAndGet();
+ decrementActiveRemoteStreamCount();
}
}
diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index cfba750566..f6963e53cd 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -291,6 +291,11 @@ class Http2UpgradeHandler extends AbstractStream
implements InternalHttpUpgradeH
}
+ protected void decrementActiveRemoteStreamCount() {
+
setConnectionTimeoutForStreamCount(activeRemoteStreamCount.decrementAndGet());
+ }
+
+
void processStreamOnContainerThread(StreamProcessor streamProcessor,
SocketEvent event) {
StreamRunnable streamRunnable = new StreamRunnable(streamProcessor,
event);
if (streamConcurrency == null) {
@@ -594,7 +599,7 @@ class Http2UpgradeHandler extends AbstractStream implements
InternalHttpUpgradeH
boolean active = state.isActive();
state.sendReset();
if (active) {
- activeRemoteStreamCount.decrementAndGet();
+ decrementActiveRemoteStreamCount();
}
}
socketWrapper.write(true, rstFrame, 0, rstFrame.length);
@@ -839,7 +844,7 @@ class Http2UpgradeHandler extends AbstractStream implements
InternalHttpUpgradeH
protected void sentEndOfStream(Stream stream) {
stream.sentEndOfStream();
if (!stream.isActive()) {
-
setConnectionTimeoutForStreamCount(activeRemoteStreamCount.decrementAndGet());
+ decrementActiveRemoteStreamCount();
}
}
@@ -1650,7 +1655,7 @@ class Http2UpgradeHandler extends AbstractStream
implements InternalHttpUpgradeH
if (stream.receivedEndOfHeaders()) {
if (localSettings.getMaxConcurrentStreams() <
activeRemoteStreamCount.incrementAndGet()) {
-
setConnectionTimeoutForStreamCount(activeRemoteStreamCount.decrementAndGet());
+ decrementActiveRemoteStreamCount();
// Ignoring maxConcurrentStreams increases the
overhead count
increaseOverheadCount(FrameType.HEADERS);
throw new StreamException(
@@ -1694,7 +1699,7 @@ class Http2UpgradeHandler extends AbstractStream
implements InternalHttpUpgradeH
private void receivedEndOfStream(Stream stream) throws ConnectionException
{
stream.receivedEndOfStream();
if (!stream.isActive()) {
-
setConnectionTimeoutForStreamCount(activeRemoteStreamCount.decrementAndGet());
+ decrementActiveRemoteStreamCount();
}
}
@@ -1720,7 +1725,7 @@ class Http2UpgradeHandler extends AbstractStream
implements InternalHttpUpgradeH
boolean active = stream.isActive();
stream.receiveReset(errorCode);
if (active) {
- activeRemoteStreamCount.decrementAndGet();
+ decrementActiveRemoteStreamCount();
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]