Author: markt Date: Wed Oct 26 18:06:17 2016 New Revision: 1766718 URL: http://svn.apache.org/viewvc?rev=1766718&view=rev Log: Correctly differentiate between sending and receiving a reset frame when tracking the state of an HTTP/2 stream.
Modified: tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/LocalStrings.properties tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/Stream.java tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/LocalStrings.properties?rev=1766718&r1=1766717&r2=1766718&view=diff ============================================================================== --- tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/LocalStrings.properties (original) +++ tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/LocalStrings.properties Wed Oct 26 18:06:17 2016 @@ -75,8 +75,9 @@ stream.header.unexpectedPseudoHeader=Con stream.header.unknownPseudoHeader=Connection [{0}], Stream [{1}], Unknown pseduo header [{2}] received stream.notWritable=Connection [{0}], Stream [{1}], This stream is not writable stream.reprioritisation.debug=Connection [{0}], Stream [{1}], Exclusive [{2}], Parent [{3}], Weight [{4}] -stream.reset.debug=Connection [{0}], Stream [{1}], Reset due to [{2}] stream.reset.fail=Connection [{0}], Stream [{1}], Failed to reset stream +stream.reset.receive=Connection [{0}], Stream [{1}], Reset received due to [{2}] +stream.reset.send=Connection [{0}], Stream [{1}], Reset sent due to [{2}] stream.trialerHeader.noEndOfStream=Connection [{0}], Stream [{1}], The trailer headers did not include the end of stream flag stream.write=Connection [{0}], Stream [{1}] Modified: tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/Stream.java URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/Stream.java?rev=1766718&r1=1766717&r2=1766718&view=diff ============================================================================== --- tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/Stream.java (original) +++ tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/Stream.java Wed Oct 26 18:06:17 2016 @@ -413,21 +413,6 @@ public class Stream extends AbstractStre } - /** - * Marks the stream as reset. This method will not change the stream state - * if: - * <ul> - * <li>The stream is already reset</li> - * <li>The stream is already closed</li> - * - * @throws IllegalStateException If the stream is in a state that does not - * permit resets - */ - void sendReset() { - state.sendReset(); - } - - void sentPushPromise() { state.sentPushPromise(); } @@ -462,7 +447,11 @@ public class Stream extends AbstractStre if (http2Exception instanceof StreamException) { try { StreamException se = (StreamException) http2Exception; - receiveReset(se.getError().getCode()); + if (log.isDebugEnabled()) { + log.debug(sm.getString("stream.reset.send", getConnectionId(), getIdentifier(), + Long.toString(se.getError().getCode()))); + } + state.sendReset(); handler.sendStreamReset(se); } catch (IOException ioe) { ConnectionException ce = new ConnectionException( Modified: tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml?rev=1766718&r1=1766717&r2=1766718&view=diff ============================================================================== --- tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml Wed Oct 26 18:06:17 2016 @@ -123,6 +123,10 @@ trailer headers allowed and the maximum number of cookies allowed. (markt) </add> + <fix> + Correctly differentiate between sending and receiving a reset frame when + tracking the state of an HTTP/2 stream. (markt) + </fix> </changelog> </subsection> <subsection name="Jasper"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org