HttpHeaderParser

HttpHeaderParser class

Constructors

this
this()

Constructor

this
this(size_t size_limit, size_t lines_limit)

Constructor

Members

Aliases

opCall
alias opCall = parse
Undocumented in source.

Functions

header_elements
HeaderElement[] header_elements()

Obtains a list of HeaderElement instances referring to the header lines parsed so far. The key member of each element references the slice of the corresponding header line before the first ':', the val member the slice after the first ':'. Leading and tailing white space is trimmed off both key and val.

header_length_limit
size_t header_length_limit()
header_length_limit
size_t header_length_limit(size_t n)

Sets the HTTP message header size limit. This will reset the parse state and clear the content.

header_lines
cstring[] header_lines()
header_lines_limit
size_t header_lines_limit()
header_lines_limit
size_t header_lines_limit(size_t n)

Sets the limit for the number of HTTP message header lines.

parse
cstring parse(cstring content)

Parses content which is expected to be either the start of a HTTP message or a HTTP message fragment that continues the content passed on the last call to this method. Appends the slice of content which is part of the HTTP message header (that is, everything before the end-of-header token "\r\n\r\n" or content itself if it does not contain that token). After the end of the message header has been reached, which is indicated by a non-null return value, reset() must be called before calling this method again. Leading empty header lines are tolerated and ignored:

reset
typeof(this) reset()

Resets the parse state and clears the content.

Static variables

DefaultLinesLimit
size_t DefaultLinesLimit;

Default values for header size limitation

DefaultSizeLimit
size_t DefaultSizeLimit;

Default values for header size limitation

Variables

object_pool_index
size_t object_pool_index;

Object pool index -- allows the construction of a pool of objects of this type.

start_line_tokens
cstring[3] start_line_tokens;

Start line tokens; slice the internal content buffer

Inherited Members

From IHttpHeaderParser

HeaderElement
struct HeaderElement

Header element

header_elements
HeaderElement[] header_elements()

Obtains a list of HeaderElement instances referring to the header lines parsed so far. The key member of each element references the slice of the corresponding header line before the first ':', the val member the slice after the first ':'. Leading and tailing white space is trimmed off both key and val.

header_lines
cstring[] header_lines()
header_lines_limit
size_t header_lines_limit()
header_lines_limit
size_t header_lines_limit(size_t n)

Sets the limit for the number of HTTP message header lines.

header_length_limit
size_t header_length_limit()
header_length_limit
size_t header_length_limit(size_t n)

Sets the HTTP message header size limit. This will reset the parse state and clear the content.

Meta