summaryrefslogtreecommitdiff
path: root/http_connection.h
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-12-30 22:30:23 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-12-30 22:30:23 +0100
commit2e2221b2eda1c089688b3e87b42b0dc6720f6c59 (patch)
tree4cde9a917494bce8ea15c33acebbfffb34d60711 /http_connection.h
parent757edd54cca1d3bc19617284bba5d008a976f704 (diff)
Added request parser based on Boost.Spirit.
Diffstat (limited to 'http_connection.h')
-rw-r--r--http_connection.h23
1 files changed, 23 insertions, 0 deletions
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 <string>
+#include <vector>
+#include <map>
+
#include <boost/asio.hpp>
#include <boost/enable_shared_from_this.hpp>
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<std::string> path;
+
+ //! Request arguments.
+ std::map<std::string, std::string> args;
+
+ //! Request version.
+ std::string version;
+
+ //! Request headers.
+ std::map<std::string, std::string> headers;
+
+
+ //! Parse request headers.
+ bool parse_request(boost::asio::streambuf& buf);
public:
typedef boost::shared_ptr<Connection> p;