10 #ifndef __PION_HTTPRESPONSEREADER_HEADER__
11 #define __PION_HTTPRESPONSEREADER_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/HTTPResponse.hpp>
21 #include <pion/net/HTTPReader.hpp>
33 public boost::enable_shared_from_this<HTTPResponseReader>
39 typedef boost::function3<void, HTTPResponsePtr, TCPConnectionPtr,
53 static inline boost::shared_ptr<HTTPResponseReader>
57 return boost::shared_ptr<HTTPResponseReader>
76 m_http_msg->setRemoteIp(tcp_conn->getRemoteIp());
77 setLogger(PION_GET_LOGGER(
"pion.net.HTTPResponseReader"));
84 boost::asio::placeholders::error,
85 boost::asio::placeholders::bytes_transferred));
107 typedef boost::shared_ptr<HTTPResponseReader> HTTPResponseReaderPtr;
virtual void finishedReading(const boost::system::error_code &ec)
Called after we have finished reading/parsing the HTTP message.
boost::function3< void, HTTPResponsePtr, TCPConnectionPtr, const boost::system::error_code & > FinishedHandler
function called after the HTTP message has been parsed
void consumeBytes(void)
Consumes bytes that have been read using an HTTP parser.
FinishedHandler m_finished
function called after the HTTP message has been parsed
virtual void readBytes(void)
Reads more bytes from the TCP connection.
HTTPResponseReader(TCPConnectionPtr &tcp_conn, const HTTPRequest &http_request, FinishedHandler handler)
TCPConnectionPtr & getTCPConnection(void)
returns a shared pointer to the TCP connection
void setLogger(PionLogger log_ptr)
sets the logger to be used
static boost::shared_ptr< HTTPResponseReader > create(TCPConnectionPtr &tcp_conn, const HTTPRequest &http_request, FinishedHandler handler)
HTTPResponsePtr m_http_msg
The new HTTP message container being created.
virtual HTTPMessage & getMessage(void)
Returns a reference to the HTTP message being parsed.