From 2e2221b2eda1c089688b3e87b42b0dc6720f6c59 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Thu, 30 Dec 2010 22:30:23 +0100 Subject: Added request parser based on Boost.Spirit. --- http_connection.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'http_connection.h') diff --git a/http_connection.h b/http_connection.h index f166f44..b6d6e27 100644 --- a/http_connection.h +++ b/http_connection.h @@ -1,6 +1,10 @@ #ifndef HTTP_CONNECTION_H #define HTTP_CONNECTION_H +#include +#include +#include + #include #include using boost::asio::ip::tcp; @@ -15,6 +19,25 @@ namespace HTTP { void handle_read(const boost::system::error_code& error, size_t bytes_transferred); tcp::socket socket; boost::asio::streambuf buf; + + //! Request method. + std::string method; + + //! Request path. + std::vector path; + + //! Request arguments. + std::map args; + + //! Request version. + std::string version; + + //! Request headers. + std::map headers; + + + //! Parse request headers. + bool parse_request(boost::asio::streambuf& buf); public: typedef boost::shared_ptr p; -- cgit v1.2.3