diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-01-02 13:41:11 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-01-02 13:41:11 +0100 |
commit | 77b0a5908e0871b1d3b8aae7b5a8cd241dff9d63 (patch) | |
tree | 53037cb3a16f6711fbd9b4d10118214be170b64a | |
parent | 1a5f29542ff55be2bf31e164448c0c6e8179ee38 (diff) |
Copy buffer contents to string to workaround bug with boost::asio::buffers_iterator.
-rw-r--r-- | http_connection.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/http_connection.cpp b/http_connection.cpp index e682037..0873985 100644 --- a/http_connection.cpp +++ b/http_connection.cpp @@ -62,10 +62,12 @@ void print(char c) { } bool HTTP::Connection::parse_request(boost::asio::streambuf& buf) { - typedef boost::asio::buffers_iterator<boost::asio::streambuf::const_buffers_type> Iterator; + std::string data(boost::asio::buffers_begin(buf.data()), boost::asio::buffers_end(buf.data())); - Iterator begin = Iterator::begin(buf.data()); - Iterator end = Iterator::end(buf.data()); + typedef std::string::const_iterator Iterator; + + Iterator begin = data.begin(); + Iterator end = data.end(); qi::rule<Iterator, std::string()> word_p = +(qi::char_ - ' ' - '\r'); |