This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new 9155f6fe8d Refactor. Simplify. Don't need two fields tracking the same
value.
9155f6fe8d is described below
commit 9155f6fe8d1f32d6f788821b8cc407bf036fb7d3
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 f01678c455..22b4f37849 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 PingManager pingManager = getPingManager();
private volatile int newStreamsSinceLastPrune = 0;
@@ -176,7 +175,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;
}
@@ -1537,14 +1535,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]