Merge pull request #1381 from neilbu/develop

Made the request parser a member of the Connection
This commit is contained in:
Dennis Luxen 2015-02-12 14:26:48 +01:00
commit fcf9f266ad
2 changed files with 3 additions and 1 deletions

View File

@ -68,7 +68,7 @@ void Connection::handle_read(const boost::system::error_code &error, std::size_t
compression_type compression_type(no_compression);
osrm::tribool result;
std::tie(result, compression_type) =
RequestParser().parse(current_request, incoming_data_buffer.data(),
request_parser.parse(current_request, incoming_data_buffer.data(),
incoming_data_buffer.data() + bytes_transferred);
// the request has been parsed

View File

@ -31,6 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "http/compression_type.hpp"
#include "http/reply.hpp"
#include "http/request.hpp"
#include "request_parser.hpp"
#include <boost/array.hpp>
#include <boost/asio.hpp>
@ -82,6 +83,7 @@ class Connection : public std::enable_shared_from_this<Connection>
boost::asio::io_service::strand strand;
boost::asio::ip::tcp::socket TCP_socket;
RequestHandler &request_handler;
RequestParser request_parser;
boost::array<char, 8192> incoming_data_buffer;
request current_request;
reply current_reply;