Class Http2AsyncUpgradeHandler

    • Field Detail

      • log

        protected static final Log log
      • PING

        protected static final byte[] PING
      • PING_ACK

        protected static final byte[] PING_ACK
      • SETTINGS_ACK

        protected static final byte[] SETTINGS_ACK
      • GOAWAY

        protected static final byte[] GOAWAY
      • connectionId

        protected final String connectionId
      • localSettings

        protected final org.apache.coyote.http2.ConnectionSettingsLocal localSettings
        Local settings are settings defined by Tomcat and sent to the client that the client must use when communicating with Tomcat.
      • activeRemoteStreamCount

        protected final AtomicInteger activeRemoteStreamCount
    • Constructor Detail

    • Method Detail

      • getParser

        protected org.apache.coyote.http2.Http2Parser getParser​(String connectionId)
      • getPingManager

        protected org.apache.coyote.http2.Http2UpgradeHandler.PingManager getPingManager()
      • hasAsyncIO

        public boolean hasAsyncIO()
      • processConnection

        protected void processConnection​(WebConnection webConnection,
                                         org.apache.coyote.http2.Stream stream)
      • writeSettings

        protected void writeSettings()
        Write the initial settings frame and any necessary supporting frames. If the initial settings increase the initial window size, it will also be necessary to send a WINDOW_UPDATE frame to increase the size of the flow control window for the connection (stream 0).
      • writeGoAwayFrame

        protected void writeGoAwayFrame​(int maxStreamId,
                                        long errorCode,
                                        byte[] debugMsg)
                                 throws IOException
        Throws:
        IOException
      • getHeaderFrameBuffers

        protected org.apache.coyote.http2.Http2UpgradeHandler.HeaderFrameBuffers getHeaderFrameBuffers​(int initialPayloadSize)
      • processSendfile

        protected SendfileState processSendfile​(org.apache.coyote.http2.SendfileData sendfile)
        Process send file (if supported) for the given stream. The appropriate request attributes should be set before calling this method.
        Parameters:
        sendfile - The stream and associated data to process
        Returns:
        The result of the send file processing
      • processStreamOnContainerThread

        protected void processStreamOnContainerThread​(org.apache.coyote.http2.Stream stream)
      • setConnectionTimeoutForStreamCount

        protected void setConnectionTimeoutForStreamCount​(int streamCount)
      • createWindowUpdateForSettings

        protected byte[] createWindowUpdateForSettings()
        Returns:
        The WINDOW_UPDATE frame if one is required or an empty array if no WINDOW_UPDATE is required.
      • doWriteHeaders

        protected org.apache.coyote.http2.Http2UpgradeHandler.HeaderFrameBuffers doWriteHeaders​(org.apache.coyote.http2.Stream stream,
                                                                                                int pushedStreamId,
                                                                                                MimeHeaders mimeHeaders,
                                                                                                boolean endOfStream,
                                                                                                int payloadSize)
                                                                                         throws IOException
        Throws:
        IOException
      • getHpackEncoder

        protected org.apache.coyote.http2.HpackEncoder getHpackEncoder()
      • incrementWindowSize

        protected void incrementWindowSize​(int increment)
                                    throws org.apache.coyote.http2.Http2Exception
        Throws:
        org.apache.coyote.http2.Http2Exception
      • getConnectionId

        protected final String getConnectionId()
      • getWeight

        protected final int getWeight()
      • fill

        public boolean fill​(boolean block,
                            byte[] data,
                            int offset,
                            int length)
                     throws IOException
        Throws:
        IOException
      • getMaxFrameSize

        public int getMaxFrameSize()
      • startRequestBodyFrame

        public ByteBuffer startRequestBodyFrame​(int streamId,
                                                int payloadSize,
                                                boolean endOfStream)
                                         throws org.apache.coyote.http2.Http2Exception
        Throws:
        org.apache.coyote.http2.Http2Exception
      • endRequestBodyFrame

        public void endRequestBodyFrame​(int streamId,
                                        int dataLength)
                                 throws org.apache.coyote.http2.Http2Exception,
                                        IOException
        Throws:
        org.apache.coyote.http2.Http2Exception
        IOException
      • receivedEndOfStream

        public void receivedEndOfStream​(int streamId)
                                 throws org.apache.coyote.http2.ConnectionException
        Throws:
        org.apache.coyote.http2.ConnectionException
      • onSwallowedDataFramePayload

        public void onSwallowedDataFramePayload​(int streamId,
                                                int swallowedDataBytesCount)
                                         throws IOException
        Throws:
        IOException
      • headersStart

        public org.apache.coyote.http2.HpackDecoder.HeaderEmitter headersStart​(int streamId,
                                                                               boolean headersEndStream)
                                                                        throws org.apache.coyote.http2.Http2Exception,
                                                                               IOException
        Throws:
        org.apache.coyote.http2.Http2Exception
        IOException
      • reprioritise

        public void reprioritise​(int streamId,
                                 int parentStreamId,
                                 boolean exclusive,
                                 int weight)
                          throws org.apache.coyote.http2.Http2Exception
        Throws:
        org.apache.coyote.http2.Http2Exception
      • headersContinue

        public void headersContinue​(int payloadSize,
                                    boolean endOfHeaders)
      • headersEnd

        public void headersEnd​(int streamId)
                        throws org.apache.coyote.http2.Http2Exception
        Throws:
        org.apache.coyote.http2.Http2Exception
      • reset

        public void reset​(int streamId,
                          long errorCode)
                   throws org.apache.coyote.http2.Http2Exception
        Throws:
        org.apache.coyote.http2.Http2Exception
      • setting

        public void setting​(org.apache.coyote.http2.Setting setting,
                            long value)
                     throws org.apache.coyote.http2.ConnectionException
        Throws:
        org.apache.coyote.http2.ConnectionException
      • pingReceive

        public void pingReceive​(byte[] payload,
                                boolean ack)
                         throws IOException
        Throws:
        IOException
      • goaway

        public void goaway​(int lastStreamId,
                           long errorCode,
                           String debugData)
      • incrementWindowSize

        public void incrementWindowSize​(int streamId,
                                        int increment)
                                 throws org.apache.coyote.http2.Http2Exception
        Throws:
        org.apache.coyote.http2.Http2Exception
      • onSwallowedUnknownFrame

        public void onSwallowedUnknownFrame​(int streamId,
                                            int frameTypeId,
                                            int flags,
                                            int size)
                                     throws IOException
        Throws:
        IOException