move tribool obj into request_parser

This commit is contained in:
karenzshea
2016-01-28 18:43:19 -05:00
committed by Patrick Niklaus
parent efee07e20b
commit 262cdd7bc0
4 changed files with 80 additions and 93 deletions
+3 -3
View File
@@ -41,13 +41,13 @@ void Connection::handle_read(const boost::system::error_code &error, std::size_t
// no error detected, let's parse the request
http::compression_type compression_type(http::no_compression);
util::tribool result;
RequestStatus result;
std::tie(result, compression_type) =
request_parser.parse(current_request, incoming_data_buffer.data(),
incoming_data_buffer.data() + bytes_transferred);
// the request has been parsed
if (result == util::tribool::yes)
if (result == RequestStatus::yes)
{
current_request.endpoint = TCP_socket.remote_endpoint().address();
request_handler.handle_request(current_request, current_reply);
@@ -85,7 +85,7 @@ void Connection::handle_read(const boost::system::error_code &error, std::size_t
strand.wrap(boost::bind(&Connection::handle_write, this->shared_from_this(),
boost::asio::placeholders::error)));
}
else if (result == util::tribool::no)
else if (result == RequestStatus::no)
{ // request is not parseable
current_reply = http::reply::stock_reply(http::reply::bad_request);