Author: markt Date: Thu Oct 8 19:14:31 2015 New Revision: 1707608 URL: http://svn.apache.org/viewvc?rev=1707608&view=rev Log: Implement some more Processor actions for HTTP/2.
Modified: tomcat/trunk/java/org/apache/coyote/http2/Stream.java tomcat/trunk/java/org/apache/coyote/http2/StreamProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/http2/Stream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Stream.java?rev=1707608&r1=1707607&r2=1707608&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http2/Stream.java (original) +++ tomcat/trunk/java/org/apache/coyote/http2/Stream.java Thu Oct 8 19:14:31 2015 @@ -442,6 +442,10 @@ public class Stream extends AbstractStre return false; } + synchronized void reset() { + buffer.clear(); + } + synchronized boolean isReady() { if (getWindowSize() > 0 && handler.getWindowSize() > 0) { return true; Modified: tomcat/trunk/java/org/apache/coyote/http2/StreamProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/StreamProcessor.java?rev=1707608&r1=1707607&r2=1707608&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http2/StreamProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http2/StreamProcessor.java Thu Oct 8 19:14:31 2015 @@ -177,12 +177,38 @@ public class StreamProcessor extends Abs } break; } + case AVAILABLE: { + request.setAvailable(stream.getInputBuffer().available()); + break; + } + case RESET: { + stream.getOutputBuffer().reset(); + break; + } + + // Error handling case IS_ERROR: { ((AtomicBoolean) param).set(getErrorState().isError()); break; } - case AVAILABLE: { - request.setAvailable(stream.getInputBuffer().available()); + case CLOSE_NOW: { + // No need to block further output. This is called by the error + // reporting valve if the response is already committed. It will + // flush any remaining response data before this call. + // Setting the error state will then cause this stream to be reset. + setErrorState(ErrorState.CLOSE_NOW, null); + break; + } + case DISABLE_SWALLOW_INPUT: { + // NO-OP + // HTTP/2 has to swallow any input received to ensure that the flow + // control windows are correctly tracked. + break; + } + case END_REQUEST: { + // NO-OP + // This action is geared towards handling HTTP/1.1 expectations and + // keep-alive. Does not apply to HTTP/2 streams. break; } @@ -358,11 +384,7 @@ public class StreamProcessor extends Abs sm.getString("streamProcessor.httpupgrade.notsupported")); // Unimplemented / to review - case CLOSE_NOW: - case DISABLE_SWALLOW_INPUT: - case END_REQUEST: case REQ_SET_BODY_REPLAY: - case RESET: log.info("TODO: Implement [" + actionCode + "] for HTTP/2"); break; } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org