PionNetworkLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
pion::http::parser Class Reference

#include <parser.hpp>

Inheritance diagram for pion::http::parser:
Collaboration diagram for pion::http::parser:

Classes

class  error_category_t
 class-specific error category More...
 

Public Types

enum  error_value_t {
  ERROR_METHOD_CHAR = 1, ERROR_METHOD_SIZE, ERROR_URI_CHAR, ERROR_URI_SIZE,
  ERROR_QUERY_CHAR, ERROR_QUERY_SIZE, ERROR_VERSION_EMPTY, ERROR_VERSION_CHAR,
  ERROR_STATUS_EMPTY, ERROR_STATUS_CHAR, ERROR_HEADER_CHAR, ERROR_HEADER_NAME_SIZE,
  ERROR_HEADER_VALUE_SIZE, ERROR_INVALID_CONTENT_LENGTH, ERROR_CHUNK_CHAR, ERROR_MISSING_CHUNK_DATA,
  ERROR_MISSING_HEADER_DATA, ERROR_MISSING_TOO_MUCH_CONTENT
}
 class-specific error code values More...
 
typedef boost::function2< void,
const char *, std::size_t > 
payload_handler_t
 callback type used to consume payload content More...
 

Public Member Functions

 parser (const bool is_request, std::size_t max_content_length=DEFAULT_CONTENT_MAX)
 
virtual ~parser ()
 default destructor More...
 
boost::tribool parse (http::message &http_msg, boost::system::error_code &ec)
 
boost::tribool parse_missing_data (http::message &http_msg, std::size_t len, boost::system::error_code &ec)
 
void finish (http::message &http_msg) const
 
void set_read_buffer (const char *ptr, size_t len)
 
void load_read_pos (const char *&read_ptr, const char *&read_end_ptr) const
 
bool check_premature_eof (http::message &http_msg)
 
void parse_headers_only (bool b=true)
 
void skip_header_parsing (http::message &http_msg)
 
void reset (void)
 resets the parser to its initial state More...
 
bool eof (void) const
 returns true if there are no more bytes available in the read buffer More...
 
std::size_t bytes_available (void) const
 returns the number of bytes available in the read buffer More...
 
std::size_t gcount (void) const
 returns the number of bytes read during the last parse operation More...
 
std::size_t get_total_bytes_read (void) const
 returns the total number of bytes read while parsing the HTTP message More...
 
std::size_t get_content_bytes_read (void) const
 returns the total number of bytes read while parsing the payload content More...
 
std::size_t get_max_content_length (void) const
 returns the maximum length for HTTP payload content More...
 
const std::string & get_raw_headers (void) const
 returns the raw HTTP headers saved by the parser More...
 
bool get_save_raw_headers (void) const
 returns true if the parser is saving raw HTTP header contents More...
 
bool get_parse_headers_only (void)
 returns true if parsing headers only More...
 
bool is_parsing_request (void) const
 returns true if the parser is being used to parse an HTTP request More...
 
bool is_parsing_response (void) const
 returns true if the parser is being used to parse an HTTP response More...
 
void set_payload_handler (payload_handler_t &h)
 defines a callback function to be used for consuming payload content More...
 
void set_max_content_length (std::size_t n)
 sets the maximum length for HTTP payload content More...
 
void reset_max_content_length (void)
 resets the maximum length for HTTP payload content to the default value More...
 
void set_save_raw_headers (bool b)
 sets parameter for saving raw HTTP header content More...
 
void set_logger (logger log_ptr)
 sets the logger to be used More...
 
logger get_logger (void)
 returns the logger currently in use More...
 
boost::tribool finish_header_parsing (http::message &http_msg, boost::system::error_code &ec)
 

Static Public Member Functions

static bool parse_uri (const std::string &uri, std::string &proto, std::string &host, boost::uint16_t &port, std::string &path, std::string &query)
 
static bool parse_url_encoded (ihash_multimap &dict, const char *ptr, const std::size_t len)
 
static bool parse_multipart_form_data (ihash_multimap &dict, const std::string &content_type, const char *ptr, const std::size_t len)
 
static bool parse_cookie_header (ihash_multimap &dict, const char *ptr, const std::size_t len, bool set_cookie_header)
 
static bool parse_cookie_header (ihash_multimap &dict, const std::string &cookie_header, bool set_cookie_header)
 
static bool parse_url_encoded (ihash_multimap &dict, const std::string &query)
 
static bool parse_multipart_form_data (ihash_multimap &dict, const std::string &content_type, const std::string &form_data)
 
static bool parse_forwarded_for (const std::string &header, std::string &public_ip)
 
static error_category_tget_error_category (void)
 returns an instance of parser::error_category_t More...
 

Static Public Attributes

static const std::size_t DEFAULT_CONTENT_MAX = 1024 * 1024
 maximum length for HTTP payload content More...
 

Protected Member Functions

virtual void finished_parsing_headers (const boost::system::error_code &)
 Called after we have finished parsing the HTTP message headers. More...
 
boost::tribool parse_headers (http::message &http_msg, boost::system::error_code &ec)
 
void update_message_with_header_data (http::message &http_msg) const
 
boost::tribool parse_chunks (http::message::chunk_cache_t &chunk_buffers, boost::system::error_code &ec)
 
boost::tribool consume_content (http::message &http_msg, boost::system::error_code &ec)
 
std::size_t consume_content_as_next_chunk (http::message::chunk_cache_t &chunk_buffers)
 

Static Protected Member Functions

static void compute_msg_status (http::message &http_msg, bool msg_parsed_ok)
 
static void set_error (boost::system::error_code &ec, error_value_t ev)
 
static void create_error_category (void)
 creates the unique parser error_category_t More...
 
static bool is_char (int c)
 
static bool is_control (int c)
 
static bool is_special (int c)
 
static bool is_digit (int c)
 
static bool is_hex_digit (int c)
 
static bool is_cookie_attribute (const std::string &name, bool set_cookie_header)
 

Protected Attributes

logger m_logger
 primary logging interface used by this class More...
 
const bool m_is_request
 true if the message is an HTTP request; false if it is an HTTP response More...
 
const char * m_read_ptr
 points to the next character to be consumed in the read_buffer More...
 
const char * m_read_end_ptr
 points to the end of the read_buffer (last byte + 1) More...
 

Static Protected Attributes

static const boost::uint32_t STATUS_MESSAGE_MAX = 1024
 maximum length for response status message More...
 
static const boost::uint32_t METHOD_MAX = 1024
 maximum length for the request method More...
 
static const boost::uint32_t RESOURCE_MAX = 256 * 1024
 maximum length for the resource requested More...
 
static const boost::uint32_t QUERY_STRING_MAX = 1024 * 1024
 maximum length for the query string More...
 
static const boost::uint32_t HEADER_NAME_MAX = 1024
 maximum length for an HTTP header name More...
 
static const boost::uint32_t HEADER_VALUE_MAX = 1024 * 1024
 maximum length for an HTTP header value More...
 
static const boost::uint32_t QUERY_NAME_MAX = 1024
 maximum length for the name of a query string variable More...
 
static const boost::uint32_t QUERY_VALUE_MAX = 1024 * 1024
 maximum length for the value of a query string variable More...
 
static const boost::uint32_t COOKIE_NAME_MAX = 1024
 maximum length for the name of a cookie name More...
 
static const boost::uint32_t COOKIE_VALUE_MAX = 1024 * 1024
 maximum length for the value of a cookie; also used for path and domain More...
 

Detailed Description

parser: parses HTTP messages

Member Typedef Documentation

typedef boost::function2<void, const char *, std::size_t> pion::http::parser::payload_handler_t

callback type used to consume payload content

Member Enumeration Documentation

class-specific error code values

Enumerator
ERROR_METHOD_CHAR 
ERROR_METHOD_SIZE 
ERROR_URI_CHAR 
ERROR_URI_SIZE 
ERROR_QUERY_CHAR 
ERROR_QUERY_SIZE 
ERROR_VERSION_EMPTY 
ERROR_VERSION_CHAR 
ERROR_STATUS_EMPTY 
ERROR_STATUS_CHAR 
ERROR_HEADER_CHAR 
ERROR_HEADER_NAME_SIZE 
ERROR_HEADER_VALUE_SIZE 
ERROR_INVALID_CONTENT_LENGTH 
ERROR_CHUNK_CHAR 
ERROR_MISSING_CHUNK_DATA 
ERROR_MISSING_HEADER_DATA 
ERROR_MISSING_TOO_MUCH_CONTENT 

Constructor & Destructor Documentation

pion::http::parser::parser ( const bool  is_request,
std::size_t  max_content_length = DEFAULT_CONTENT_MAX 
)
inline

creates new parser objects

Parameters
is_requestif true, the message is parsed as an HTTP request; if false, the message is parsed as an HTTP response
max_content_lengthmaximum length for HTTP payload content
virtual pion::http::parser::~parser ( )
inlinevirtual

default destructor

Member Function Documentation

std::size_t pion::http::parser::bytes_available ( void  ) const
inline

returns the number of bytes available in the read buffer

Referenced by pion::http::reader::consume_bytes(), consume_content(), consume_content_as_next_chunk(), and parse_chunks().

bool pion::http::parser::check_premature_eof ( http::message http_msg)
inline

checks to see if a premature EOF was encountered while parsing. This should be called if there is no more data to parse, and if the last call to the parse() function returned boost::indeterminate

Parameters
http_msgthe HTTP message object being parsed
Returns
true if premature EOF, false if message is OK & finished parsing

References pion::http::message::concatenate_chunks().

Referenced by pion::http::message::read(), and pion::http::message::receive().

void pion::http::parser::compute_msg_status ( http::message http_msg,
bool  msg_parsed_ok 
)
staticprotected
boost::tribool pion::http::parser::consume_content ( http::message http_msg,
boost::system::error_code &  ec 
)
protected

consumes payload content in the parser's read buffer

Parameters
http_msgthe HTTP message object to consume content for
ecerror_code contains additional information for parsing errors
Returns
boost::tribool result of parsing: false = message has an error, true = finished parsing message, indeterminate = message is not yet finished

References bytes_available(), pion::http::message::get_content(), and m_read_ptr.

Referenced by parse().

std::size_t pion::http::parser::consume_content_as_next_chunk ( http::message::chunk_cache_t chunk_buffers)
protected

consume the bytes available in the read buffer, converting them into the next chunk for the HTTP message

Parameters
chunk_buffersbuffers to be populated from parsing chunked content
Returns
std::size_t number of content bytes consumed, if any

References bytes_available(), m_read_end_ptr, and m_read_ptr.

Referenced by parse().

void pion::http::parser::create_error_category ( void  )
staticprotected

creates the unique parser error_category_t

Referenced by get_error_category().

bool pion::http::parser::eof ( void  ) const
inline

returns true if there are no more bytes available in the read buffer

Referenced by pion::http::reader::consume_bytes(), parse(), and pion::http::message::receive().

boost::tribool pion::http::parser::finish_header_parsing ( http::message http_msg,
boost::system::error_code &  ec 
)

should be called after parsing HTTP headers, to prepare for payload content parsing available in the read buffer

Parameters
http_msgthe HTTP message object to populate from parsing
ecerror_code contains additional information for parsing errors
Returns
boost::tribool result of parsing: false = message has an error, true = finished parsing HTTP message (no content), indeterminate = payload content is available to be parsed

References pion::http::message::create_content_buffer(), ERROR_INVALID_CONTENT_LENGTH, finished_parsing_headers(), pion::http::message::get_chunk_cache(), pion::http::message::get_content_length(), pion::http::message::has_header(), pion::http::types::HEADER_CONTENT_LENGTH, pion::http::message::is_chunked(), pion::http::message::is_content_length_implied(), m_is_request, m_logger, PION_LOG_ERROR, pion::http::message::set_content_length(), set_error(), pion::http::message::update_content_length_using_header(), update_message_with_header_data(), and pion::http::message::update_transfer_encoding_using_header().

Referenced by parse().

virtual void pion::http::parser::finished_parsing_headers ( const boost::system::error_code &  )
inlineprotectedvirtual

Called after we have finished parsing the HTTP message headers.

Reimplemented in pion::http::response_reader, and pion::http::request_reader.

Referenced by finish_header_parsing().

std::size_t pion::http::parser::gcount ( void  ) const
inline

returns the number of bytes read during the last parse operation

Referenced by pion::http::reader::consume_bytes().

std::size_t pion::http::parser::get_content_bytes_read ( void  ) const
inline

returns the total number of bytes read while parsing the payload content

Referenced by finish().

static error_category_t& pion::http::parser::get_error_category ( void  )
inlinestatic
logger pion::http::parser::get_logger ( void  )
inline

returns the logger currently in use

std::size_t pion::http::parser::get_max_content_length ( void  ) const
inline

returns the maximum length for HTTP payload content

bool pion::http::parser::get_parse_headers_only ( void  )
inline

returns true if parsing headers only

Referenced by pion::http::message::receive().

const std::string& pion::http::parser::get_raw_headers ( void  ) const
inline

returns the raw HTTP headers saved by the parser

bool pion::http::parser::get_save_raw_headers ( void  ) const
inline

returns true if the parser is saving raw HTTP header contents

std::size_t pion::http::parser::get_total_bytes_read ( void  ) const
inline

returns the total number of bytes read while parsing the HTTP message

Referenced by pion::http::message::read(), and pion::http::message::receive().

bool pion::http::parser::is_char ( int  c)
inlinestaticprotected

Referenced by parse_headers().

bool pion::http::parser::is_control ( int  c)
inlinestaticprotected

Referenced by parse_headers().

bool pion::http::parser::is_cookie_attribute ( const std::string &  name,
bool  set_cookie_header 
)
inlinestaticprotected
bool pion::http::parser::is_digit ( int  c)
inlinestaticprotected

Referenced by parse_headers().

bool pion::http::parser::is_hex_digit ( int  c)
inlinestaticprotected

Referenced by parse_chunks().

bool pion::http::parser::is_parsing_request ( void  ) const
inline

returns true if the parser is being used to parse an HTTP request

Referenced by pion::http::reader::consume_bytes(), finish(), and update_message_with_header_data().

bool pion::http::parser::is_parsing_response ( void  ) const
inline

returns true if the parser is being used to parse an HTTP response

bool pion::http::parser::is_special ( int  c)
inlinestaticprotected

Referenced by parse_headers().

void pion::http::parser::load_read_pos ( const char *&  read_ptr,
const char *&  read_end_ptr 
) const
inline

loads a read position bookmark

Parameters
read_ptrpoints to the next character to be consumed in the read_buffer
read_end_ptrpoints to the end of the read_buffer (last byte + 1)

Referenced by pion::http::message::receive().

boost::tribool pion::http::parser::parse ( http::message http_msg,
boost::system::error_code &  ec 
)

parses an HTTP message including all payload content it might contain

Parameters
http_msgthe HTTP message object to populate from parsing
ecerror_code contains additional information for parsing errors
Returns
boost::tribool result of parsing: false = message has an error, true = finished parsing HTTP message, indeterminate = not yet finished parsing HTTP message

References compute_msg_status(), pion::http::message::concatenate_chunks(), consume_content(), consume_content_as_next_chunk(), eof(), finish(), finish_header_parsing(), pion::http::message::get_chunk_cache(), pion::http::message::has_missing_packets(), parse_chunks(), parse_headers(), and pion::http::message::set_data_after_missing_packet().

Referenced by pion::http::reader::consume_bytes(), pion::http::message::read(), and pion::http::message::receive().

boost::tribool pion::http::parser::parse_chunks ( http::message::chunk_cache_t chunk_buffers,
boost::system::error_code &  ec 
)
protected

parses a chunked HTTP message-body using bytes available in the read buffer

Parameters
chunk_buffersbuffers to be populated from parsing chunked content
ecerror_code contains additional information for parsing errors
Returns
boost::tribool result of parsing: false = message has an error, true = finished parsing message, indeterminate = message is not yet finished

References bytes_available(), ERROR_CHUNK_CHAR, is_hex_digit(), m_logger, m_read_end_ptr, m_read_ptr, PION_LOG_DEBUG, and set_error().

Referenced by parse().

static bool pion::http::parser::parse_cookie_header ( ihash_multimap dict,
const char *  ptr,
const std::size_t  len,
bool  set_cookie_header 
)
static

parse key-value pairs out of a "Cookie" request header (i.e. this=that; a=value)

Parameters
dictdictionary for key-values pairs
ptrpoints to the start of the header string to be parsed
lenlength of the encoded string, in bytes
set_cookie_headerset true if parsing Set-Cookie response header
Returns
bool true if successful

Referenced by update_message_with_header_data().

static bool pion::http::parser::parse_cookie_header ( ihash_multimap dict,
const std::string &  cookie_header,
bool  set_cookie_header 
)
inlinestatic

parse key-value pairs out of a "Cookie" request header (i.e. this=that; a=value)

Parameters
dictdictionary for key-values pairs
cookie_headerheader string to be parsed
set_cookie_headerset true if parsing Set-Cookie response header
Returns
bool true if successful
bool pion::http::parser::parse_forwarded_for ( const std::string &  header,
std::string &  public_ip 
)
static

parses an X-Forwarded-For HTTP header, and extracts from it an IP address that best matches the client's public IP address (if any are found)

Parameters
headerthe X-Forwarded-For HTTP header to parse
public_ipthe extract IP address, if found
Returns
bool true if a public IP address was found and extracted

static regex used to check for private/local networks: 10.* 127.* 192.168.* 172.16-31.*

boost::tribool pion::http::parser::parse_headers ( http::message http_msg,
boost::system::error_code &  ec 
)
protected

parses an HTTP message up to the end of the headers using bytes available in the read buffer

Parameters
http_msgthe HTTP message object to populate from parsing
ecerror_code contains additional information for parsing errors
Returns
boost::tribool result of parsing: false = message has an error, true = finished parsing HTTP headers, indeterminate = not yet finished parsing HTTP headers

References pion::http::message::add_header(), ERROR_HEADER_CHAR, ERROR_HEADER_NAME_SIZE, ERROR_HEADER_VALUE_SIZE, ERROR_METHOD_CHAR, ERROR_METHOD_SIZE, ERROR_QUERY_CHAR, ERROR_QUERY_SIZE, ERROR_STATUS_CHAR, ERROR_STATUS_EMPTY, ERROR_URI_CHAR, ERROR_URI_SIZE, ERROR_VERSION_CHAR, ERROR_VERSION_EMPTY, pion::http::message::get_version_major(), pion::http::message::get_version_minor(), HEADER_NAME_MAX, HEADER_VALUE_MAX, is_char(), is_control(), is_digit(), is_special(), m_is_request, m_logger, m_read_end_ptr, m_read_ptr, METHOD_MAX, PION_LOG_DEBUG, QUERY_STRING_MAX, RESOURCE_MAX, set_error(), pion::http::message::set_version_major(), pion::http::message::set_version_minor(), and STATUS_MESSAGE_MAX.

Referenced by parse().

void pion::http::parser::parse_headers_only ( bool  b = true)
inline

controls headers-only parsing (default is disabled; content parsed also)

Parameters
bif true, then the parse() function returns true after headers

Referenced by pion::http::message::read(), and pion::http::message::receive().

boost::tribool pion::http::parser::parse_missing_data ( http::message http_msg,
std::size_t  len,
boost::system::error_code &  ec 
)

attempts to continue parsing despite having missed data (length is known but content is not)

Parameters
http_msgthe HTTP message object to populate from parsing
lenthe length in bytes of the missing data
ecerror_code contains additional information for parsing errors
Returns
boost::tribool result of parsing: false = message has an error, true = finished parsing HTTP message, indeterminate = not yet finished parsing HTTP message

References compute_msg_status(), ERROR_MISSING_CHUNK_DATA, ERROR_MISSING_HEADER_DATA, ERROR_MISSING_TOO_MUCH_CONTENT, finish(), pion::http::message::get_chunk_cache(), pion::http::message::get_content(), set_error(), and pion::http::message::set_missing_packets().

static bool pion::http::parser::parse_multipart_form_data ( ihash_multimap dict,
const std::string &  content_type,
const char *  ptr,
const std::size_t  len 
)
static

parse key-value pairs out of a multipart/form-data payload content (http://www.ietf.org/rfc/rfc2388.txt)

Parameters
dictdictionary for key-values pairs
content_typevalue of the content-type HTTP header
ptrpoints to the start of the encoded data
lenlength of the encoded data, in bytes
Returns
bool true if successful

Referenced by finish().

static bool pion::http::parser::parse_multipart_form_data ( ihash_multimap dict,
const std::string &  content_type,
const std::string &  form_data 
)
inlinestatic

parse key-value pairs out of a multipart/form-data payload content (http://www.ietf.org/rfc/rfc2388.txt)

Parameters
dictdictionary for key-values pairs
content_typevalue of the content-type HTTP header
form_datathe encoded form data
Returns
bool true if successful
bool pion::http::parser::parse_uri ( const std::string &  uri,
std::string &  proto,
std::string &  host,
boost::uint16_t &  port,
std::string &  path,
std::string &  query 
)
static

parses a URI string

Parameters
urithe string to parse
protowill be set to the protocol (i.e. "http")
hostwill be set to the hostname (i.e. "www.cloudmeter.com")
porthost port number to use for connection (i.e. 80)
pathuri stem or file path
queryuri query string
Returns
true if the URI was successfully parsed, false if there was an error
static bool pion::http::parser::parse_url_encoded ( ihash_multimap dict,
const char *  ptr,
const std::size_t  len 
)
static

parse key-value pairs out of a url-encoded string (i.e. this=that&a=value)

Parameters
dictdictionary for key-values pairs
ptrpoints to the start of the encoded string
lenlength of the encoded string, in bytes
Returns
bool true if successful

Referenced by finish(), and update_message_with_header_data().

static bool pion::http::parser::parse_url_encoded ( ihash_multimap dict,
const std::string &  query 
)
inlinestatic

parse key-value pairs out of a url-encoded string (i.e. this=that&a=value)

Parameters
dictdictionary for key-values pairs
querythe encoded query string to be parsed
Returns
bool true if successful
void pion::http::parser::reset ( void  )
inline

resets the parser to its initial state

void pion::http::parser::reset_max_content_length ( void  )
inline

resets the maximum length for HTTP payload content to the default value

static void pion::http::parser::set_error ( boost::system::error_code &  ec,
error_value_t  ev 
)
inlinestaticprotected

sets an error code

Parameters
ecerror code variable to define
everror value to raise

Referenced by finish_header_parsing(), parse_chunks(), parse_headers(), and parse_missing_data().

void pion::http::parser::set_logger ( logger  log_ptr)
inline
void pion::http::parser::set_max_content_length ( std::size_t  n)
inline

sets the maximum length for HTTP payload content

Referenced by pion::http::message::read(), and pion::http::message::receive().

void pion::http::parser::set_payload_handler ( payload_handler_t h)
inline

defines a callback function to be used for consuming payload content

void pion::http::parser::set_read_buffer ( const char *  ptr,
size_t  len 
)
inline

resets the location and size of the read buffer

Parameters
ptrpointer to the first bytes available to be read
lennumber of bytes available to be read

Referenced by pion::http::reader::consume_bytes(), pion::http::message::read(), and pion::http::message::receive().

void pion::http::parser::set_save_raw_headers ( bool  b)
inline

sets parameter for saving raw HTTP header content

void pion::http::parser::skip_header_parsing ( http::message http_msg)
inline

skip parsing all headers and parse payload content only

Parameters
http_msgthe HTTP message object being parsed

Member Data Documentation

const boost::uint32_t pion::http::parser::COOKIE_NAME_MAX = 1024
staticprotected

maximum length for the name of a cookie name

const boost::uint32_t pion::http::parser::COOKIE_VALUE_MAX = 1024 * 1024
staticprotected

maximum length for the value of a cookie; also used for path and domain

const std::size_t pion::http::parser::DEFAULT_CONTENT_MAX = 1024 * 1024
static

maximum length for HTTP payload content

const boost::uint32_t pion::http::parser::HEADER_NAME_MAX = 1024
staticprotected

maximum length for an HTTP header name

Referenced by parse_headers().

const boost::uint32_t pion::http::parser::HEADER_VALUE_MAX = 1024 * 1024
staticprotected

maximum length for an HTTP header value

Referenced by parse_headers().

const bool pion::http::parser::m_is_request
protected

true if the message is an HTTP request; false if it is an HTTP response

Referenced by finish_header_parsing(), and parse_headers().

logger pion::http::parser::m_logger
mutableprotected
const char* pion::http::parser::m_read_end_ptr
protected
const char* pion::http::parser::m_read_ptr
protected

points to the next character to be consumed in the read_buffer

Referenced by pion::http::reader::consume_bytes(), consume_content(), consume_content_as_next_chunk(), parse_chunks(), parse_headers(), and pion::http::reader::receive().

const boost::uint32_t pion::http::parser::METHOD_MAX = 1024
staticprotected

maximum length for the request method

Referenced by parse_headers().

const boost::uint32_t pion::http::parser::QUERY_NAME_MAX = 1024
staticprotected

maximum length for the name of a query string variable

const boost::uint32_t pion::http::parser::QUERY_STRING_MAX = 1024 * 1024
staticprotected

maximum length for the query string

Referenced by parse_headers().

const boost::uint32_t pion::http::parser::QUERY_VALUE_MAX = 1024 * 1024
staticprotected

maximum length for the value of a query string variable

const boost::uint32_t pion::http::parser::RESOURCE_MAX = 256 * 1024
staticprotected

maximum length for the resource requested

Referenced by parse_headers().

const boost::uint32_t pion::http::parser::STATUS_MESSAGE_MAX = 1024
staticprotected

maximum length for response status message

Referenced by parse_headers().


The documentation for this class was generated from the following files: