diff --git a/src/ripple/app/main/Application.cpp b/src/ripple/app/main/Application.cpp index 59427000d..03daa5ba9 100644 --- a/src/ripple/app/main/Application.cpp +++ b/src/ripple/app/main/Application.cpp @@ -63,8 +63,11 @@ #include #include #include + +#include #include #include + #include #include #include @@ -1912,7 +1915,7 @@ bool ApplicationImp::loadOldLedger ( } } } - else if (ledgerID.empty () || boost::beast::detail::iequals(ledgerID, "latest")) + else if (ledgerID.empty () || boost::iequals(ledgerID, "latest")) { loadLedger = getLastFullLedger (); } diff --git a/src/ripple/app/misc/SHAMapStoreImp.cpp b/src/ripple/app/misc/SHAMapStoreImp.cpp index ff39d171f..eaa2accf0 100644 --- a/src/ripple/app/misc/SHAMapStoreImp.cpp +++ b/src/ripple/app/misc/SHAMapStoreImp.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include namespace ripple { void SHAMapStoreImp::SavedStateDB::init (BasicConfig const& config, @@ -184,7 +184,7 @@ SHAMapStoreImp::SHAMapStoreImp( } // RocksDB only. Use sensible defaults if no values specified. - if (boost::beast::detail::iequals( + if (boost::iequals( get(section, "type"), "RocksDB")) { if (!section.exists("cache_mb")) diff --git a/src/ripple/core/impl/Config.cpp b/src/ripple/core/impl/Config.cpp index 987f2e7e0..5464799cc 100644 --- a/src/ripple/core/impl/Config.cpp +++ b/src/ripple/core/impl/Config.cpp @@ -318,15 +318,15 @@ void Config::loadFromString (std::string const& fileContents) if (getSingleSection (secConfig, SECTION_NODE_SIZE, strTemp, j_)) { - if (boost::beast::detail::iequals(strTemp, "tiny")) + if (boost::iequals(strTemp, "tiny")) NODE_SIZE = 0; - else if (boost::beast::detail::iequals(strTemp, "small")) + else if (boost::iequals(strTemp, "small")) NODE_SIZE = 1; - else if (boost::beast::detail::iequals(strTemp, "medium")) + else if (boost::iequals(strTemp, "medium")) NODE_SIZE = 2; - else if (boost::beast::detail::iequals(strTemp, "large")) + else if (boost::iequals(strTemp, "large")) NODE_SIZE = 3; - else if (boost::beast::detail::iequals(strTemp, "huge")) + else if (boost::iequals(strTemp, "huge")) NODE_SIZE = 4; else { @@ -376,9 +376,9 @@ void Config::loadFromString (std::string const& fileContents) if (getSingleSection (secConfig, SECTION_LEDGER_HISTORY, strTemp, j_)) { - if (boost::beast::detail::iequals(strTemp, "full")) + if (boost::iequals(strTemp, "full")) LEDGER_HISTORY = 1000000000u; - else if (boost::beast::detail::iequals(strTemp, "none")) + else if (boost::iequals(strTemp, "none")) LEDGER_HISTORY = 0; else LEDGER_HISTORY = beast::lexicalCastThrow (strTemp); @@ -386,9 +386,9 @@ void Config::loadFromString (std::string const& fileContents) if (getSingleSection (secConfig, SECTION_FETCH_DEPTH, strTemp, j_)) { - if (boost::beast::detail::iequals(strTemp, "none")) + if (boost::iequals(strTemp, "none")) FETCH_DEPTH = 0; - else if (boost::beast::detail::iequals(strTemp, "full")) + else if (boost::iequals(strTemp, "full")) FETCH_DEPTH = 1000000000u; else FETCH_DEPTH = beast::lexicalCastThrow (strTemp); diff --git a/src/ripple/net/impl/RPCCall.cpp b/src/ripple/net/impl/RPCCall.cpp index 453ede0f5..6a15ae833 100644 --- a/src/ripple/net/impl/RPCCall.cpp +++ b/src/ripple/net/impl/RPCCall.cpp @@ -37,10 +37,13 @@ #include #include #include + +#include #include #include #include #include + #include #include #include @@ -163,10 +166,9 @@ private: // If odd number of params then 'novalidate' may have been specified if (sz & 1) { - using namespace boost::beast::detail; - if (iequals(jvParams[0u].asString(), "novalidate")) + if (boost::iequals(jvParams[0u].asString(), "novalidate")) ++i; - else if (!iequals(jvParams[--sz].asString(), "novalidate")) + else if (!boost::iequals(jvParams[--sz].asString(), "novalidate")) return rpcError(rpcINVALID_PARAMS); jvResult[jss::validate] = false; } @@ -471,9 +473,9 @@ private: // This may look reversed, but it's intentional: jss::vetoed // determines whether an amendment is vetoed - so "reject" means // that jss::vetoed is true. - if (boost::beast::detail::iequals(action, "reject")) + if (boost::iequals(action, "reject")) jvRequest[jss::vetoed] = Json::Value (true); - else if (boost::beast::detail::iequals(action, "accept")) + else if (boost::iequals(action, "accept")) jvRequest[jss::vetoed] = Json::Value (false); else return rpcError (rpcINVALID_PARAMS); diff --git a/src/ripple/nodestore/impl/DatabaseShardImp.cpp b/src/ripple/nodestore/impl/DatabaseShardImp.cpp index 064ea26c2..0d28c9cb4 100644 --- a/src/ripple/nodestore/impl/DatabaseShardImp.cpp +++ b/src/ripple/nodestore/impl/DatabaseShardImp.cpp @@ -30,6 +30,8 @@ #include #include +#include + namespace ripple { namespace NodeStore { @@ -72,7 +74,6 @@ bool DatabaseShardImp::init() { using namespace boost::filesystem; - using namespace boost::beast::detail; std::lock_guard lock(m_); auto fail = [j = j_](std::string const& msg) @@ -149,9 +150,9 @@ DatabaseShardImp::init() // NuDB is the default and only supported permanent storage backend // "Memory" and "none" types are supported for tests backendName_ = get(section, "type", "nudb"); - if (!iequals(backendName_, "NuDB") && - !iequals(backendName_, "Memory") && - !iequals(backendName_, "none")) + if (!boost::iequals(backendName_, "NuDB") && + !boost::iequals(backendName_, "Memory") && + !boost::iequals(backendName_, "none")) { return fail("'type' value unsupported"); } diff --git a/src/ripple/nodestore/impl/ManagerImp.cpp b/src/ripple/nodestore/impl/ManagerImp.cpp index 50624ce7d..6059c9dee 100644 --- a/src/ripple/nodestore/impl/ManagerImp.cpp +++ b/src/ripple/nodestore/impl/ManagerImp.cpp @@ -20,6 +20,8 @@ #include #include +#include + namespace ripple { namespace NodeStore { @@ -102,7 +104,7 @@ ManagerImp::find (std::string const& name) auto const iter = std::find_if(list_.begin(), list_.end(), [&name](Factory* other) { - return boost::beast::detail::iequals(name, other->getName()); + return boost::iequals(name, other->getName()); } ); if (iter == list_.end()) return nullptr; diff --git a/src/ripple/nodestore/impl/Shard.cpp b/src/ripple/nodestore/impl/Shard.cpp index 6513beffe..4a7544c00 100644 --- a/src/ripple/nodestore/impl/Shard.cpp +++ b/src/ripple/nodestore/impl/Shard.cpp @@ -57,6 +57,7 @@ Shard::Shard( bool Shard::open(Scheduler& scheduler, nudb::context& ctx) { + using namespace boost::filesystem; std::lock_guard lock(mutex_); assert(!backend_); diff --git a/src/ripple/overlay/impl/OverlayImpl.cpp b/src/ripple/overlay/impl/OverlayImpl.cpp index a9c4d79d3..0d7c65753 100644 --- a/src/ripple/overlay/impl/OverlayImpl.cpp +++ b/src/ripple/overlay/impl/OverlayImpl.cpp @@ -36,6 +36,7 @@ #include #include +#include #include namespace ripple { @@ -226,7 +227,7 @@ OverlayImpl::onHandoff (std::unique_ptr && ssl_bundle, if (std::find_if(types.begin(), types.end(), [](std::string const& s) { - return boost::beast::detail::iequals(s, "peer"); + return boost::iequals(s, "peer"); }) == types.end()) { handoff.moved = false; diff --git a/src/ripple/overlay/impl/PeerImp.cpp b/src/ripple/overlay/impl/PeerImp.cpp index 762dc6a69..6ddcf9866 100644 --- a/src/ripple/overlay/impl/PeerImp.cpp +++ b/src/ripple/overlay/impl/PeerImp.cpp @@ -42,6 +42,8 @@ #include #include #include +#include + #include #include #include @@ -252,7 +254,7 @@ PeerImp::crawl() const auto const iter = headers_.find("Crawl"); if (iter == headers_.end()) return false; - return boost::beast::detail::iequals(iter->value(), "public"); + return boost::iequals(iter->value(), "public"); } bool diff --git a/src/ripple/rpc/impl/Role.cpp b/src/ripple/rpc/impl/Role.cpp index b4b8ca016..6f8e97f5d 100644 --- a/src/ripple/rpc/impl/Role.cpp +++ b/src/ripple/rpc/impl/Role.cpp @@ -118,13 +118,18 @@ forwardedFor(http_request_type const& request) it = request.find("Forwarded"); if (it != request.end()) { + auto ascii_tolower = [](char c) -> char + { + return ((static_cast(c) - 65U) < 26) ? + c + 'a' - 'A' : c; + }; + static std::string const forStr{"for="}; auto found = std::search(it->value().begin(), it->value().end(), forStr.begin(), forStr.end(), - [](char c1, char c2) + [&ascii_tolower](char c1, char c2) { - return boost::beast::detail::ascii_tolower(c1) == - boost::beast::detail::ascii_tolower(c2); + return ascii_tolower(c1) == ascii_tolower(c2); } ); diff --git a/src/ripple/server/WSSession.h b/src/ripple/server/WSSession.h index 9734f3640..390e83c0d 100644 --- a/src/ripple/server/WSSession.h +++ b/src/ripple/server/WSSession.h @@ -23,10 +23,13 @@ #include #include #include + +#include #include #include #include #include + #include #include #include diff --git a/src/ripple/server/impl/Port.cpp b/src/ripple/server/impl/Port.cpp index fc342c6ee..caaca2eb6 100644 --- a/src/ripple/server/impl/Port.cpp +++ b/src/ripple/server/impl/Port.cpp @@ -22,6 +22,8 @@ #include #include +#include + namespace ripple { bool @@ -189,7 +191,7 @@ parse_Port (ParsedPort& port, Section const& section, std::ostream& log) { auto const lim = get (section, "limit", "unlimited"); - if (!boost::beast::detail::iequals (lim, "unlimited")) + if (!boost::iequals (lim, "unlimited")) { try { diff --git a/src/test/server/ServerStatus_test.cpp b/src/test/server/ServerStatus_test.cpp index 4b3410b58..5fce31950 100644 --- a/src/test/server/ServerStatus_test.cpp +++ b/src/test/server/ServerStatus_test.cpp @@ -749,7 +749,7 @@ class ServerStatus_test : Json::Reader jr; if(! BEAST_EXPECT(jr.parse( boost::lexical_cast( - boost::beast::buffers(sb.data())), resp))) + boost::beast::make_printable(sb.data())), resp))) return Json::objectValue; sb.consume(sb.size()); return resp;