This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 8c6525835e Refactor decrement using a common method
8c6525835e is described below
commit 8c6525835eaca89010e6fe3a295d60312f0abc49
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 5c5c494357..0af0ce7ed7 100644
--- a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
@@ -156,7 +156,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 5f92b983b4..85fca873f5 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -288,6 +288,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) {
@@ -591,7 +596,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);
@@ -834,7 +839,7 @@ class Http2UpgradeHandler extends AbstractStream implements
InternalHttpUpgradeH
protected void sentEndOfStream(Stream stream) {
stream.sentEndOfStream();
if (!stream.isActive()) {
-
setConnectionTimeoutForStreamCount(activeRemoteStreamCount.decrementAndGet());
+ decrementActiveRemoteStreamCount();
}
}
@@ -1644,7 +1649,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(
@@ -1688,7 +1693,7 @@ class Http2UpgradeHandler extends AbstractStream
implements InternalHttpUpgradeH
private void receivedEndOfStream(Stream stream) throws ConnectionException
{
stream.receivedEndOfStream();
if (!stream.isActive()) {
-
setConnectionTimeoutForStreamCount(activeRemoteStreamCount.decrementAndGet());
+ decrementActiveRemoteStreamCount();
}
}
@@ -1714,7 +1719,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]