10 #ifndef __PION_HTTPREQUESTREADER_HEADER__
11 #define __PION_HTTPREQUESTREADER_HEADER__
13 #include <boost/asio.hpp>
14 #include <boost/bind.hpp>
15 #include <boost/function.hpp>
16 #include <boost/function/function2.hpp>
17 #include <boost/shared_ptr.hpp>
18 #include <boost/enable_shared_from_this.hpp>
19 #include <pion/PionConfig.hpp>
20 #include <pion/net/HTTPRequest.hpp>
21 #include <pion/net/HTTPReader.hpp>
33 public boost::enable_shared_from_this<HTTPRequestReader>
39 typedef boost::function3<void, HTTPRequestPtr, TCPConnectionPtr,
52 static inline boost::shared_ptr<HTTPRequestReader>
53 create(TCPConnectionPtr& tcp_conn, FinishedHandler handler)
55 return boost::shared_ptr<HTTPRequestReader>
72 m_http_msg->setRemoteIp(tcp_conn->getRemoteIp());
73 setLogger(PION_GET_LOGGER(
"pion.net.HTTPRequestReader"));
80 boost::asio::placeholders::error,
81 boost::asio::placeholders::bytes_transferred));
102 typedef boost::shared_ptr<HTTPRequestReader> HTTPRequestReaderPtr;
virtual HTTPMessage & getMessage(void)
Returns a reference to the HTTP message being parsed.
void consumeBytes(void)
Consumes bytes that have been read using an HTTP parser.
static boost::shared_ptr< HTTPRequestReader > create(TCPConnectionPtr &tcp_conn, FinishedHandler handler)
TCPConnectionPtr & getTCPConnection(void)
returns a shared pointer to the TCP connection
void setLogger(PionLogger log_ptr)
sets the logger to be used
HTTPRequestPtr m_http_msg
The new HTTP message container being created.
virtual void finishedReading(const boost::system::error_code &ec)
Called after we have finished reading/parsing the HTTP message.
FinishedHandler m_finished
function called after the HTTP message has been parsed
virtual void readBytes(void)
Reads more bytes from the TCP connection.
the following enables use of the lock-free cache
boost::function3< void, HTTPRequestPtr, TCPConnectionPtr, const boost::system::error_code & > FinishedHandler
function called after the HTTP message has been parsed
HTTPRequestReader(TCPConnectionPtr &tcp_conn, FinishedHandler handler)