hunt.http.codec.http.decode.HttpParser

Undocumented in source.

Members

Aliases

HttpParserState
alias HttpParserState = HttpParser.State
Undocumented in source.
HttpRequestHandler
deprecated alias HttpRequestHandler = HttpRequestParsingHandler
Undocumented in source.
HttpResponseHandler
deprecated alias HttpResponseHandler = HttpResponseParsingHandler
Undocumented in source.

Classes

HttpParser
class HttpParser

A Parser for 1.0 and 1.1 as defined by RFC7230 <p> This parser parses HTTP client and server messages from buffers passed in the {@link #parseNext(ByteBuffer)} method. The parsed elements of the HTTP message are passed as event calls to the {@link HttpHandler} instance the parser is constructed with. If the passed handler is a {@link RequestHandler} then server side parsing is performed and if it is a {@link ResponseHandler}, then client side parsing is done. </p> <p> The contract of the {@link HttpHandler} API is that if a call returns true then the call to {@link #parseNext(ByteBuffer)} will return as soon as possible also with a true response. Typically this indicates that the parsing has reached a stage where the caller should process the events accumulated by the handler. It is the preferred calling style that handling such as calling a servlet to process a request, should be done after a true return from {@link #parseNext(ByteBuffer)} rather than from within the scope of a call like {@link RequestHandler#messageComplete()} </p> <p> For performance, the parse is heavily dependent on the {@link Trie#getBest(ByteBuffer, int, int)} method to look ahead in a single pass for both the structure ( : and CRLF ) and semantic (which header and value) of a header. Specifically the static {@link HttpHeader#CACHE} is used to lookup common combinations of headers and values (eg. "Connection: close"), or just header names (eg. "Connection:" ). For headers who's value is not known statically (eg. Host, COOKIE) then a per parser dynamic Trie of {@link HttpFields} from previous parsed messages is used to help the parsing of subsequent messages. </p> <p> The parser can work in varying compliance modes: <dl> <dt>RFC7230</dt><dd>(default) Compliance with RFC7230</dd> <dt>RFC2616</dt><dd>Wrapped headers and HTTP/0.9 supported</dd> <dt>LEGACY</dt><dd>(aka STRICT) Adherence to Servlet Specification requirement for exact case of header names, bypassing the header caches, which are case insensitive, otherwise equivalent to RFC2616</dd> </dl>

Interfaces

ComplianceParsingHandler
interface ComplianceParsingHandler
Undocumented in source.
HttpParsingHandler
interface HttpParsingHandler
Undocumented in source.
HttpRequestParsingHandler
interface HttpRequestParsingHandler
Undocumented in source.
HttpResponseParsingHandler
interface HttpResponseParsingHandler
Undocumented in source.

Meta