mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Revert "Convert code to use boost::beast"
This reverts commit cc9c976b76.
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
#include <ripple/protocol/SecretKey.h>
|
||||
#include <ripple/protocol/Sign.h>
|
||||
#include <ripple/protocol/STExchange.h>
|
||||
#include <boost/beast/core/detail/base64.hpp>
|
||||
#include <beast/core/detail/base64.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/utility/in_place_factory.hpp>
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
Serializer s;
|
||||
st.add(s);
|
||||
|
||||
return boost::beast::detail::base64_encode (std::string(
|
||||
return beast::detail::base64_encode (std::string(
|
||||
static_cast<char const*> (s.data()), s.size()));
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
Serializer s;
|
||||
st.add(s);
|
||||
|
||||
return boost::beast::detail::base64_encode (std::string(
|
||||
return beast::detail::base64_encode (std::string(
|
||||
static_cast<char const*> (s.data()), s.size()));
|
||||
}
|
||||
|
||||
|
||||
@@ -1092,6 +1092,8 @@ public:
|
||||
|
||||
auto alice = Account("alice");
|
||||
|
||||
auto queued = ter(terQUEUED);
|
||||
|
||||
BEAST_EXPECT(env.current()->fees().base == 10);
|
||||
|
||||
checkMetrics(env, 0, boost::none, 0, 1, 256);
|
||||
@@ -1131,6 +1133,7 @@ public:
|
||||
{"maximum_txn_in_ledger", "5"} }));
|
||||
|
||||
auto alice = Account("alice");
|
||||
auto queued = ter(terQUEUED);
|
||||
|
||||
checkMetrics(env, 0, boost::none, 0, 2, 256);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <boost/beast/core/detail/base64.hpp>
|
||||
#include <beast/core/detail/base64.hpp>
|
||||
#include <ripple/basics/Slice.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <ripple/app/misc/ValidatorList.h>
|
||||
@@ -89,7 +89,7 @@ private:
|
||||
derivePublicKey(KeyType::ed25519, secret);
|
||||
auto const signingKeys = randomKeyPair(KeyType::secp256k1);
|
||||
return { masterPublic, signingKeys.first,
|
||||
boost::beast::detail::base64_encode(makeManifestString (
|
||||
beast::detail::base64_encode(makeManifestString (
|
||||
masterPublic, secret, signingKeys.first, signingKeys.second, 1)) };
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ private:
|
||||
|
||||
data.pop_back();
|
||||
data += "]}";
|
||||
return boost::beast::detail::base64_encode(data);
|
||||
return beast::detail::base64_encode(data);
|
||||
}
|
||||
|
||||
std::string
|
||||
@@ -120,7 +120,7 @@ private:
|
||||
std::string const& blob,
|
||||
std::pair<PublicKey, SecretKey> const& keys)
|
||||
{
|
||||
auto const data = boost::beast::detail::base64_decode (blob);
|
||||
auto const data = beast::detail::base64_decode (blob);
|
||||
return strHex(sign(
|
||||
keys.first, keys.second, makeSlice(data)));
|
||||
}
|
||||
@@ -364,7 +364,7 @@ private:
|
||||
auto const publisherPublic =
|
||||
derivePublicKey(KeyType::ed25519, publisherSecret);
|
||||
auto const pubSigningKeys1 = randomKeyPair(KeyType::secp256k1);
|
||||
auto const manifest1 = boost::beast::detail::base64_encode(makeManifestString (
|
||||
auto const manifest1 = beast::detail::base64_encode(makeManifestString (
|
||||
publisherPublic, publisherSecret,
|
||||
pubSigningKeys1.first, pubSigningKeys1.second, 1));
|
||||
|
||||
@@ -415,7 +415,7 @@ private:
|
||||
}
|
||||
|
||||
// do not use list from untrusted publisher
|
||||
auto const untrustedManifest = boost::beast::detail::base64_encode(
|
||||
auto const untrustedManifest = beast::detail::base64_encode(
|
||||
makeManifestString (
|
||||
randomMasterKey(), publisherSecret,
|
||||
pubSigningKeys1.first, pubSigningKeys1.second, 1));
|
||||
@@ -462,7 +462,7 @@ private:
|
||||
|
||||
// apply list with new publisher key updated by manifest
|
||||
auto const pubSigningKeys2 = randomKeyPair(KeyType::secp256k1);
|
||||
auto manifest2 = boost::beast::detail::base64_encode(makeManifestString (
|
||||
auto manifest2 = beast::detail::base64_encode(makeManifestString (
|
||||
publisherPublic, publisherSecret,
|
||||
pubSigningKeys2.first, pubSigningKeys2.second, 2));
|
||||
|
||||
@@ -486,7 +486,7 @@ private:
|
||||
// do not apply list with revoked publisher key
|
||||
// applied list is removed due to revoked publisher key
|
||||
auto const signingKeysMax = randomKeyPair(KeyType::secp256k1);
|
||||
auto maxManifest = boost::beast::detail::base64_encode(makeManifestString (
|
||||
auto maxManifest = beast::detail::base64_encode(makeManifestString (
|
||||
publisherPublic, publisherSecret,
|
||||
pubSigningKeys2.first, pubSigningKeys2.second,
|
||||
std::numeric_limits<std::uint32_t>::max ()));
|
||||
@@ -746,7 +746,7 @@ private:
|
||||
std::vector<std::string> emptyCfgKeys;
|
||||
auto const publisherKeys = randomKeyPair(KeyType::secp256k1);
|
||||
auto const pubSigningKeys = randomKeyPair(KeyType::secp256k1);
|
||||
auto const manifest = boost::beast::detail::base64_encode (
|
||||
auto const manifest = beast::detail::base64_encode (
|
||||
makeManifestString (
|
||||
publisherKeys.first, publisherKeys.second,
|
||||
pubSigningKeys.first, pubSigningKeys.second, 1));
|
||||
@@ -895,7 +895,7 @@ private:
|
||||
auto const publisherPublic =
|
||||
derivePublicKey(KeyType::ed25519, publisherSecret);
|
||||
auto const pubSigningKeys = randomKeyPair(KeyType::secp256k1);
|
||||
auto const manifest = boost::beast::detail::base64_encode(makeManifestString (
|
||||
auto const manifest = beast::detail::base64_encode(makeManifestString (
|
||||
publisherPublic, publisherSecret,
|
||||
pubSigningKeys.first, pubSigningKeys.second, 1));
|
||||
|
||||
@@ -998,7 +998,7 @@ private:
|
||||
auto const publisherPublic =
|
||||
derivePublicKey(KeyType::ed25519, publisherSecret);
|
||||
auto const pubSigningKeys = randomKeyPair(KeyType::secp256k1);
|
||||
auto const manifest = boost::beast::detail::base64_encode(makeManifestString (
|
||||
auto const manifest = beast::detail::base64_encode(makeManifestString (
|
||||
publisherPublic, publisherSecret,
|
||||
pubSigningKeys.first, pubSigningKeys.second, 1));
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <beast/core/detail/base64.hpp>
|
||||
#include <ripple/app/misc/ValidatorSite.h>
|
||||
#include <ripple/basics/Slice.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
@@ -28,7 +29,6 @@
|
||||
#include <test/jtx.h>
|
||||
#include <test/jtx/TrustedPublisherServer.h>
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/beast/core/detail/base64.hpp>
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
@@ -67,7 +67,7 @@ private:
|
||||
Serializer s;
|
||||
st.add(s);
|
||||
|
||||
return boost::beast::detail::base64_encode (std::string(
|
||||
return beast::detail::base64_encode (std::string(
|
||||
static_cast<char const*> (s.data()), s.size()));
|
||||
}
|
||||
|
||||
|
||||
@@ -127,4 +127,4 @@ class LedgerTiming_test : public beast::unit_test::suite
|
||||
|
||||
BEAST_DEFINE_TESTSUITE(LedgerTiming, consensus, ripple);
|
||||
} // test
|
||||
} // ripple
|
||||
} // ripple
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <ripple/protocol/STAmount.h>
|
||||
#include <ripple/protocol/STObject.h>
|
||||
#include <ripple/protocol/STTx.h>
|
||||
#include <boost/beast/core/detail/type_traits.hpp>
|
||||
#include <beast/core/detail/type_traits.hpp>
|
||||
#include <ripple/beast/unit_test.h>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
@@ -711,7 +711,7 @@ protected:
|
||||
FN const&... fN)
|
||||
{
|
||||
maybe_invoke(stx, f,
|
||||
boost::beast::detail::is_invocable<F,
|
||||
beast::detail::is_invocable<F,
|
||||
void(Env&, STTx const&)>());
|
||||
invoke(stx, fN...);
|
||||
}
|
||||
@@ -745,7 +745,7 @@ protected:
|
||||
FN const&... fN)
|
||||
{
|
||||
maybe_invoke(jt, f,
|
||||
boost::beast::detail::is_invocable<F,
|
||||
beast::detail::is_invocable<F,
|
||||
void(Env&, JTx&)>());
|
||||
invoke(jt, fN...);
|
||||
}
|
||||
|
||||
@@ -19,13 +19,14 @@
|
||||
#ifndef RIPPLE_TEST_TRUSTED_PUBLISHER_SERVER_H_INCLUDED
|
||||
#define RIPPLE_TEST_TRUSTED_PUBLISHER_SERVER_H_INCLUDED
|
||||
|
||||
#include <beast/core/detail/base64.hpp>
|
||||
#include <ripple/protocol/PublicKey.h>
|
||||
#include <ripple/protocol/SecretKey.h>
|
||||
#include <ripple/protocol/Sign.h>
|
||||
#include <ripple/basics/strHex.h>
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/beast/core/detail/base64.hpp>
|
||||
#include <boost/beast/http.hpp>
|
||||
#include <beast/core/detail/base64.hpp>
|
||||
#include <beast/http.hpp>
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
@@ -36,8 +37,8 @@ class TrustedPublisherServer
|
||||
using address_type = boost::asio::ip::address;
|
||||
using socket_type = boost::asio::ip::tcp::socket;
|
||||
|
||||
using req_type = boost::beast::http::request<boost::beast::http::string_body>;
|
||||
using resp_type = boost::beast::http::response<boost::beast::http::string_body>;
|
||||
using req_type = beast::http::request<beast::http::string_body>;
|
||||
using resp_type = beast::http::response<beast::http::string_body>;
|
||||
using error_code = boost::system::error_code;
|
||||
|
||||
socket_type sock_;
|
||||
@@ -77,7 +78,7 @@ public:
|
||||
}
|
||||
data.pop_back();
|
||||
data += "]}";
|
||||
std::string blob = boost::beast::detail::base64_encode(data);
|
||||
std::string blob = beast::detail::base64_encode(data);
|
||||
|
||||
list_ = "{\"blob\":\"" + blob + "\"";
|
||||
|
||||
@@ -154,35 +155,35 @@ private:
|
||||
do_peer(int id, socket_type&& sock0)
|
||||
{
|
||||
socket_type sock(std::move(sock0));
|
||||
boost::beast::multi_buffer sb;
|
||||
beast::multi_buffer sb;
|
||||
error_code ec;
|
||||
for (;;)
|
||||
{
|
||||
req_type req;
|
||||
boost::beast::http::read(sock, sb, req, ec);
|
||||
beast::http::read(sock, sb, req, ec);
|
||||
if (ec)
|
||||
break;
|
||||
auto path = req.target().to_string();
|
||||
if (path != "/validators")
|
||||
{
|
||||
resp_type res;
|
||||
res.result(boost::beast::http::status::not_found);
|
||||
res.version(req.version());
|
||||
res.result(beast::http::status::not_found);
|
||||
res.version = req.version;
|
||||
res.insert("Server", "TrustedPublisherServer");
|
||||
res.insert("Content-Type", "text/html");
|
||||
res.body() = "The file '" + path + "' was not found";
|
||||
res.body = "The file '" + path + "' was not found";
|
||||
res.prepare_payload();
|
||||
write(sock, res, ec);
|
||||
if (ec)
|
||||
break;
|
||||
}
|
||||
resp_type res;
|
||||
res.result(boost::beast::http::status::ok);
|
||||
res.version(req.version());
|
||||
res.result(beast::http::status::ok);
|
||||
res.version = req.version;
|
||||
res.insert("Server", "TrustedPublisherServer");
|
||||
res.insert("Content-Type", "application/json");
|
||||
|
||||
res.body() = list_;
|
||||
res.body = list_;
|
||||
try
|
||||
{
|
||||
res.prepare_payload();
|
||||
@@ -190,11 +191,11 @@ private:
|
||||
catch (std::exception const& e)
|
||||
{
|
||||
res = {};
|
||||
res.result(boost::beast::http::status::internal_server_error);
|
||||
res.version(req.version());
|
||||
res.result(beast::http::status::internal_server_error);
|
||||
res.version = req.version;
|
||||
res.insert("Server", "TrustedPublisherServer");
|
||||
res.insert("Content-Type", "text/html");
|
||||
res.body() = std::string{"An internal error occurred"} + e.what();
|
||||
res.body = std::string{"An internal error occurred"} + e.what();
|
||||
res.prepare_payload();
|
||||
}
|
||||
write(sock, res, ec);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <test/jtx/WSClient.h>
|
||||
#include <test/jtx.h>
|
||||
#include <ripple/beast/unit_test.h>
|
||||
#include <beast/core/handler_alloc.hpp>
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <ripple/protocol/JsonFields.h>
|
||||
#include <ripple/server/Port.h>
|
||||
#include <boost/beast/http/message.hpp>
|
||||
#include <boost/beast/http/dynamic_body.hpp>
|
||||
#include <boost/beast/http/string_body.hpp>
|
||||
#include <boost/beast/http/read.hpp>
|
||||
#include <boost/beast/http/write.hpp>
|
||||
#include <beast/http/message.hpp>
|
||||
#include <beast/http/dynamic_body.hpp>
|
||||
#include <beast/http/string_body.hpp>
|
||||
#include <beast/http/read.hpp>
|
||||
#include <beast/http/write.hpp>
|
||||
#include <boost/asio.hpp>
|
||||
#include <string>
|
||||
|
||||
@@ -74,8 +74,8 @@ class JSONRPCClient : public AbstractClient
|
||||
boost::asio::ip::tcp::endpoint ep_;
|
||||
boost::asio::io_service ios_;
|
||||
boost::asio::ip::tcp::socket stream_;
|
||||
boost::beast::multi_buffer bin_;
|
||||
boost::beast::multi_buffer bout_;
|
||||
beast::multi_buffer bin_;
|
||||
beast::multi_buffer bout_;
|
||||
unsigned rpc_version_;
|
||||
|
||||
public:
|
||||
@@ -104,14 +104,14 @@ public:
|
||||
invoke(std::string const& cmd,
|
||||
Json::Value const& params) override
|
||||
{
|
||||
using namespace boost::beast::http;
|
||||
using namespace beast::http;
|
||||
using namespace boost::asio;
|
||||
using namespace std::string_literals;
|
||||
|
||||
request<string_body> req;
|
||||
req.method(boost::beast::http::verb::post);
|
||||
req.method(beast::http::verb::post);
|
||||
req.target("/");
|
||||
req.version(11);
|
||||
req.version = 11;
|
||||
req.insert("Content-Type", "application/json; charset=UTF-8");
|
||||
req.insert("Host", ep_);
|
||||
{
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
Json::Value& ja = jr[jss::params] = Json::arrayValue;
|
||||
ja.append(params);
|
||||
}
|
||||
req.body() = to_string(jr);
|
||||
req.body = to_string(jr);
|
||||
}
|
||||
req.prepare_payload();
|
||||
write(stream_, req);
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
|
||||
Json::Reader jr;
|
||||
Json::Value jv;
|
||||
jr.parse(buffer_string(res.body().data()), jv);
|
||||
jr.parse(buffer_string(res.body.data()), jv);
|
||||
if(jv["result"].isMember("error"))
|
||||
jv["error"] = jv["result"]["error"];
|
||||
if(jv["result"].isMember("status"))
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <ripple/protocol/JsonFields.h>
|
||||
#include <ripple/server/Port.h>
|
||||
#include <boost/beast/core/multi_buffer.hpp>
|
||||
#include <boost/beast/websocket.hpp>
|
||||
#include <beast/core/multi_buffer.hpp>
|
||||
#include <beast/websocket.hpp>
|
||||
|
||||
#include <condition_variable>
|
||||
|
||||
@@ -93,8 +93,8 @@ class WSClientImpl : public WSClient
|
||||
boost::asio::io_service::strand strand_;
|
||||
std::thread thread_;
|
||||
boost::asio::ip::tcp::socket stream_;
|
||||
boost::beast::websocket::stream<boost::asio::ip::tcp::socket&> ws_;
|
||||
boost::beast::multi_buffer rb_;
|
||||
beast::websocket::stream<boost::asio::ip::tcp::socket&> ws_;
|
||||
beast::multi_buffer rb_;
|
||||
|
||||
bool peerClosed_ = false;
|
||||
|
||||
@@ -110,17 +110,13 @@ class WSClientImpl : public WSClient
|
||||
|
||||
unsigned rpc_version_;
|
||||
|
||||
void
|
||||
cleanup()
|
||||
void cleanup()
|
||||
{
|
||||
ios_.post(strand_.wrap([this] {
|
||||
error_code ec;
|
||||
if (!peerClosed_)
|
||||
{
|
||||
ws_.async_close({}, strand_.wrap([&](error_code ec) {
|
||||
stream_.cancel(ec);
|
||||
}));
|
||||
}
|
||||
ws_.close({}, ec);
|
||||
stream_.close(ec);
|
||||
}));
|
||||
work_ = boost::none;
|
||||
thread_.join();
|
||||
@@ -178,7 +174,7 @@ public:
|
||||
else
|
||||
jp[jss::command] = cmd;
|
||||
auto const s = to_string(jp);
|
||||
ws_.write_some(true, buffer(s));
|
||||
ws_.write_frame(true, buffer(s));
|
||||
}
|
||||
|
||||
auto jv = findMsg(5s,
|
||||
@@ -264,7 +260,7 @@ private:
|
||||
{
|
||||
if(ec)
|
||||
{
|
||||
if(ec == boost::beast::websocket::error::closed)
|
||||
if(ec == beast::websocket::error::closed)
|
||||
peerClosed_ = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <nudb/create.hpp>
|
||||
#include <nudb/detail/format.hpp>
|
||||
#include <nudb/xxhasher.hpp>
|
||||
#include <boost/beast/core/string.hpp>
|
||||
#include <beast/core/string.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
@@ -258,7 +258,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
std::map <std::string, std::string, boost::beast::iless>
|
||||
std::map <std::string, std::string, beast::iless>
|
||||
parse_args(std::string const& s)
|
||||
{
|
||||
// <key> '=' <value>
|
||||
@@ -274,7 +274,7 @@ parse_args(std::string const& s)
|
||||
, boost::regex_constants::optimize
|
||||
);
|
||||
std::map <std::string,
|
||||
std::string, boost::beast::iless> map;
|
||||
std::string, beast::iless> map;
|
||||
auto const v = beast::rfc2616::split(
|
||||
s.begin(), s.end(), ',');
|
||||
for (auto const& kv : v)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <ripple/json/json_value.h>
|
||||
#include <ripple/protocol/JsonFields.h>
|
||||
#include <ripple/protocol/Sign.h>
|
||||
#include <boost/beast/core/detail/base64.hpp>
|
||||
#include <beast/core/detail/base64.hpp>
|
||||
#include <test/jtx.h>
|
||||
#include <test/jtx/TrustedPublisherServer.h>
|
||||
|
||||
@@ -76,7 +76,7 @@ class ValidatorRPC_test : public beast::unit_test::suite
|
||||
Serializer s;
|
||||
st.add(s);
|
||||
|
||||
return boost::beast::detail::base64_encode(
|
||||
return beast::detail::base64_encode(
|
||||
std::string(static_cast<char const*>(s.data()), s.size()));
|
||||
}
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
#include <test/jtx/JSONRPCClient.h>
|
||||
#include <ripple/app/misc/NetworkOPs.h>
|
||||
#include <ripple/app/ledger/LedgerMaster.h>
|
||||
#include <boost/beast/http.hpp>
|
||||
#include <beast/http.hpp>
|
||||
#include <beast/test/yield_to.hpp>
|
||||
#include <boost/beast/websocket/detail/mask.hpp>
|
||||
#include <boost/beast/core/multi_buffer.hpp>
|
||||
#include <beast/websocket/detail/mask.hpp>
|
||||
#include <beast/core/multi_buffer.hpp>
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/asio/ssl.hpp>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
@@ -42,7 +42,7 @@ namespace test {
|
||||
class ServerStatus_test :
|
||||
public beast::unit_test::suite, public beast::test::enable_yield_to
|
||||
{
|
||||
class myFields : public boost::beast::http::fields {};
|
||||
class myFields : public beast::http::fields {};
|
||||
|
||||
auto makeConfig(
|
||||
std::string const& proto,
|
||||
@@ -88,21 +88,21 @@ class ServerStatus_test :
|
||||
uint16_t port)
|
||||
{
|
||||
using namespace boost::asio;
|
||||
using namespace boost::beast::http;
|
||||
using namespace beast::http;
|
||||
request<string_body> req;
|
||||
|
||||
req.target("/");
|
||||
req.version(11);
|
||||
req.version = 11;
|
||||
req.insert("Host", host + ":" + std::to_string(port));
|
||||
req.insert("User-Agent", "test");
|
||||
req.method(boost::beast::http::verb::get);
|
||||
req.method(beast::http::verb::get);
|
||||
req.insert("Upgrade", "websocket");
|
||||
boost::beast::websocket::detail::maskgen maskgen;
|
||||
boost::beast::websocket::detail::sec_ws_key_type key;
|
||||
boost::beast::websocket::detail::make_sec_ws_key(key, maskgen);
|
||||
beast::websocket::detail::maskgen maskgen;
|
||||
beast::websocket::detail::sec_ws_key_type key;
|
||||
beast::websocket::detail::make_sec_ws_key(key, maskgen);
|
||||
req.insert("Sec-WebSocket-Key", key);
|
||||
req.insert("Sec-WebSocket-Version", "13");
|
||||
req.insert(boost::beast::http::field::connection, "upgrade");
|
||||
req.insert(beast::http::field::connection, "upgrade");
|
||||
return req;
|
||||
}
|
||||
|
||||
@@ -113,24 +113,24 @@ class ServerStatus_test :
|
||||
myFields const& fields)
|
||||
{
|
||||
using namespace boost::asio;
|
||||
using namespace boost::beast::http;
|
||||
using namespace beast::http;
|
||||
request<string_body> req;
|
||||
|
||||
req.target("/");
|
||||
req.version(11);
|
||||
req.version = 11;
|
||||
for(auto const& f : fields)
|
||||
req.insert(f.name(), f.value());
|
||||
req.insert("Host", host + ":" + std::to_string(port));
|
||||
req.insert("User-Agent", "test");
|
||||
if(body.empty())
|
||||
{
|
||||
req.method(boost::beast::http::verb::get);
|
||||
req.method(beast::http::verb::get);
|
||||
}
|
||||
else
|
||||
{
|
||||
req.method(boost::beast::http::verb::post);
|
||||
req.method(beast::http::verb::post);
|
||||
req.insert("Content-Type", "application/json; charset=UTF-8");
|
||||
req.body() = body;
|
||||
req.body = body;
|
||||
}
|
||||
req.prepare_payload();
|
||||
|
||||
@@ -140,18 +140,18 @@ class ServerStatus_test :
|
||||
void
|
||||
doRequest(
|
||||
boost::asio::yield_context& yield,
|
||||
boost::beast::http::request<boost::beast::http::string_body>&& req,
|
||||
beast::http::request<beast::http::string_body>&& req,
|
||||
std::string const& host,
|
||||
uint16_t port,
|
||||
bool secure,
|
||||
boost::beast::http::response<boost::beast::http::string_body>& resp,
|
||||
beast::http::response<beast::http::string_body>& resp,
|
||||
boost::system::error_code& ec)
|
||||
{
|
||||
using namespace boost::asio;
|
||||
using namespace boost::beast::http;
|
||||
using namespace beast::http;
|
||||
io_service& ios = get_io_service();
|
||||
ip::tcp::resolver r{ios};
|
||||
boost::beast::multi_buffer sb;
|
||||
beast::multi_buffer sb;
|
||||
|
||||
auto it =
|
||||
r.async_resolve(
|
||||
@@ -170,7 +170,7 @@ class ServerStatus_test :
|
||||
ss.async_handshake(ssl::stream_base::client, yield[ec]);
|
||||
if(ec)
|
||||
return;
|
||||
boost::beast::http::async_write(ss, req, yield[ec]);
|
||||
beast::http::async_write(ss, req, yield[ec]);
|
||||
if(ec)
|
||||
return;
|
||||
async_read(ss, sb, resp, yield[ec]);
|
||||
@@ -183,7 +183,7 @@ class ServerStatus_test :
|
||||
async_connect(sock, it, yield[ec]);
|
||||
if(ec)
|
||||
return;
|
||||
boost::beast::http::async_write(sock, req, yield[ec]);
|
||||
beast::http::async_write(sock, req, yield[ec]);
|
||||
if(ec)
|
||||
return;
|
||||
async_read(sock, sb, resp, yield[ec]);
|
||||
@@ -199,7 +199,7 @@ class ServerStatus_test :
|
||||
test::jtx::Env& env,
|
||||
boost::asio::yield_context& yield,
|
||||
bool secure,
|
||||
boost::beast::http::response<boost::beast::http::string_body>& resp,
|
||||
beast::http::response<beast::http::string_body>& resp,
|
||||
boost::system::error_code& ec)
|
||||
{
|
||||
auto const port = env.app().config()["port_ws"].
|
||||
@@ -222,7 +222,7 @@ class ServerStatus_test :
|
||||
test::jtx::Env& env,
|
||||
boost::asio::yield_context& yield,
|
||||
bool secure,
|
||||
boost::beast::http::response<boost::beast::http::string_body>& resp,
|
||||
beast::http::response<beast::http::string_body>& resp,
|
||||
boost::system::error_code& ec,
|
||||
std::string const& body = "",
|
||||
myFields const& fields = {})
|
||||
@@ -384,21 +384,21 @@ class ServerStatus_test :
|
||||
//non-secure request
|
||||
{
|
||||
boost::system::error_code ec;
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
doWSRequest(env, yield, false, resp, ec);
|
||||
if(! BEAST_EXPECTS(! ec, ec.message()))
|
||||
return;
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::unauthorized);
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::unauthorized);
|
||||
}
|
||||
|
||||
//secure request
|
||||
{
|
||||
boost::system::error_code ec;
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
doWSRequest(env, yield, true, resp, ec);
|
||||
if(! BEAST_EXPECTS(! ec, ec.message()))
|
||||
return;
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::unauthorized);
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::unauthorized);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,21 +417,21 @@ class ServerStatus_test :
|
||||
//non-secure request
|
||||
{
|
||||
boost::system::error_code ec;
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
doHTTPRequest(env, yield, false, resp, ec);
|
||||
if(! BEAST_EXPECTS(! ec, ec.message()))
|
||||
return;
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::ok);
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::ok);
|
||||
}
|
||||
|
||||
//secure request
|
||||
{
|
||||
boost::system::error_code ec;
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
doHTTPRequest(env, yield, true, resp, ec);
|
||||
if(! BEAST_EXPECTS(! ec, ec.message()))
|
||||
return;
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::ok);
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::ok);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -441,7 +441,7 @@ class ServerStatus_test :
|
||||
testcase("Partial WS upgrade request");
|
||||
using namespace jtx;
|
||||
using namespace boost::asio;
|
||||
using namespace boost::beast::http;
|
||||
using namespace beast::http;
|
||||
Env env {*this, envconfig([](std::unique_ptr<Config> cfg)
|
||||
{
|
||||
cfg->section("port_ws").set("protocol", "ws2");
|
||||
@@ -463,7 +463,7 @@ class ServerStatus_test :
|
||||
|
||||
io_service& ios = get_io_service();
|
||||
ip::tcp::resolver r{ios};
|
||||
boost::beast::multi_buffer sb;
|
||||
beast::multi_buffer sb;
|
||||
|
||||
auto it =
|
||||
r.async_resolve(
|
||||
@@ -498,7 +498,7 @@ class ServerStatus_test :
|
||||
using namespace jtx;
|
||||
Env env {*this, makeConfig(server_protocol)};
|
||||
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
boost::system::error_code ec;
|
||||
if(boost::starts_with(client_protocol, "h"))
|
||||
{
|
||||
@@ -540,23 +540,23 @@ class ServerStatus_test :
|
||||
|
||||
Json::Value jr;
|
||||
jr[jss::method] = "server_info";
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
boost::system::error_code ec;
|
||||
doHTTPRequest(env, yield, secure, resp, ec, to_string(jr));
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::forbidden);
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::forbidden);
|
||||
|
||||
myFields auth;
|
||||
auth.insert("Authorization", "");
|
||||
doHTTPRequest(env, yield, secure, resp, ec, to_string(jr), auth);
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::forbidden);
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::forbidden);
|
||||
|
||||
auth.set("Authorization", "Basic NOT-VALID");
|
||||
doHTTPRequest(env, yield, secure, resp, ec, to_string(jr), auth);
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::forbidden);
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::forbidden);
|
||||
|
||||
auth.set("Authorization", "Basic " + boost::beast::detail::base64_encode("me:badpass"));
|
||||
auth.set("Authorization", "Basic " + beast::detail::base64_encode("me:badpass"));
|
||||
doHTTPRequest(env, yield, secure, resp, ec, to_string(jr), auth);
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::forbidden);
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::forbidden);
|
||||
|
||||
auto const user = env.app().config().section("port_rpc").
|
||||
get<std::string>("user").value();
|
||||
@@ -566,14 +566,14 @@ class ServerStatus_test :
|
||||
// try with the correct user/pass, but not encoded
|
||||
auth.set("Authorization", "Basic " + user + ":" + pass);
|
||||
doHTTPRequest(env, yield, secure, resp, ec, to_string(jr), auth);
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::forbidden);
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::forbidden);
|
||||
|
||||
// finally if we use the correct user/pass encoded, we should get a 200
|
||||
auth.set("Authorization", "Basic " +
|
||||
boost::beast::detail::base64_encode(user + ":" + pass));
|
||||
beast::detail::base64_encode(user + ":" + pass));
|
||||
doHTTPRequest(env, yield, secure, resp, ec, to_string(jr), auth);
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::ok);
|
||||
BEAST_EXPECT(! resp.body().empty());
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::ok);
|
||||
BEAST_EXPECT(! resp.body.empty());
|
||||
}
|
||||
|
||||
void
|
||||
@@ -583,7 +583,7 @@ class ServerStatus_test :
|
||||
|
||||
using namespace test::jtx;
|
||||
using namespace boost::asio;
|
||||
using namespace boost::beast::http;
|
||||
using namespace beast::http;
|
||||
Env env {*this, envconfig([&](std::unique_ptr<Config> cfg) {
|
||||
(*cfg)["port_rpc"].set("limit", to_string(limit));
|
||||
return cfg;
|
||||
@@ -607,7 +607,7 @@ class ServerStatus_test :
|
||||
ip::tcp::resolver::query{ip, to_string(port)}, yield[ec]);
|
||||
BEAST_EXPECT(! ec);
|
||||
|
||||
std::vector<std::pair<ip::tcp::socket, boost::beast::multi_buffer>> clients;
|
||||
std::vector<std::pair<ip::tcp::socket, beast::multi_buffer>> clients;
|
||||
int connectionCount {1}; //starts at 1 because the Env already has one
|
||||
//for JSONRPCCLient
|
||||
|
||||
@@ -620,7 +620,7 @@ class ServerStatus_test :
|
||||
while (connectionCount < testTo)
|
||||
{
|
||||
clients.emplace_back(
|
||||
std::make_pair(ip::tcp::socket {ios}, boost::beast::multi_buffer{}));
|
||||
std::make_pair(ip::tcp::socket {ios}, beast::multi_buffer{}));
|
||||
async_connect(clients.back().first, it, yield[ec]);
|
||||
BEAST_EXPECT(! ec);
|
||||
auto req = makeHTTPRequest(ip, port, to_string(jr), {});
|
||||
@@ -635,7 +635,7 @@ class ServerStatus_test :
|
||||
int readCount = 0;
|
||||
for (auto& c : clients)
|
||||
{
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
async_read(c.first, c.second, resp, yield[ec]);
|
||||
++readCount;
|
||||
// expect the reads to fail for the clients that connected at or
|
||||
@@ -659,11 +659,11 @@ class ServerStatus_test :
|
||||
get<std::uint16_t>("port").value();
|
||||
auto const ip = env.app().config()["port_ws"].
|
||||
get<std::string>("ip").value();
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
boost::system::error_code ec;
|
||||
doRequest(
|
||||
yield, makeWSUpgrade(ip, port), ip, port, true, resp, ec);
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::switching_protocols);
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::switching_protocols);
|
||||
BEAST_EXPECT(resp.find("Upgrade") != resp.end() &&
|
||||
resp["Upgrade"] == "websocket");
|
||||
BEAST_EXPECT(resp.find("Connection") != resp.end() &&
|
||||
@@ -682,14 +682,14 @@ class ServerStatus_test :
|
||||
get<std::uint16_t>("port").value();
|
||||
auto const ip = env.app().config()["port_ws"].
|
||||
get<std::string>("ip").value();
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
boost::system::error_code ec;
|
||||
// body content is required here to avoid being
|
||||
// detected as a status request
|
||||
doRequest(yield,
|
||||
makeHTTPRequest(ip, port, "foo", {}), ip, port, false, resp, ec);
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::forbidden);
|
||||
BEAST_EXPECT(resp.body() == "Forbidden\r\n");
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::forbidden);
|
||||
BEAST_EXPECT(resp.body == "Forbidden\r\n");
|
||||
}
|
||||
|
||||
void
|
||||
@@ -699,7 +699,7 @@ class ServerStatus_test :
|
||||
|
||||
using namespace test::jtx;
|
||||
using namespace boost::asio;
|
||||
using namespace boost::beast::http;
|
||||
using namespace beast::http;
|
||||
Env env {*this};
|
||||
|
||||
auto const port = env.app().config()["port_ws"].
|
||||
@@ -722,17 +722,17 @@ class ServerStatus_test :
|
||||
if(! BEAST_EXPECT(! ec))
|
||||
return;
|
||||
|
||||
boost::beast::websocket::stream<boost::asio::ip::tcp::socket&> ws{sock};
|
||||
beast::websocket::stream<boost::asio::ip::tcp::socket&> ws{sock};
|
||||
ws.handshake(ip + ":" + to_string(port), "/");
|
||||
|
||||
// helper lambda, used below
|
||||
auto sendAndParse = [&](std::string const& req) -> Json::Value
|
||||
{
|
||||
ws.async_write_some(true, buffer(req), yield[ec]);
|
||||
ws.async_write_frame(true, buffer(req), yield[ec]);
|
||||
if(! BEAST_EXPECT(! ec))
|
||||
return Json::objectValue;
|
||||
|
||||
boost::beast::multi_buffer sb;
|
||||
beast::multi_buffer sb;
|
||||
ws.async_read(sb, yield[ec]);
|
||||
if(! BEAST_EXPECT(! ec))
|
||||
return Json::objectValue;
|
||||
@@ -741,7 +741,7 @@ class ServerStatus_test :
|
||||
Json::Reader jr;
|
||||
if(! BEAST_EXPECT(jr.parse(
|
||||
boost::lexical_cast<std::string>(
|
||||
boost::beast::buffers(sb.data())), resp)))
|
||||
beast::buffers(sb.data())), resp)))
|
||||
return Json::objectValue;
|
||||
sb.consume(sb.size());
|
||||
return resp;
|
||||
@@ -783,7 +783,7 @@ class ServerStatus_test :
|
||||
testcase("Status request over WS and RPC with/without Amendment Block");
|
||||
using namespace jtx;
|
||||
using namespace boost::asio;
|
||||
using namespace boost::beast::http;
|
||||
using namespace beast::http;
|
||||
Env env {*this, validator( envconfig([](std::unique_ptr<Config> cfg)
|
||||
{
|
||||
cfg->section("port_rpc").set("protocol", "http");
|
||||
@@ -824,9 +824,9 @@ class ServerStatus_test :
|
||||
|
||||
if(! BEAST_EXPECTS(! ec, ec.message()))
|
||||
return;
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::ok);
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::ok);
|
||||
BEAST_EXPECT(
|
||||
resp.body().find("connectivity is working.") != std::string::npos);
|
||||
resp.body.find("connectivity is working.") != std::string::npos);
|
||||
|
||||
// mark the Network as Amendment Blocked, but still won't fail until
|
||||
// ELB is enabled (next step)
|
||||
@@ -856,9 +856,9 @@ class ServerStatus_test :
|
||||
|
||||
if(! BEAST_EXPECTS(! ec, ec.message()))
|
||||
return;
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::ok);
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::ok);
|
||||
BEAST_EXPECT(
|
||||
resp.body().find("connectivity is working.") != std::string::npos);
|
||||
resp.body.find("connectivity is working.") != std::string::npos);
|
||||
|
||||
env.app().config().ELB_SUPPORT = true;
|
||||
|
||||
@@ -873,11 +873,11 @@ class ServerStatus_test :
|
||||
|
||||
if(! BEAST_EXPECTS(! ec, ec.message()))
|
||||
return;
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::internal_server_error);
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::internal_server_error);
|
||||
BEAST_EXPECT(
|
||||
resp.body().find("cannot accept clients:") != std::string::npos);
|
||||
resp.body.find("cannot accept clients:") != std::string::npos);
|
||||
BEAST_EXPECT(
|
||||
resp.body().find("Server version too old") != std::string::npos);
|
||||
resp.body.find("Server version too old") != std::string::npos);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -890,53 +890,53 @@ class ServerStatus_test :
|
||||
|
||||
boost::system::error_code ec;
|
||||
{
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
doHTTPRequest(env, yield, false, resp, ec, "{}");
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
|
||||
BEAST_EXPECT(resp.body() == "Unable to parse request: \r\n");
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::bad_request);
|
||||
BEAST_EXPECT(resp.body == "Unable to parse request: \r\n");
|
||||
}
|
||||
|
||||
Json::Value jv;
|
||||
{
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
jv[jss::method] = Json::nullValue;
|
||||
doHTTPRequest(env, yield, false, resp, ec, to_string(jv));
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
|
||||
BEAST_EXPECT(resp.body() == "Null method\r\n");
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::bad_request);
|
||||
BEAST_EXPECT(resp.body == "Null method\r\n");
|
||||
}
|
||||
|
||||
{
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
jv[jss::method] = 1;
|
||||
doHTTPRequest(env, yield, false, resp, ec, to_string(jv));
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
|
||||
BEAST_EXPECT(resp.body() == "method is not string\r\n");
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::bad_request);
|
||||
BEAST_EXPECT(resp.body == "method is not string\r\n");
|
||||
}
|
||||
|
||||
{
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
jv[jss::method] = "";
|
||||
doHTTPRequest(env, yield, false, resp, ec, to_string(jv));
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
|
||||
BEAST_EXPECT(resp.body() == "method is empty\r\n");
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::bad_request);
|
||||
BEAST_EXPECT(resp.body == "method is empty\r\n");
|
||||
}
|
||||
|
||||
{
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
jv[jss::method] = "some_method";
|
||||
jv[jss::params] = "params";
|
||||
doHTTPRequest(env, yield, false, resp, ec, to_string(jv));
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
|
||||
BEAST_EXPECT(resp.body() == "params unparseable\r\n");
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::bad_request);
|
||||
BEAST_EXPECT(resp.body == "params unparseable\r\n");
|
||||
}
|
||||
|
||||
{
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
jv[jss::params] = Json::arrayValue;
|
||||
jv[jss::params][0u] = "not an object";
|
||||
doHTTPRequest(env, yield, false, resp, ec, to_string(jv));
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
|
||||
BEAST_EXPECT(resp.body() == "params unparseable\r\n");
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::bad_request);
|
||||
BEAST_EXPECT(resp.body == "params unparseable\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -954,12 +954,12 @@ class ServerStatus_test :
|
||||
//raise the fee so that the server is considered overloaded
|
||||
env.app().getFeeTrack().raiseLocalFee();
|
||||
|
||||
boost::beast::http::response<boost::beast::http::string_body> resp;
|
||||
beast::http::response<beast::http::string_body> resp;
|
||||
boost::system::error_code ec;
|
||||
doHTTPRequest(env, yield, false, resp, ec);
|
||||
BEAST_EXPECT(resp.result() == boost::beast::http::status::internal_server_error);
|
||||
BEAST_EXPECT(resp.result() == beast::http::status::internal_server_error);
|
||||
std::regex body {"Server cannot accept clients"};
|
||||
BEAST_EXPECT(std::regex_search(resp.body(), body));
|
||||
BEAST_EXPECT(std::regex_search(resp.body, body));
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef TEST_UNIT_TEST_MULTI_RUNNER_H
|
||||
#define TEST_UNIT_TEST_MULTI_RUNNER_H
|
||||
|
||||
#include <boost/beast/core/static_string.hpp>
|
||||
#include <beast/include/beast/core/static_string.hpp>
|
||||
#include <beast/unit_test/global_suites.hpp>
|
||||
#include <beast/unit_test/runner.hpp>
|
||||
|
||||
@@ -78,7 +78,7 @@ struct suite_results
|
||||
|
||||
struct results
|
||||
{
|
||||
using static_string = boost::beast::static_string<256>;
|
||||
using static_string = beast::static_string<256>;
|
||||
// results may be stored in shared memory. Use `static_string` to ensure
|
||||
// pointers from different memory spaces do not co-mingle
|
||||
using run_time = std::pair<static_string, typename clock_type::duration>;
|
||||
|
||||
Reference in New Issue
Block a user