Apply clang-format
This commit is contained in:
@@ -77,7 +77,8 @@ void RequestHandler::handle_request(const http::request ¤t_request,
|
||||
if (!route_parameters.jsonp_parameter.empty())
|
||||
{ // prepend response with jsonp parameter
|
||||
const std::string json_p = (route_parameters.jsonp_parameter + "(");
|
||||
current_reply.content.insert(current_reply.content.end(), json_p.begin(), json_p.end());
|
||||
current_reply.content.insert(current_reply.content.end(), json_p.begin(),
|
||||
json_p.end());
|
||||
}
|
||||
|
||||
const int return_code = routing_machine->RunQuery(route_parameters, json_result);
|
||||
@@ -101,7 +102,8 @@ void RequestHandler::handle_request(const http::request ¤t_request,
|
||||
|
||||
current_reply.status = http::reply::bad_request;
|
||||
json_result.values["status"] = http::reply::bad_request;
|
||||
json_result.values["status_message"] = "Query string malformed close to position " + std::to_string(position);
|
||||
json_result.values["status_message"] =
|
||||
"Query string malformed close to position " + std::to_string(position);
|
||||
}
|
||||
|
||||
current_reply.headers.emplace_back("Access-Control-Allow-Origin", "*");
|
||||
@@ -141,7 +143,8 @@ void RequestHandler::handle_request(const http::request ¤t_request,
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
current_reply = http::reply::stock_reply(http::reply::internal_server_error);;
|
||||
current_reply = http::reply::stock_reply(http::reply::internal_server_error);
|
||||
;
|
||||
SimpleLogger().Write(logWARNING) << "[server error] code: " << e.what()
|
||||
<< ", uri: " << current_request.uri;
|
||||
}
|
||||
|
||||
@@ -15,8 +15,7 @@ namespace http
|
||||
|
||||
RequestParser::RequestParser()
|
||||
: state(internal_state::method_start), current_header({"", ""}),
|
||||
selected_compression(no_compression), is_post_header(false),
|
||||
content_length(0)
|
||||
selected_compression(no_compression), is_post_header(false), content_length(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -32,8 +31,8 @@ RequestParser::parse(request ¤t_request, char *begin, char *end)
|
||||
}
|
||||
}
|
||||
osrm::tribool result = osrm::tribool::indeterminate;
|
||||
|
||||
if(state == internal_state::post_request && content_length <= 0)
|
||||
|
||||
if (state == internal_state::post_request && content_length <= 0)
|
||||
{
|
||||
result = osrm::tribool::yes;
|
||||
}
|
||||
@@ -49,7 +48,7 @@ osrm::tribool RequestParser::consume(request ¤t_request, const char input)
|
||||
{
|
||||
return osrm::tribool::no;
|
||||
}
|
||||
if(input == 'P')
|
||||
if (input == 'P')
|
||||
{
|
||||
state = internal_state::post_O;
|
||||
return osrm::tribool::indeterminate;
|
||||
@@ -57,25 +56,25 @@ osrm::tribool RequestParser::consume(request ¤t_request, const char input)
|
||||
state = internal_state::method;
|
||||
return osrm::tribool::indeterminate;
|
||||
case internal_state::post_O:
|
||||
if(input == 'O')
|
||||
if (input == 'O')
|
||||
{
|
||||
state = internal_state::post_S;
|
||||
return osrm::tribool::indeterminate;
|
||||
state = internal_state::post_S;
|
||||
return osrm::tribool::indeterminate;
|
||||
}
|
||||
return osrm::tribool::no;
|
||||
case internal_state::post_S:
|
||||
if(input == 'S')
|
||||
if (input == 'S')
|
||||
{
|
||||
state = internal_state::post_T;
|
||||
return osrm::tribool::indeterminate;
|
||||
state = internal_state::post_T;
|
||||
return osrm::tribool::indeterminate;
|
||||
}
|
||||
return osrm::tribool::no;
|
||||
case internal_state::post_T:
|
||||
if(input == 'T')
|
||||
if (input == 'T')
|
||||
{
|
||||
is_post_header = true;
|
||||
state = internal_state::method;
|
||||
return osrm::tribool::indeterminate;
|
||||
is_post_header = true;
|
||||
state = internal_state::method;
|
||||
return osrm::tribool::indeterminate;
|
||||
}
|
||||
return osrm::tribool::no;
|
||||
case internal_state::post_request:
|
||||
@@ -216,7 +215,7 @@ osrm::tribool RequestParser::consume(request ¤t_request, const char input)
|
||||
}
|
||||
if (boost::iequals(current_header.name, "Content-Length"))
|
||||
{
|
||||
try
|
||||
try
|
||||
{
|
||||
content_length = std::stoi(current_header.value);
|
||||
}
|
||||
@@ -305,10 +304,10 @@ osrm::tribool RequestParser::consume(request ¤t_request, const char input)
|
||||
{
|
||||
if (is_post_header)
|
||||
{
|
||||
if (content_length > 0)
|
||||
{
|
||||
current_request.uri.push_back('?');
|
||||
}
|
||||
if (content_length > 0)
|
||||
{
|
||||
current_request.uri.push_back('?');
|
||||
}
|
||||
state = internal_state::post_request;
|
||||
return osrm::tribool::indeterminate;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user