Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e29b3d5dc1 | |||
| 0ead590a00 | |||
| 0a454ee873 | |||
| 2577c8fdb9 | |||
| 7c4b2f11e6 | |||
| b43583af70 | |||
| 9ae1abcc9d | |||
| df221479d1 | |||
| 62310c3ef8 | |||
| 97819c4622 | |||
| 5870ca658d | |||
| 9feecad226 | |||
| f36537a5b5 | |||
| 7f1016973e | |||
| 41e36a75ae | |||
| a8af28d381 | |||
| 968004ed44 | |||
| 099bfca60b | |||
| 681169cd22 | |||
| ba6979ff36 | |||
| c8c240ea07 | |||
| 3cc3729704 | |||
| 53de5f26bb | |||
| 820b60f079 | |||
| 1c9812bfec | |||
| 438227db7f | |||
| 761ce3b8bf | |||
| ae9151d092 | |||
| 533ecfbf28 | |||
| 8e27ddf6bf | |||
| 5bc283d6b2 | |||
| d143de597d | |||
| 4026ed54c0 | |||
| 895e4bf6d5 | |||
| cb90d587be |
+516
-465
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,11 @@
|
||||
# Unreleased
|
||||
- Changes from 5.27.0
|
||||
- Misc:
|
||||
- FIXED: Fix bug with large HTTP requests leading to Bad Request in osrm-routed. [#6403](https://github.com/Project-OSRM/osrm-backend/pull/6403)
|
||||
- Routing:
|
||||
- CHANGED: Add support for surface=metal,grass_paver,woodchips in bicyle profile. [#6395](https://github.com/Project-OSRM/osrm-backend/pull/6395)
|
||||
|
||||
# 5.27.0
|
||||
- Changes from 5.26.0
|
||||
- API:
|
||||
- ADDED: Add Flatbuffers support to NodeJS bindings. [#6338](https://github.com/Project-OSRM/osrm-backend/pull/6338)
|
||||
|
||||
+6
-2
@@ -492,6 +492,9 @@ if(ENABLE_CONAN)
|
||||
set(TBB_SHARED True)
|
||||
endif()
|
||||
|
||||
if(NOT CONAN_CMAKE_SYSTEM_PROCESSOR)
|
||||
set(CONAN_CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
|
||||
endif()
|
||||
set(CONAN_ARGS
|
||||
REQUIRES
|
||||
"boost/${CONAN_BOOST_VERSION}"
|
||||
@@ -503,6 +506,7 @@ if(ENABLE_CONAN)
|
||||
GENERATORS cmake_find_package json # json generator generates a conanbuildinfo.json in the build folder so (non-CMake) projects can easily parse OSRM's dependencies
|
||||
KEEP_RPATHS
|
||||
NO_OUTPUT_DIRS
|
||||
ENV CONAN_CMAKE_SYSTEM_PROCESSOR=aarch64
|
||||
OPTIONS boost:filesystem_version=3 # https://stackoverflow.com/questions/73392648/error-with-boost-filesystem-version-in-cmake
|
||||
onetbb:shared=${TBB_SHARED}
|
||||
boost:without_stacktrace=True # Apple Silicon cross-compilation fails without it
|
||||
@@ -511,8 +515,8 @@ if(ENABLE_CONAN)
|
||||
# explicitly say Conan to use x86 dependencies if build for x86 platforms (https://github.com/conan-io/cmake-conan/issues/141)
|
||||
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
conan_cmake_run("${CONAN_ARGS};ARCH;x86")
|
||||
# cross-compilation for Apple Silicon
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||
# cross-compilation for arm64 processors
|
||||
elseif((CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||
conan_cmake_run("${CONAN_ARGS};ARCH;armv8")
|
||||
else()
|
||||
conan_cmake_run("${CONAN_ARGS}")
|
||||
|
||||
@@ -58,16 +58,16 @@ Download OpenStreetMap extracts for example from [Geofabrik](http://download.geo
|
||||
|
||||
Pre-process the extract with the car profile and start a routing engine HTTP server on port 5000
|
||||
|
||||
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
|
||||
docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
|
||||
|
||||
The flag `-v "${PWD}:/data"` creates the directory `/data` inside the docker container and makes the current working directory `"${PWD}"` available there. The file `/data/berlin-latest.osm.pbf` inside the container is referring to `"${PWD}/berlin-latest.osm.pbf"` on the host.
|
||||
|
||||
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-partition /data/berlin-latest.osrm
|
||||
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-customize /data/berlin-latest.osrm
|
||||
docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-partition /data/berlin-latest.osrm
|
||||
docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-customize /data/berlin-latest.osrm
|
||||
|
||||
Note there is no `berlin-latest.osrm` file, but multiple `berlin-latest.osrm.*` files, i.e. `berlin-latest.osrm` is not file path, but "base" path referring to set of files and there is an option to omit this `.osrm` suffix completely(e.g. `osrm-partition /data/berlin-latest`).
|
||||
|
||||
docker run -t -i -p 5000:5000 -v "${PWD}:/data" osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm
|
||||
docker run -t -i -p 5000:5000 -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm
|
||||
|
||||
Make requests against the HTTP server
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ Feature: Bike - Surfaces
|
||||
| cycleway | cobblestone:flattened | 72 s |
|
||||
| cycleway | paving_stones | 72 s |
|
||||
| cycleway | wood | 72 s |
|
||||
| cycleway | metal | 72 s |
|
||||
| cycleway | compacted | 72 s |
|
||||
| cycleway | fine_gravel | 72 s |
|
||||
| cycleway | ground | 72 s |
|
||||
@@ -22,11 +23,13 @@ Feature: Bike - Surfaces
|
||||
| cycleway | cobblestone | 102.9 s |
|
||||
| cycleway | gravel | 120 s |
|
||||
| cycleway | pebblestone | 120 s |
|
||||
| cycleway | grass_paver | 120 s |
|
||||
| cycleway | dirt | 90 s |
|
||||
| cycleway | earth | 120 s |
|
||||
| cycleway | grass | 120 s |
|
||||
| cycleway | mud | 240 s |
|
||||
| cycleway | sand | 240 s |
|
||||
| cycleway | woodchips | 240 s |
|
||||
| cycleway | sett | 80 s |
|
||||
|
||||
Scenario: Bicycle - Good surfaces on small paths
|
||||
|
||||
@@ -115,6 +115,36 @@ Feature: Car - Turn restrictions
|
||||
| c | a | cj,aj,aj |
|
||||
| c | b | cj,bj,bj |
|
||||
|
||||
@no_turning
|
||||
Scenario: Car - No u-turn
|
||||
# https://www.openstreetmap.org/edit?node=54878482#map=19/34.05242/-117.19067
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
3
|
||||
a 1 x 2 b
|
||||
4
|
||||
d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| ax |
|
||||
| xb |
|
||||
| cx |
|
||||
| xd |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | ax | ax | x | no_u_turn |
|
||||
| restriction | bx | bx | x | no_u_turn |
|
||||
| restriction | cx | cx | x | no_u_turn |
|
||||
| restriction | dx | dx | x | no_u_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,x,a | ax,xb,xb,xb,ax,ax | depart,new name straight,continue uturn,arrive,depart,arrive |
|
||||
|
||||
@no_turning
|
||||
Scenario: Car - Handle any no_* relation
|
||||
Given the node map
|
||||
|
||||
@@ -4,7 +4,7 @@ module.exports = function () {
|
||||
this.When(/^I request \/(.*)$/, (path, callback) => {
|
||||
this.reprocessAndLoadData((e) => {
|
||||
if (e) return callback(e);
|
||||
this.requestPath(path, {}, (err, res, body) => {
|
||||
this.requestUrl(path, (err, res, body) => {
|
||||
this.response = res;
|
||||
callback(err, res, body);
|
||||
});
|
||||
@@ -23,13 +23,13 @@ module.exports = function () {
|
||||
this.ShouldBeWellFormed();
|
||||
});
|
||||
|
||||
this.Then(/^status code should be (\d+)$/, (code, callback) => {
|
||||
this.Then(/^status code should be (.+)$/, (code, callback) => {
|
||||
try {
|
||||
this.json = JSON.parse(this.response.body);
|
||||
} catch(e) {
|
||||
return callback(e);
|
||||
}
|
||||
assert.equal(this.json.status, parseInt(code));
|
||||
assert.equal(this.json.code, code);
|
||||
callback();
|
||||
});
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -69,7 +69,7 @@ class Connection : public std::enable_shared_from_this<Connection>
|
||||
boost::asio::deadline_timer timer;
|
||||
RequestHandler &request_handler;
|
||||
std::optional<RequestParser> http_request_parser;
|
||||
boost::array<char, 8192> incoming_data_buffer;
|
||||
std::vector<char> incoming_data_buffer;
|
||||
http::request current_request;
|
||||
http::reply current_reply;
|
||||
std::vector<char> compressed_output;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@project-osrm/osrm",
|
||||
"version": "5.27.0-unreleased",
|
||||
"version": "5.28.0-unreleased",
|
||||
"private": false,
|
||||
"description": "The Open Source Routing Machine is a high performance routing engine written in C++14 designed to run on OpenStreetMap data.",
|
||||
"dependencies": {
|
||||
|
||||
@@ -178,6 +178,7 @@ function setup()
|
||||
concrete = default_speed,
|
||||
concrete_lanes = default_speed,
|
||||
wood = 10,
|
||||
metal = 10,
|
||||
["cobblestone:flattened"] = 10,
|
||||
paving_stones = 10,
|
||||
compacted = 10,
|
||||
@@ -186,12 +187,14 @@ function setup()
|
||||
fine_gravel = 10,
|
||||
gravel = 6,
|
||||
pebblestone = 6,
|
||||
grass_paver = 6,
|
||||
ground = 10,
|
||||
dirt = 8,
|
||||
earth = 6,
|
||||
grass = 6,
|
||||
mud = 3,
|
||||
sand = 3,
|
||||
woodchips = 3,
|
||||
sett = 9
|
||||
},
|
||||
|
||||
|
||||
@@ -12,10 +12,16 @@ namespace osrm
|
||||
namespace server
|
||||
{
|
||||
|
||||
namespace
|
||||
{
|
||||
const size_t CHUNK_SIZE = 8192;
|
||||
|
||||
} // namespace
|
||||
Connection::Connection(boost::asio::io_context &io_context, RequestHandler &handler)
|
||||
: strand(boost::asio::make_strand(io_context)), TCP_socket(strand), timer(strand),
|
||||
request_handler(handler), http_request_parser(std::make_optional<RequestParser>())
|
||||
{
|
||||
http_request_parser->header_limit(std::numeric_limits<std::uint32_t>::max());
|
||||
}
|
||||
|
||||
boost::asio::ip::tcp::socket &Connection::socket() { return TCP_socket; }
|
||||
@@ -59,7 +65,8 @@ void Connection::start()
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::handle_read(const boost::system::error_code &error, std::size_t bytes_transferred)
|
||||
void Connection::handle_read(const boost::system::error_code &error,
|
||||
std::size_t /*bytes_transferred*/)
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
@@ -79,7 +86,7 @@ void Connection::handle_read(const boost::system::error_code &error, std::size_t
|
||||
}
|
||||
|
||||
boost::beast::error_code ec;
|
||||
http_request_parser->put(boost::asio::buffer(incoming_data_buffer, bytes_transferred), ec);
|
||||
http_request_parser->put(boost::asio::buffer(incoming_data_buffer), ec);
|
||||
// no error detected, let's parse the request
|
||||
http::compression_type compression_type(http::no_compression);
|
||||
|
||||
@@ -87,12 +94,15 @@ void Connection::handle_read(const boost::system::error_code &error, std::size_t
|
||||
{
|
||||
if (ec == boost::beast::http::error::need_more)
|
||||
{
|
||||
const auto current_size = incoming_data_buffer.size();
|
||||
incoming_data_buffer.resize(incoming_data_buffer.size() + CHUNK_SIZE, 0);
|
||||
// we don't have a result yet, so continue reading
|
||||
TCP_socket.async_read_some(boost::asio::buffer(incoming_data_buffer),
|
||||
boost::bind(&Connection::handle_read,
|
||||
this->shared_from_this(),
|
||||
boost::asio::placeholders::error,
|
||||
boost::asio::placeholders::bytes_transferred));
|
||||
TCP_socket.async_read_some(
|
||||
boost::asio::buffer(incoming_data_buffer.data() + current_size, CHUNK_SIZE),
|
||||
boost::bind(&Connection::handle_read,
|
||||
this->shared_from_this(),
|
||||
boost::asio::placeholders::error,
|
||||
boost::asio::placeholders::bytes_transferred));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -183,7 +193,8 @@ void Connection::handle_write(const boost::system::error_code &error)
|
||||
current_request = http::request();
|
||||
current_reply = http::reply();
|
||||
http_request_parser.emplace();
|
||||
incoming_data_buffer = boost::array<char, 8192>();
|
||||
http_request_parser->header_limit(std::numeric_limits<std::uint32_t>::max());
|
||||
incoming_data_buffer.resize(CHUNK_SIZE, 0);
|
||||
output_buffer.clear();
|
||||
this->start();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
# Conan automatically generated toolchain file
|
||||
# DO NOT EDIT MANUALLY, it will be overwritten
|
||||
|
||||
# Avoid including toolchain file several times (bad if appending to variables like
|
||||
# CMAKE_CXX_FLAGS. See https://github.com/android/ndk/issues/323
|
||||
include_guard()
|
||||
|
||||
message(STATUS "Using Conan toolchain: ${CMAKE_CURRENT_LIST_FILE}")
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.15")
|
||||
message(FATAL_ERROR "The 'CMakeToolchain' generator only works with CMake >= 3.15")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Extra c, cxx, linkflags and defines
|
||||
|
||||
|
||||
if(DEFINED CONAN_CXX_FLAGS)
|
||||
string(APPEND CMAKE_CXX_FLAGS_INIT " ${CONAN_CXX_FLAGS}")
|
||||
endif()
|
||||
if(DEFINED CONAN_C_FLAGS)
|
||||
string(APPEND CMAKE_C_FLAGS_INIT " ${CONAN_C_FLAGS}")
|
||||
endif()
|
||||
if(DEFINED CONAN_SHARED_LINKER_FLAGS)
|
||||
string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${CONAN_SHARED_LINKER_FLAGS}")
|
||||
endif()
|
||||
if(DEFINED CONAN_EXE_LINKER_FLAGS)
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${CONAN_EXE_LINKER_FLAGS}")
|
||||
endif()
|
||||
|
||||
get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
|
||||
if(_CMAKE_IN_TRY_COMPILE)
|
||||
message(STATUS "Running toolchain IN_TRY_COMPILE")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
|
||||
|
||||
# Definition of CMAKE_MODULE_PATH
|
||||
# the generators folder (where conan generates files, like this toolchain)
|
||||
list(PREPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
# Definition of CMAKE_PREFIX_PATH, CMAKE_XXXXX_PATH
|
||||
# The Conan local "generators" folder, where this toolchain is saved.
|
||||
list(PREPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR} )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
message(STATUS "Conan toolchain: Setting BUILD_SHARED_LIBS = ON")
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
|
||||
set(CMAKE_INSTALL_PREFIX "/home/runner/.conan/data/onetbb/2021.3.0/_/_/package/a36e366b2b0ea0e76bafba6092e0a74838fad5fd")
|
||||
set(CMAKE_INSTALL_BINDIR "bin")
|
||||
set(CMAKE_INSTALL_SBINDIR "bin")
|
||||
set(CMAKE_INSTALL_LIBEXECDIR "bin")
|
||||
set(CMAKE_INSTALL_LIBDIR "lib")
|
||||
set(CMAKE_INSTALL_INCLUDEDIR "include")
|
||||
set(CMAKE_INSTALL_OLDINCLUDEDIR "include")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "aarch64")
|
||||
|
||||
# Variables
|
||||
set(TBB_TEST OFF CACHE BOOL "Variable TBB_TEST conan-toolchain defined")
|
||||
set(TBB_STRICT OFF CACHE BOOL "Variable TBB_STRICT conan-toolchain defined")
|
||||
# Variables per configuration
|
||||
|
||||
|
||||
# Preprocessor definitions
|
||||
# Preprocessor definitions per configuration
|
||||
Reference in New Issue
Block a user