Class HttpRequestParser


  • public abstract class HttpRequestParser
    extends Object
    The basic HTTP parser. The actual parser is a sub class of this class that is generated as part of the build process by the AbstractParserGenerator annotation processor.

    The actual processor is a state machine, that means that for common header, method, protocol values it will return an interned string, rather than creating a new string for each one.

    Author:
    Stuart Douglas
    • Field Detail

      • HTTP_LENGTH

        public static final int HTTP_LENGTH
    • Constructor Detail

      • HttpRequestParser

        public HttpRequestParser​(org.xnio.OptionMap options)
    • Method Detail

      • instance

        public static final HttpRequestParser instance​(org.xnio.OptionMap options)
      • handle

        public void handle​(ByteBuffer buffer,
                           io.undertow.server.protocol.http.ParseState currentState,
                           HttpServerExchange builder)
      • handleCachedHeader

        protected boolean handleCachedHeader​(String existing,
                                             ByteBuffer buffer,
                                             io.undertow.server.protocol.http.ParseState state,
                                             HttpServerExchange builder)
      • handleAfterVersion

        protected void handleAfterVersion​(ByteBuffer buffer,
                                          io.undertow.server.protocol.http.ParseState state)
      • httpStrings

        protected static Map<String,​HttpString> httpStrings()
        This is a bit of hack to enable the parser to get access to the HttpString's that are sorted in the static fields of the relevant classes. This means that in most cases a HttpString comparison will take the fast path == route, as they will be the same object
        Returns: