HttpHeaderParser.parse

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:

"In the interest of robustness, servers SHOULD ignore any empty line(s) received where a Request-Line is expected."

@see http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.1

class HttpHeaderParser
parse

Return Value

Type: cstring

A slice of content after the end-of-header token (which may be an empty string) or null if content does not contain the end-of-header token.

Throws

HttpParseException - on parse error: if * the number of start line tokens is different from 3 or * a regular header_line does not contain a ':'; - on limit excess: if * the header size in bytes exceeds the requested limit or * the number of header lines in exceeds the requested limit.

Assert()s that this method is not called after the end of header had been reacched.

Meta