Boost uri update
Update to the latest version of boost::uri
The newest version of boost uri makes some breaking changes that we need
to account for. At the same time, we take the opportunity to move to
the error code based parse methods that don't rely on exceptions.
The biggest changes are:
The standalone build is no longer present. A discussion with the
boost::url maintainers shows that our best option is to do a simple
copy of the headers, and compile boost/url/src.hpp in a separate file.
This is intended to allow people to pull the library in "standalone" and
not have to rely on the build machinery in boost-url, which we don't
really need. Interestingly, this file doesn't have a newline at the
end, which clang correctly flags. OpenBMC doesn't really need that
warning, as we rely on clang-format to do that, so we add
-Wno-newline-eof clang to get the code to compile there.
All url parsers are moved to the parse_uri, or parse_relative_uri
equivalents. This slightly tightens the requirements around what URLs
are accepted, but in no ways that should break anything. (Ie,
"/redfish/v1" is no longer accepted for a virtual media endpoint.
boost::urls::url_view::params_type has been renamed to
query_params_type, and the relevant methods have been updated.
Because of the missing standalone mode, we now need to use
boost::string_view which doesn't implicitly construct from
std::string_view. Some discussion on the boost list shows that this is
coming soon, so that cruft can eventually be cleaned up, but for now we
need the construction.
Tested:
Loaded in qemu, and ran some URLs (/redfish/v1 and /redfish/v1/Chassis)
to ensure that the url handler functions as intended.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I5843776d4ec01b4d92af2ee3a9cf1ebb1d920ae7
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 12ec64a..2c9ae3a 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -188,8 +188,7 @@
static bool getSkipParam(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const crow::Request& req, uint64_t& skip)
{
- boost::urls::url_view::params_type::iterator it =
- req.urlParams.find("$skip");
+ boost::urls::query_params_view::iterator it = req.urlParams.find("$skip");
if (it != req.urlParams.end())
{
std::string skipParam = it->value();
@@ -210,8 +209,7 @@
static bool getTopParam(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const crow::Request& req, uint64_t& top)
{
- boost::urls::url_view::params_type::iterator it =
- req.urlParams.find("$top");
+ boost::urls::query_params_view::iterator it = req.urlParams.find("$top");
if (it != req.urlParams.end())
{
std::string topParam = it->value();