|
pion-net
4.0.9
|
#include <HTTPResponseReader.hpp>
Inherits pion::net::HTTPReader.
Public Types | |
|
typedef boost::function3< void, HTTPResponsePtr, TCPConnectionPtr, const boost::system::error_code & > | FinishedHandler |
| function called after the HTTP message has been parsed | |
Static Public Member Functions | |
| static boost::shared_ptr < HTTPResponseReader > | create (TCPConnectionPtr &tcp_conn, const HTTPRequest &http_request, FinishedHandler handler) |
Protected Member Functions | |
| HTTPResponseReader (TCPConnectionPtr &tcp_conn, const HTTPRequest &http_request, 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. | |
Protected Member Functions inherited from pion::net::HTTPReader | |
| 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. | |
Protected Member Functions inherited from pion::net::HTTPParser | |
| 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 | |
| HTTPResponsePtr | 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 | |
Public Member Functions inherited from pion::net::HTTPReader | |
| 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 Public Attributes inherited from pion::net::HTTPParser | |
| static const std::size_t | DEFAULT_CONTENT_MAX = 1024 * 1024 |
| maximum length for HTTP payload content | |
Static Protected Member Functions inherited from pion::net::HTTPParser | |
| 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 Protected Attributes inherited from pion::net::HTTPParser | |
| 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 | |
HTTPResponseReader: asynchronously reads and parses HTTP responses
Definition at line 31 of file HTTPResponseReader.hpp.
|
inlineprotected |
protected constructor restricts creation of objects (use create())
| tcp_conn | TCP connection containing a new message to parse |
| http_request | the request we are responding to |
| handler | function called after the message has been parsed |
Definition at line 71 of file HTTPResponseReader.hpp.
References m_http_msg, and pion::net::HTTPParser::setLogger().
Referenced by create().
|
inlinestatic |
creates new HTTPResponseReader objects
| tcp_conn | TCP connection containing a new message to parse |
| http_request | the request we are responding to |
| handler | function called after the message has been parsed |
Definition at line 54 of file HTTPResponseReader.hpp.
References HTTPResponseReader().
1.8.1.2