pion-net  4.0.9
Public Types | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
pion::net::HTTPRequestReader Class Reference

#include <HTTPRequestReader.hpp>

Inherits pion::net::HTTPReader.

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 HTTPMessagegetMessage (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

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

- 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

Detailed Description

HTTPRequestReader: asynchronously reads and parses HTTP requests

Definition at line 31 of file HTTPRequestReader.hpp.

Constructor & Destructor Documentation

pion::net::HTTPRequestReader::HTTPRequestReader ( TCPConnectionPtr &  tcp_conn,
FinishedHandler  handler 
)
inlineprotected

protected constructor restricts creation of objects (use create())

Parameters
tcp_connTCP connection containing a new message to parse
handlerfunction 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().

Member Function Documentation

static boost::shared_ptr<HTTPRequestReader> pion::net::HTTPRequestReader::create ( TCPConnectionPtr &  tcp_conn,
FinishedHandler  handler 
)
inlinestatic

creates new HTTPRequestReader objects

Parameters
tcp_connTCP connection containing a new message to parse
handlerfunction called after the message has been parsed

Definition at line 53 of file HTTPRequestReader.hpp.

References HTTPRequestReader().

Referenced by pion::net::HTTPServer::handleConnection().


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