pion-net
4.0.9
|
#include <HTTPRequestReader.hpp>
Inherits pion::net::HTTPReader, and enable_shared_from_this< HTTPRequestReader >.
Public Types | |
typedef boost::function3< void, HTTPRequestPtr, TCPConnectionPtr, const boost::system::error_code & > | FinishedHandler |
function called after the HTTP message has been parsed | |
Static Public Member Functions | |
static boost::shared_ptr < HTTPRequestReader > | create (TCPConnectionPtr &tcp_conn, FinishedHandler handler) |
Protected Member Functions | |
HTTPRequestReader (TCPConnectionPtr &tcp_conn, FinishedHandler handler) | |
virtual void | readBytes (void) |
Reads more bytes from the TCP connection. | |
virtual void | finishedReading (const boost::system::error_code &ec) |
Called after we have finished reading/parsing the HTTP message. | |
virtual HTTPMessage & | getMessage (void) |
Returns a reference to the HTTP message being parsed. | |
![]() | |
HTTPReader (const bool is_request, TCPConnectionPtr &tcp_conn) | |
void | consumeBytes (const boost::system::error_code &read_error, std::size_t bytes_read) |
void | consumeBytes (void) |
Consumes bytes that have been read using an HTTP parser. | |
![]() | |
boost::tribool | parseHeaders (HTTPMessage &http_msg, boost::system::error_code &ec) |
void | updateMessageWithHeaderData (HTTPMessage &http_msg) const |
boost::tribool | finishHeaderParsing (HTTPMessage &http_msg, boost::system::error_code &ec) |
boost::tribool | parseChunks (HTTPMessage::ChunkCache &chunk_buffers, boost::system::error_code &ec) |
boost::tribool | consumeContent (HTTPMessage &http_msg, boost::system::error_code &ec) |
std::size_t | consumeContentAsNextChunk (HTTPMessage::ChunkCache &chunk_buffers) |
Protected Attributes | |
HTTPRequestPtr | m_http_msg |
The new HTTP message container being created. | |
FinishedHandler | m_finished |
function called after the HTTP message has been parsed | |
Additional Inherited Members | |
![]() | |
void | receive (void) |
Incrementally reads & parses the HTTP message. | |
TCPConnectionPtr & | getTCPConnection (void) |
returns a shared pointer to the TCP connection | |
void | setTimeout (boost::uint32_t seconds) |
sets the maximum number of seconds for read operations | |
![]() | |
static const std::size_t | DEFAULT_CONTENT_MAX = 1024 * 1024 |
maximum length for HTTP payload content | |
![]() | |
static void | computeMsgStatus (HTTPMessage &http_msg, bool msg_parsed_ok) |
static void | setError (boost::system::error_code &ec, ErrorValue ev) |
static void | createErrorCategory (void) |
creates the unique HTTPParser ErrorCategory | |
static bool | isChar (int c) |
static bool | isControl (int c) |
static bool | isSpecial (int c) |
static bool | isDigit (int c) |
static bool | isHexDigit (int c) |
static bool | isCookieAttribute (const std::string &name, bool set_cookie_header) |
![]() | |
static const boost::uint32_t | STATUS_MESSAGE_MAX = 1024 |
maximum length for response status message | |
static const boost::uint32_t | METHOD_MAX = 1024 |
maximum length for the request method | |
static const boost::uint32_t | RESOURCE_MAX = 256 * 1024 |
maximum length for the resource requested | |
static const boost::uint32_t | QUERY_STRING_MAX = 1024 * 1024 |
maximum length for the query string | |
static const boost::uint32_t | HEADER_NAME_MAX = 1024 |
maximum length for an HTTP header name | |
static const boost::uint32_t | HEADER_VALUE_MAX = 1024 * 1024 |
maximum length for an HTTP header value | |
static const boost::uint32_t | QUERY_NAME_MAX = 1024 |
maximum length for the name of a query string variable | |
static const boost::uint32_t | QUERY_VALUE_MAX = 1024 * 1024 |
maximum length for the value of a query string variable | |
static const boost::uint32_t | COOKIE_NAME_MAX = 1024 |
maximum length for the name of a cookie name | |
static const boost::uint32_t | COOKIE_VALUE_MAX = 1024 * 1024 |
maximum length for the value of a cookie; also used for path and domain | |
HTTPRequestReader: asynchronously reads and parses HTTP requests
Definition at line 31 of file HTTPRequestReader.hpp.
|
inlineprotected |
protected constructor restricts creation of objects (use create())
tcp_conn | TCP connection containing a new message to parse |
handler | function called after the message has been parsed |
Definition at line 68 of file HTTPRequestReader.hpp.
References m_http_msg, and pion::net::HTTPParser::setLogger().
Referenced by create().
|
inlinestatic |
creates new HTTPRequestReader objects
tcp_conn | TCP connection containing a new message to parse |
handler | function called after the message has been parsed |
Definition at line 53 of file HTTPRequestReader.hpp.
References HTTPRequestReader().
Referenced by pion::net::HTTPServer::handleConnection().