Class HttpChannelOverHttp

    • Field Detail

      • LOG

        private static final Logger LOG
      • PREAMBLE_UPGRADE_H2C

        private static final HttpField PREAMBLE_UPGRADE_H2C
      • _delayedForContent

        private boolean _delayedForContent
      • _unknownExpectation

        private boolean _unknownExpectation
      • _expect100Continue

        private boolean _expect100Continue
      • _expect102Processing

        private boolean _expect102Processing
      • _complianceViolations

        private java.util.List<java.lang.String> _complianceViolations
    • Method Detail

      • startRequest

        public boolean startRequest​(java.lang.String method,
                                    java.lang.String requestTarget,
                                    HttpVersion version)
        Description copied from interface: HttpParser.RequestHandler
        This is the method called by parser when the HTTP request line is parsed
        Specified by:
        startRequest in interface HttpParser.RequestHandler
        Parameters:
        method - The method
        requestTarget - The raw bytes of the URI. These are copied into a ByteBuffer that will not be changed until this parser is reset and reused.
        version - the http version in use
        Returns:
        true if handling parsing should return.
      • continue100

        public void continue100​(int available)
                         throws java.io.IOException
        If the associated response has the Expect header set to 100 Continue, then accessing the input stream indicates that the handler/servlet is ready for the request body and thus a 100 Continue response is sent.
        Overrides:
        continue100 in class HttpChannel
        Parameters:
        available - estimate of the number of bytes that are available
        Throws:
        java.io.IOException - if the InputStream cannot be created
      • onIdleTimeout

        boolean onIdleTimeout​(java.lang.Throwable timeout)
      • upgrade

        private boolean upgrade()
                         throws BadMessageException

        Attempts to perform an HTTP/1.1 upgrade.

        The upgrade looks up a ConnectionFactory.Upgrading from the connector matching the protocol specified in the Upgrade header.

        The upgrade may succeed, be ignored (which can allow a later handler to implement) or fail with a BadMessageException.

        Returns:
        true if the upgrade was performed, false if it was ignored
        Throws:
        BadMessageException - if the upgrade failed
      • handleException

        protected void handleException​(java.lang.Throwable x)
        Description copied from class: HttpChannel

        Sends an error 500, performing a special logic to detect whether the request is suspended, to avoid concurrent writes from the application.

        It may happen that the application suspends, and then throws an exception, while an application spawned thread writes the response content; in such case, we attempt to commit the error directly bypassing the ErrorHandler mechanisms and the response OutputStream.

        Overrides:
        handleException in class HttpChannel
        Parameters:
        x - the Throwable that caused the problem
      • abort

        public void abort​(java.lang.Throwable failure)
        Description copied from class: HttpChannel
        If a write or similar operation to this channel fails, then this method should be called.

        The standard implementation calls HttpTransport.abort(Throwable).

        Overrides:
        abort in class HttpChannel
        Parameters:
        failure - the failure that caused the abort.