This is an automated email from the ASF dual-hosted git repository. markt 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 29c723ef58 Refactor. Simplify. Don't need two fields tracking the same value. 29c723ef58 is described below commit 29c723ef58d2fad7c29e4a568a53010fcf718cb0 Author: Mark Thomas <ma...@apache.org> 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 04bb9e0be9..0e4d94ed5d 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(); @@ -177,7 +176,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; } @@ -1598,14 +1596,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: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org