This is an automated email from the ASF dual-hosted git repository.
markt 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 66ec89f162 Refactor. Simplify. Don't need two fields tracking the same
value.
66ec89f162 is described below
commit 66ec89f162157225daa4589d1d1581e30affcc52
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Oct 1 08:13:33 2024 +0100
Refactor. Simplify. Don't need two fields tracking the same value.
---
java/org/apache/coyote/http2/Http2UpgradeHandler.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 1c08a277cc..8b31ebc319 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -118,7 +118,6 @@ class Http2UpgradeHandler extends AbstractStream implements
InternalHttpUpgradeH
private final ConcurrentNavigableMap<Integer,AbstractNonZeroStream>
streams = new ConcurrentSkipListMap<>();
protected final AtomicInteger activeRemoteStreamCount = new
AtomicInteger(0);
- private volatile int maxActiveRemoteStreamId = 0;
private volatile int maxProcessedStreamId;
private final AtomicInteger nextLocalStreamId = new AtomicInteger(2);
private final PingManager pingManager = getPingManager();
@@ -174,7 +173,6 @@ class Http2UpgradeHandler extends AbstractStream implements
InternalHttpUpgradeH
Integer key = Integer.valueOf(1);
Stream stream = new Stream(key, this, coyoteRequest);
streams.put(key, stream);
- maxActiveRemoteStreamId = 0;
activeRemoteStreamCount.set(1);
maxProcessedStreamId = 1;
}
@@ -1595,14 +1593,13 @@ class Http2UpgradeHandler extends AbstractStream
implements InternalHttpUpgradeH
checkPauseState();
if (connectionState.get().isNewStreamAllowed()) {
- if (streamId > maxActiveRemoteStreamId) {
+ if (streamId > maxProcessedStreamId) {
stream = createRemoteStream(streamId);
activeRemoteStreamCount.incrementAndGet();
- maxActiveRemoteStreamId = streamId;
} else {
// ID for new stream must always be greater than any
previous stream
throw new
ConnectionException(sm.getString("upgradeHandler.stream.old",
Integer.valueOf(streamId),
- Integer.valueOf(maxActiveRemoteStreamId)),
Http2Error.PROTOCOL_ERROR);
+ Integer.valueOf(maxProcessedStreamId)),
Http2Error.PROTOCOL_ERROR);
}
} else {
if (log.isTraceEnabled()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]