mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-23 03:05:48 +03:00
158 lines
5.9 KiB
Diff
158 lines
5.9 KiB
Diff
diff --git a/src/ripple/overlay/impl/Handshake.cpp b/src/ripple/overlay/impl/Handshake.cpp
|
|
index 2ea208f..bede6be 100644
|
|
--- a/src/ripple/overlay/impl/Handshake.cpp
|
|
+++ b/src/ripple/overlay/impl/Handshake.cpp
|
|
@@ -44,7 +44,7 @@ getFeatureValue(
|
|
return {};
|
|
boost::smatch match;
|
|
boost::regex rx(feature + "=([^;\\s]+)");
|
|
- auto const value = header->value().to_string();
|
|
+ auto const value = std::string{header->value()};
|
|
if (boost::regex_search(value, match, rx))
|
|
return {match[1]};
|
|
return {};
|
|
@@ -237,7 +237,7 @@ verifyHandshake(
|
|
{
|
|
if (auto const iter = headers.find("Server-Domain"); iter != headers.end())
|
|
{
|
|
- if (!isProperlyFormedTomlDomain(iter->value().to_string()))
|
|
+ if (!isProperlyFormedTomlDomain(std::string{iter->value()}))
|
|
throw std::runtime_error("Invalid server domain");
|
|
}
|
|
|
|
@@ -245,7 +245,7 @@ verifyHandshake(
|
|
{
|
|
std::uint32_t nid;
|
|
|
|
- if (!beast::lexicalCastChecked(nid, iter->value().to_string()))
|
|
+ if (!beast::lexicalCastChecked(nid, std::string{iter->value()}))
|
|
throw std::runtime_error("Invalid peer network identifier");
|
|
|
|
if (networkID && nid != *networkID)
|
|
@@ -255,7 +255,7 @@ verifyHandshake(
|
|
if (auto const iter = headers.find("Network-Time"); iter != headers.end())
|
|
{
|
|
auto const netTime =
|
|
- [str = iter->value().to_string()]() -> TimeKeeper::time_point {
|
|
+ [str = std::string{iter->value()}]() -> TimeKeeper::time_point {
|
|
TimeKeeper::duration::rep val;
|
|
|
|
if (beast::lexicalCastChecked(val, str))
|
|
@@ -291,7 +291,7 @@ verifyHandshake(
|
|
if (auto const iter = headers.find("Public-Key"); iter != headers.end())
|
|
{
|
|
auto pk = parseBase58<PublicKey>(
|
|
- TokenType::NodePublic, iter->value().to_string());
|
|
+ TokenType::NodePublic, std::string{iter->value()});
|
|
|
|
if (pk)
|
|
{
|
|
@@ -320,7 +320,7 @@ verifyHandshake(
|
|
if (iter == headers.end())
|
|
throw std::runtime_error("No session signature specified");
|
|
|
|
- auto sig = base64_decode(iter->value().to_string());
|
|
+ auto sig = base64_decode(std::string{iter->value()});
|
|
|
|
if (!verifyDigest(publicKey, sharedValue, makeSlice(sig), false))
|
|
throw std::runtime_error("Failed to verify session");
|
|
@@ -330,7 +330,7 @@ verifyHandshake(
|
|
{
|
|
boost::system::error_code ec;
|
|
auto const local_ip = boost::asio::ip::address::from_string(
|
|
- iter->value().to_string(), ec);
|
|
+ std::string{iter->value()}, ec);
|
|
|
|
if (ec)
|
|
throw std::runtime_error("Invalid Local-IP");
|
|
@@ -345,7 +345,7 @@ verifyHandshake(
|
|
{
|
|
boost::system::error_code ec;
|
|
auto const remote_ip = boost::asio::ip::address::from_string(
|
|
- iter->value().to_string(), ec);
|
|
+ std::string{iter->value()}, ec);
|
|
|
|
if (ec)
|
|
throw std::runtime_error("Invalid Remote-IP");
|
|
diff --git a/src/ripple/overlay/impl/PeerImp.cpp b/src/ripple/overlay/impl/PeerImp.cpp
|
|
index 60870c9..6af4c77 100644
|
|
--- a/src/ripple/overlay/impl/PeerImp.cpp
|
|
+++ b/src/ripple/overlay/impl/PeerImp.cpp
|
|
@@ -176,7 +176,7 @@ PeerImp::run()
|
|
if (auto const iter = headers_.find("Closed-Ledger");
|
|
iter != headers_.end())
|
|
{
|
|
- closed = parseLedgerHash(iter->value().to_string());
|
|
+ closed = parseLedgerHash(std::string{iter->value()});
|
|
|
|
if (!closed)
|
|
fail("Malformed handshake data (1)");
|
|
@@ -185,7 +185,7 @@ PeerImp::run()
|
|
if (auto const iter = headers_.find("Previous-Ledger");
|
|
iter != headers_.end())
|
|
{
|
|
- previous = parseLedgerHash(iter->value().to_string());
|
|
+ previous = parseLedgerHash(std::string{iter->value()});
|
|
|
|
if (!previous)
|
|
fail("Malformed handshake data (2)");
|
|
@@ -372,8 +372,8 @@ std::string
|
|
PeerImp::getVersion() const
|
|
{
|
|
if (inbound_)
|
|
- return headers_["User-Agent"].to_string();
|
|
- return headers_["Server"].to_string();
|
|
+ return std::string{headers_["User-Agent"]};
|
|
+ return std::string{headers_["Server"]};
|
|
}
|
|
|
|
Json::Value
|
|
@@ -399,7 +399,7 @@ PeerImp::json()
|
|
if (auto const d = domain(); !d.empty())
|
|
ret[jss::server_domain] = domain();
|
|
|
|
- if (auto const nid = headers_["Network-ID"].to_string(); !nid.empty())
|
|
+ if (auto const nid = std::string{headers_["Network-ID"]}; !nid.empty())
|
|
ret[jss::network_id] = nid;
|
|
|
|
ret[jss::load] = usage_.balance();
|
|
@@ -844,7 +844,7 @@ PeerImp::name() const
|
|
std::string
|
|
PeerImp::domain() const
|
|
{
|
|
- return headers_["Server-Domain"].to_string();
|
|
+ return std::string{headers_["Server-Domain"]};
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
diff --git a/src/ripple/rpc/impl/ServerHandlerImp.cpp b/src/ripple/rpc/impl/ServerHandlerImp.cpp
|
|
index cb70fdc..8457bf5 100644
|
|
--- a/src/ripple/rpc/impl/ServerHandlerImp.cpp
|
|
+++ b/src/ripple/rpc/impl/ServerHandlerImp.cpp
|
|
@@ -246,11 +246,11 @@ build_map(boost::beast::http::fields const& h)
|
|
std::map<std::string, std::string> c;
|
|
for (auto const& e : h)
|
|
{
|
|
- auto key(e.name_string().to_string());
|
|
+ auto key(std::string{e.name_string()});
|
|
std::transform(key.begin(), key.end(), key.begin(), [](auto kc) {
|
|
return std::tolower(static_cast<unsigned char>(kc));
|
|
});
|
|
- c[key] = e.value().to_string();
|
|
+ c[key] = std::string{e.value()};
|
|
}
|
|
return c;
|
|
}
|
|
diff --git a/src/ripple/rpc/impl/WSInfoSub.h b/src/ripple/rpc/impl/WSInfoSub.h
|
|
index 8f386c8..aec4d94 100644
|
|
--- a/src/ripple/rpc/impl/WSInfoSub.h
|
|
+++ b/src/ripple/rpc/impl/WSInfoSub.h
|
|
@@ -50,7 +50,7 @@ public:
|
|
{
|
|
auto it = h.find("X-User");
|
|
if (it != h.end())
|
|
- user_ = it->value().to_string();
|
|
+ user_ = std::string{it->value()};
|
|
fwdfor_ = std::string(forwardedFor(h));
|
|
}
|
|
}
|