Author: markt Date: Thu May 21 09:01:28 2015 New Revision: 1680770 URL: http://svn.apache.org/r1680770 Log: Minor optimisation
Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java 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=1680770&r1=1680769&r2=1680770&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java (original) +++ tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java Thu May 21 09:01:28 2015 @@ -400,21 +400,19 @@ public class Http2UpgradeHandler extends int weight = ByteUtil.getOneByte(payload, 4) + 1; Stream stream = getStream(streamId); - AbstractStream parentStream; - if (parentStreamId == 0) { - parentStream = this; - } else { - parentStream = getStream(parentStreamId); - if (parentStream == null) { + if (stream != null) { + // stream == null => an old stream already dropped from the map + AbstractStream parentStream; + if (parentStreamId == 0) { parentStream = this; - weight = Constants.DEFAULT_WEIGHT; - exclusive = false; + } else { + parentStream = getStream(parentStreamId); + if (parentStream == null) { + parentStream = this; + weight = Constants.DEFAULT_WEIGHT; + exclusive = false; + } } - } - - if (stream == null) { - // Old stream. Already closed and dropped from the stream map. - } else { stream.rePrioritise(parentStream, exclusive, weight); } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org