Author: markt Date: Wed Nov 15 21:41:31 2017 New Revision: 1815385 URL: http://svn.apache.org/viewvc?rev=1815385&view=rev Log: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=61673 Avoid a possible ConcurrentModificationException when working with the streams associated with a connection.
Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java?rev=1815385&r1=1815384&r2=1815385&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java (original) +++ tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java Wed Nov 15 21:41:31 2017 @@ -20,7 +20,6 @@ import java.io.EOFException; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; -import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map; @@ -122,7 +121,7 @@ class Http2UpgradeHandler extends Abstra private HpackDecoder hpackDecoder; private HpackEncoder hpackEncoder; - private final Map<Integer,Stream> streams = new HashMap<>(); + private final Map<Integer,Stream> streams = new ConcurrentHashMap<>(); protected final AtomicInteger activeRemoteStreamCount = new AtomicInteger(0); // Start at -1 so the 'add 2' logic in closeIdleStreams() works private volatile int maxActiveRemoteStreamId = -1; Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1815385&r1=1815384&r2=1815385&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Wed Nov 15 21:41:31 2017 @@ -97,6 +97,11 @@ <code>AbstractHttp11Protocol.getSSLProtocol()</code>. (markt) </fix> <fix> + <bug>61673</bug>: Avoid a possible + <code>ConcurrentModificationException</code> when working with the + streams associated with a connection. (markt) + </fix> + <fix> <bug>61719</bug>: Avoid possible NPE calling InputStream.setReadListener with HTTP/2. (remm) </fix> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org