From 77b0a5908e0871b1d3b8aae7b5a8cd241dff9d63 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sun, 2 Jan 2011 13:41:11 +0100 Subject: Copy buffer contents to string to workaround bug with boost::asio::buffers_iterator. --- http_connection.cpp | 8 +++++--- 1 file 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 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 word_p = +(qi::char_ - ' ' - '\r'); -- cgit v1.2.3