diff --git a/Builds/VisualStudio2015/RippleD.vcxproj b/Builds/VisualStudio2015/RippleD.vcxproj index 20dd9bceb7..fb68dd3e77 100644 --- a/Builds/VisualStudio2015/RippleD.vcxproj +++ b/Builds/VisualStudio2015/RippleD.vcxproj @@ -266,13 +266,15 @@ - + + + - + @@ -280,155 +282,183 @@ - - - - - + - + - + + + - + - + - + - + - - - - + + + + + + + + + + - - - - + + + + + + - + + + + + - + - + - + + + + + + + - + - + - + + + - + - + - - - + - + - + - + - - - - - - - + + + + + + + + + - + - + - + + + + + + + - - - + + + + + + + - - - - - + - - - + + + + + + + + + + + - - - - - - + + - + @@ -446,6 +476,8 @@ + + diff --git a/Builds/VisualStudio2015/RippleD.vcxproj.filters b/Builds/VisualStudio2015/RippleD.vcxproj.filters index 03fc1ae808..bac2171c94 100644 --- a/Builds/VisualStudio2015/RippleD.vcxproj.filters +++ b/Builds/VisualStudio2015/RippleD.vcxproj.filters @@ -558,16 +558,19 @@ beast - + beast\core beast\core + + beast\core + beast\core - + beast\core @@ -579,130 +582,145 @@ beast\core\detail - - beast\core\detail - - - beast\core\detail - - + beast\core\detail beast\core\detail - + beast\core\detail - + + beast\core\detail + + beast\core\detail beast\core\detail - + beast\core\detail - + beast\core\detail beast\core\detail - + beast\core\detail - + beast\core\detail beast\core\detail - - beast\core\detail - - + beast\core - + + beast\core + + + beast\core + + + beast\core + + + beast\core + + beast\core beast\core - - beast\core - - - beast\core - beast\core + + beast\core\impl + + + beast\core\impl + + + beast\core\impl + beast\core\impl - + + beast\core\impl + + + beast\core\impl + + beast\core\impl beast\core\impl - + beast\core\impl - + beast\core\impl - + + beast\core\impl + + + beast\core\impl + + + beast\core\impl + + beast\core - + beast\core - + beast\core - + + beast\core + + beast\core beast\core - + beast\core - + beast\core - - beast\core - - + beast\core beast - + beast\http - + beast\http - - beast\http - - - beast\http - - - beast\http - - + beast\http\detail - + beast\http\detail @@ -711,28 +729,46 @@ beast\http\detail + + beast\http\detail + + + beast\http + beast\http + + beast\http + + + beast\http + beast\http - + beast\http - + beast\http\impl - + + beast\http\impl + + + beast\http\impl + + + beast\http\impl + + beast\http\impl beast\http\impl - - beast\http\impl - - + beast\http\impl @@ -741,36 +777,51 @@ beast\http\impl + + beast\http\impl + + + beast\http\impl + + + beast\http\impl + beast\http\impl beast\http - - beast\http - - - beast\http - - + beast\http beast\http - - beast\http - beast\http - + + beast\http + + + beast\http + + beast\http beast\http + + beast\http + + + beast\http + + + beast\http + beast\http @@ -780,28 +831,22 @@ beast - - beast\websocket\detail - - - beast\websocket\detail - beast\websocket\detail beast\websocket\detail - + beast\websocket\detail - + beast\websocket\detail beast\websocket\detail - + beast\websocket\detail @@ -828,6 +873,9 @@ beast\websocket\impl + + beast\websocket\impl + beast\websocket\impl diff --git a/src/ripple/app/main/Application.cpp b/src/ripple/app/main/Application.cpp index 7f3675a7be..30c4f758c6 100644 --- a/src/ripple/app/main/Application.cpp +++ b/src/ripple/app/main/Application.cpp @@ -1571,7 +1571,7 @@ bool ApplicationImp::loadOldLedger ( } } } - else if (ledgerID.empty () || beast::detail::ci_equal(ledgerID, "latest")) + else if (ledgerID.empty () || beast::detail::iequals(ledgerID, "latest")) { loadLedger = getLastFullLedger (); } diff --git a/src/ripple/app/misc/detail/WorkBase.h b/src/ripple/app/misc/detail/WorkBase.h index 2c5812b41a..1c59ab664e 100644 --- a/src/ripple/app/misc/detail/WorkBase.h +++ b/src/ripple/app/misc/detail/WorkBase.h @@ -180,10 +180,10 @@ WorkBase::onStart() req_.method(beast::http::verb::get); req_.target(path_.empty() ? "/" : path_); req_.version = 11; - req_.replace ( + req_.set ( "Host", host_ + ":" + port_); - req_.replace ("User-Agent", BuildInfo::getFullVersionString()); - req_.prepare(); + req_.set ("User-Agent", BuildInfo::getFullVersionString()); + req_.prepare_payload(); beast::http::async_write(impl().stream(), req_, strand_.wrap (std::bind (&WorkBase::onRequest, impl().shared_from_this(), std::placeholders::_1))); diff --git a/src/ripple/basics/BasicConfig.h b/src/ripple/basics/BasicConfig.h index 4789beac9e..75c987b991 100644 --- a/src/ripple/basics/BasicConfig.h +++ b/src/ripple/basics/BasicConfig.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include @@ -41,7 +41,7 @@ using IniFileSections = std::map>; */ class Section : public beast::unit_test::detail::const_container < - std::map > + std::map > { private: std::string name_; @@ -173,7 +173,7 @@ public: class BasicConfig { private: - std::map map_; + std::map map_; public: /** Returns `true` if a section with the given name exists. */ diff --git a/src/ripple/basics/Log.h b/src/ripple/basics/Log.h index ea827e9d00..10debfa5de 100644 --- a/src/ripple/basics/Log.h +++ b/src/ripple/basics/Log.h @@ -21,7 +21,7 @@ #define RIPPLE_BASICS_LOG_H_INCLUDED #include -#include +#include #include #include #include @@ -148,7 +148,7 @@ private: std::mutex mutable mutex_; std::map , - beast::detail::ci_less> sinks_; + beast::iless> sinks_; beast::severities::Severity thresh_; File file_; bool silent_ = false; diff --git a/src/ripple/basics/impl/make_SSLContext.cpp b/src/ripple/basics/impl/make_SSLContext.cpp index 397fdedbfd..6fd519b86f 100644 --- a/src/ripple/basics/impl/make_SSLContext.cpp +++ b/src/ripple/basics/impl/make_SSLContext.cpp @@ -220,11 +220,15 @@ static void info_handler (SSL const* ssl, int event, int) { +#if OPENSSL_VERSION_NUMBER < 0x10100000L if ((ssl->s3) && (event & SSL_CB_HANDSHAKE_START)) { if (disallowRenegotiation (ssl, SSL_in_before (ssl))) ssl->s3->flags |= SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS; } +#else + // empty, flag removed in OpenSSL 1.1 +#endif } #endif @@ -448,4 +452,3 @@ make_SSLContextAuthed ( } } // ripple - diff --git a/src/ripple/beast/rfc2616.h b/src/ripple/beast/rfc2616.h index 9771939f82..b2c22d4031 100644 --- a/src/ripple/beast/rfc2616.h +++ b/src/ripple/beast/rfc2616.h @@ -279,7 +279,7 @@ split_commas(FwdIt first, FwdIt last) template > Result -split_commas(boost::string_ref const& s) +split_commas(beast::string_view const& s) { return split_commas(s.begin(), s.end()); } diff --git a/src/ripple/core/Config.h b/src/ripple/core/Config.h index 8be4e41242..6ef9c7537b 100644 --- a/src/ripple/core/Config.h +++ b/src/ripple/core/Config.h @@ -24,7 +24,7 @@ #include #include // VFALCO Breaks levelization #include -#include +#include #include #include // VFALCO FIX: This include should not be here #include // VFALCO FIX: This include should not be here diff --git a/src/ripple/core/impl/Config.cpp b/src/ripple/core/impl/Config.cpp index 6e61c518da..24cd49857c 100644 --- a/src/ripple/core/impl/Config.cpp +++ b/src/ripple/core/impl/Config.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -325,15 +325,15 @@ void Config::loadFromString (std::string const& fileContents) if (getSingleSection (secConfig, SECTION_NODE_SIZE, strTemp, j_)) { - if (beast::detail::ci_equal(strTemp, "tiny")) + if (beast::detail::iequals(strTemp, "tiny")) NODE_SIZE = 0; - else if (beast::detail::ci_equal(strTemp, "small")) + else if (beast::detail::iequals(strTemp, "small")) NODE_SIZE = 1; - else if (beast::detail::ci_equal(strTemp, "medium")) + else if (beast::detail::iequals(strTemp, "medium")) NODE_SIZE = 2; - else if (beast::detail::ci_equal(strTemp, "large")) + else if (beast::detail::iequals(strTemp, "large")) NODE_SIZE = 3; - else if (beast::detail::ci_equal(strTemp, "huge")) + else if (beast::detail::iequals(strTemp, "huge")) NODE_SIZE = 4; else { @@ -380,9 +380,9 @@ void Config::loadFromString (std::string const& fileContents) if (getSingleSection (secConfig, SECTION_LEDGER_HISTORY, strTemp, j_)) { - if (beast::detail::ci_equal(strTemp, "full")) + if (beast::detail::iequals(strTemp, "full")) LEDGER_HISTORY = 1000000000u; - else if (beast::detail::ci_equal(strTemp, "none")) + else if (beast::detail::iequals(strTemp, "none")) LEDGER_HISTORY = 0; else LEDGER_HISTORY = beast::lexicalCastThrow (strTemp); @@ -390,9 +390,9 @@ void Config::loadFromString (std::string const& fileContents) if (getSingleSection (secConfig, SECTION_FETCH_DEPTH, strTemp, j_)) { - if (beast::detail::ci_equal(strTemp, "none")) + if (beast::detail::iequals(strTemp, "none")) FETCH_DEPTH = 0; - else if (beast::detail::ci_equal(strTemp, "full")) + else if (beast::detail::iequals(strTemp, "full")) FETCH_DEPTH = 1000000000u; else FETCH_DEPTH = beast::lexicalCastThrow (strTemp); diff --git a/src/ripple/json/Output.h b/src/ripple/json/Output.h index a7b6107363..5122357449 100644 --- a/src/ripple/json/Output.h +++ b/src/ripple/json/Output.h @@ -20,19 +20,19 @@ #ifndef RIPPLE_JSON_OUTPUT_H_INCLUDED #define RIPPLE_JSON_OUTPUT_H_INCLUDED -#include +#include #include namespace Json { class Value; -using Output = std::function ; +using Output = std::function ; inline Output stringOutput (std::string& s) { - return [&](boost::string_ref const& b) { s.append (b.data(), b.size()); }; + return [&](beast::string_view const& b) { s.append (b.data(), b.size()); }; } /** Writes a minimal representation of a Json value to an Output in O(n) time. diff --git a/src/ripple/json/impl/Writer.cpp b/src/ripple/json/impl/Writer.cpp index 5b2f1f6105..d6064ed293 100644 --- a/src/ripple/json/impl/Writer.cpp +++ b/src/ripple/json/impl/Writer.cpp @@ -93,13 +93,13 @@ public: stack_.top().type = ct; } - void output (boost::string_ref const& bytes) + void output (beast::string_view const& bytes) { markStarted (); output_ (bytes); } - void stringOutput (boost::string_ref const& bytes) + void stringOutput (beast::string_view const& bytes) { markStarted (); std::size_t position = 0, writtenUntil = 0; diff --git a/src/ripple/net/impl/RPCCall.cpp b/src/ripple/net/impl/RPCCall.cpp index 7ae7596310..b185bfd418 100644 --- a/src/ripple/net/impl/RPCCall.cpp +++ b/src/ripple/net/impl/RPCCall.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -423,9 +423,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 (beast::detail::ci_equal(action, "reject")) + if (beast::detail::iequals(action, "reject")) jvRequest[jss::vetoed] = Json::Value (true); - else if (beast::detail::ci_equal(action, "accept")) + else if (beast::detail::iequals(action, "accept")) jvRequest[jss::vetoed] = Json::Value (false); else return rpcError (rpcINVALID_PARAMS); diff --git a/src/ripple/nodestore/backend/MemoryFactory.cpp b/src/ripple/nodestore/backend/MemoryFactory.cpp index 9bb3c419a9..aaf704e5c3 100644 --- a/src/ripple/nodestore/backend/MemoryFactory.cpp +++ b/src/ripple/nodestore/backend/MemoryFactory.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -40,7 +40,7 @@ class MemoryFactory : public Factory { private: std::mutex mutex_; - std::map map_; + std::map map_; public: MemoryFactory(); diff --git a/src/ripple/nodestore/impl/ManagerImp.cpp b/src/ripple/nodestore/impl/ManagerImp.cpp index a9826ba4c4..cbccc0b07a 100644 --- a/src/ripple/nodestore/impl/ManagerImp.cpp +++ b/src/ripple/nodestore/impl/ManagerImp.cpp @@ -128,7 +128,7 @@ ManagerImp::find (std::string const& name) auto const iter = std::find_if(list_.begin(), list_.end(), [&name](Factory* other) { - return beast::detail::ci_equal(name, other->getName()); + return beast::detail::iequals(name, other->getName()); } ); if (iter == list_.end()) return nullptr; diff --git a/src/ripple/overlay/impl/OverlayImpl.cpp b/src/ripple/overlay/impl/OverlayImpl.cpp index 717c311a36..5fbfebc008 100644 --- a/src/ripple/overlay/impl/OverlayImpl.cpp +++ b/src/ripple/overlay/impl/OverlayImpl.cpp @@ -33,14 +33,13 @@ #include #include #include -#include #include #include #include #include #include #include -#include +#include #include #include @@ -223,7 +222,7 @@ OverlayImpl::onHandoff (std::unique_ptr && ssl_bundle, if (std::find_if(types.begin(), types.end(), [](std::string const& s) { - return beast::detail::ci_equal(s, "peer"); + return beast::detail::iequals(s, "peer"); }) == types.end()) { handoff.moved = false; @@ -313,32 +312,6 @@ OverlayImpl::onHandoff (std::unique_ptr && ssl_bundle, //------------------------------------------------------------------------------ -template -static -bool -is_upgrade(beast::http::header const& req) -{ - if(req.version < 11) - return false; - if(req.method() != beast::http::verb::get) - return false; - if(! beast::http::token_list{req["Connection"]}.exists("upgrade")) - return false; - return true; -} - -template -static -bool -is_upgrade(beast::http::header const& req) -{ - if(req.version < 11) - return false; - if(! beast::http::token_list{req["Connection"]}.exists("upgrade")) - return false; - return true; -} - bool OverlayImpl::isPeerUpgrade(http_request_type const& request) { @@ -377,7 +350,7 @@ OverlayImpl::makeRedirectResponse (PeerFinder::Slot::ptr const& slot, for (auto const& _ : m_peerFinder->redirect(slot)) ips.append(_.address.to_string()); } - msg.prepare(); + msg.prepare_payload(); return std::make_shared(msg); } @@ -394,7 +367,7 @@ OverlayImpl::makeErrorResponse (PeerFinder::Slot::ptr const& slot, msg.insert("Remote-Address", remote_address.to_string()); msg.insert(beast::http::field::connection, "close"); msg.body = text; - msg.prepare(); + msg.prepare_payload(); return std::make_shared(msg); } @@ -849,7 +822,7 @@ OverlayImpl::processRequest (http_request_type const& req, msg.insert("Content-Type", "application/json"); msg.insert("Connection", "close"); msg.body["overlay"] = crawl(); - msg.prepare(); + msg.prepare_payload(); handoff.response = std::make_shared(msg); return true; } diff --git a/src/ripple/overlay/impl/OverlayImpl.h b/src/ripple/overlay/impl/OverlayImpl.h index 18d7e914b7..6791c20208 100644 --- a/src/ripple/overlay/impl/OverlayImpl.h +++ b/src/ripple/overlay/impl/OverlayImpl.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -264,6 +265,32 @@ public: return true; } + template + static + bool + is_upgrade(beast::http::header const& req) + { + if(req.version < 11) + return false; + if(req.method() != beast::http::verb::get) + return false; + if(! beast::http::token_list{req["Connection"]}.exists("upgrade")) + return false; + return true; + } + + template + static + bool + is_upgrade(beast::http::header const& req) + { + if(req.version < 11) + return false; + if(! beast::http::token_list{req["Connection"]}.exists("upgrade")) + return false; + return true; + } + static std::string makePrefix (std::uint32_t id); diff --git a/src/ripple/overlay/impl/PeerImp.cpp b/src/ripple/overlay/impl/PeerImp.cpp index 50a797c6a7..bcb356f9a7 100644 --- a/src/ripple/overlay/impl/PeerImp.cpp +++ b/src/ripple/overlay/impl/PeerImp.cpp @@ -249,7 +249,7 @@ PeerImp::crawl() const auto const iter = headers_.find("Crawl"); if (iter == headers_.end()) return false; - return beast::detail::ci_equal(iter->value(), "public"); + return beast::detail::iequals(iter->value(), "public"); } std::string diff --git a/src/ripple/overlay/impl/TMHello.cpp b/src/ripple/overlay/impl/TMHello.cpp index cdf12c1aff..020bc6f1d0 100644 --- a/src/ripple/overlay/impl/TMHello.cpp +++ b/src/ripple/overlay/impl/TMHello.cpp @@ -188,7 +188,7 @@ appendHello (beast::http::fields& h, } std::vector -parse_ProtocolVersions(boost::string_ref const& value) +parse_ProtocolVersions(beast::string_view const& value) { static boost::regex re ( "^" // start of line diff --git a/src/ripple/overlay/impl/TMHello.h b/src/ripple/overlay/impl/TMHello.h index a4ab28175c..0b80aa9d7c 100644 --- a/src/ripple/overlay/impl/TMHello.h +++ b/src/ripple/overlay/impl/TMHello.h @@ -84,7 +84,7 @@ verifyHello (protocol::TMHello const& h, uint256 const& sharedValue, excluded from the result set. */ std::vector -parse_ProtocolVersions(boost::string_ref const& s); +parse_ProtocolVersions(beast::string_view const& s); } diff --git a/src/ripple/rpc/impl/ServerHandlerImp.cpp b/src/ripple/rpc/impl/ServerHandlerImp.cpp index 9b07094ea4..4e9d070721 100644 --- a/src/ripple/rpc/impl/ServerHandlerImp.cpp +++ b/src/ripple/rpc/impl/ServerHandlerImp.cpp @@ -78,7 +78,7 @@ unauthorizedResponse( msg.insert("Content-Type", "text/html"); msg.insert("Connection", "close"); msg.body = "Invalid protocol."; - msg.prepare(); + msg.prepare_payload(); handoff.response = std::make_shared(msg); return handoff; } @@ -251,7 +251,7 @@ ServerHandlerImp::onHandoff (Session& session, static inline Json::Output makeOutput (Session& session) { - return [&](boost::string_ref const& b) + return [&](beast::string_view const& b) { session.write (b.data(), b.size()); }; @@ -744,7 +744,7 @@ ServerHandlerImp::statusResponse( msg.insert("Server", BuildInfo::getFullVersionString()); msg.insert("Content-Type", "text/html"); msg.insert("Connection", "close"); - msg.prepare(); + msg.prepare_payload(); handoff.response = std::make_shared(msg); return handoff; } diff --git a/src/ripple/server/Port.h b/src/ripple/server/Port.h index 527d26554b..e911ebc7ac 100644 --- a/src/ripple/server/Port.h +++ b/src/ripple/server/Port.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include @@ -40,7 +40,7 @@ struct Port std::string name; boost::asio::ip::address ip; std::uint16_t port = 0; - std::set protocol; + std::set protocol; std::vector admin_ip; std::vector secure_gateway_ip; std::string user; @@ -79,7 +79,7 @@ operator<< (std::ostream& os, Port const& p); struct ParsedPort { std::string name; - std::set protocol; + std::set protocol; std::string user; std::string password; std::string admin_user; diff --git a/src/ripple/server/impl/BaseHTTPPeer.h b/src/ripple/server/impl/BaseHTTPPeer.h index 070ecbe072..90ad13a006 100644 --- a/src/ripple/server/impl/BaseHTTPPeer.h +++ b/src/ripple/server/impl/BaseHTTPPeer.h @@ -359,7 +359,6 @@ on_write(error_code const& ec, for(auto const& b : wq2_) v.emplace_back(b.data.get(), b.bytes); start_timer(); - using namespace beast::asio; return boost::asio::async_write(impl().stream_, v, strand_.wrap(std::bind(&BaseHTTPPeer::on_write, impl().shared_from_this(), std::placeholders::_1, diff --git a/src/ripple/server/impl/BaseWSPeer.h b/src/ripple/server/impl/BaseWSPeer.h index 1b82e43463..a4a2d3861a 100644 --- a/src/ripple/server/impl/BaseWSPeer.h +++ b/src/ripple/server/impl/BaseWSPeer.h @@ -141,8 +141,8 @@ protected: on_ping(error_code const& ec); void - on_ping_pong(bool is_pong, - beast::websocket::ping_data const& payload); + on_ping_pong(beast::websocket::frame_type kind, + beast::string_view payload); void on_timer(error_code ec); @@ -180,16 +180,15 @@ run() return strand_.post(std::bind( &BaseWSPeer::run, impl().shared_from_this())); impl().ws_.set_option(port().pmd_options); - impl().ws_.ping_callback( + impl().ws_.control_callback( std::bind(&BaseWSPeer::on_ping_pong, this, std::placeholders::_1, std::placeholders::_2)); - using namespace beast::asio; start_timer(); close_on_timer_ = true; impl().ws_.async_accept_ex(request_, [](auto & res) { - res.replace(beast::http::field::server, + res.set(beast::http::field::server, BuildInfo::getFullVersionString()); }, strand_.wrap(std::bind(&BaseWSPeer::on_ws_handshake, @@ -278,7 +277,6 @@ on_write(error_code const& ec) if(ec) return fail(ec, "write"); auto& w = *wq_.front(); - using namespace beast::asio; auto const result = w.prepare(65536, std::bind(&BaseWSPeer::do_write, impl().shared_from_this())); @@ -321,7 +319,6 @@ do_read() if(! strand_.running_in_this_thread()) return strand_.post(std::bind( &BaseWSPeer::do_read, impl().shared_from_this())); - using namespace beast::asio; impl().ws_.async_read(rb_, strand_.wrap( std::bind(&BaseWSPeer::on_read, impl().shared_from_this(), std::placeholders::_1))); @@ -398,12 +395,13 @@ on_ping(error_code const& ec) template void BaseWSPeer:: -on_ping_pong(bool is_pong, - beast::websocket::ping_data const& payload) +on_ping_pong(beast::websocket::frame_type kind, + beast::string_view payload) { - if(is_pong) + if(kind == beast::websocket::frame_type::pong) { - if(payload == payload_) + beast::string_view p(payload_.begin()); + if(payload == p) { close_on_timer_ = false; JLOG(this->j_.trace()) << diff --git a/src/ripple/server/impl/Port.cpp b/src/ripple/server/impl/Port.cpp index 1d85885871..b3ef671a57 100644 --- a/src/ripple/server/impl/Port.cpp +++ b/src/ripple/server/impl/Port.cpp @@ -188,7 +188,7 @@ parse_Port (ParsedPort& port, Section const& section, std::ostream& log) { auto const lim = get (section, "limit", "unlimited"); - if (!beast::detail::ci_equal (lim, "unlimited")) + if (!beast::detail::iequals (lim, "unlimited")) { try { diff --git a/src/test/app/ValidatorSite_test.cpp b/src/test/app/ValidatorSite_test.cpp index eb8d0605e1..af2ee3e81b 100644 --- a/src/test/app/ValidatorSite_test.cpp +++ b/src/test/app/ValidatorSite_test.cpp @@ -157,7 +157,7 @@ private: res.insert("Server", "http_sync_server"); res.insert("Content-Type", "text/html"); res.body = "The file '" + path + "' was not found"; - res.prepare(); + res.prepare_payload(); write(sock, res, ec); if(ec) break; @@ -171,7 +171,7 @@ private: res.body = list_; try { - res.prepare(); + res.prepare_payload(); } catch(std::exception const& e) { @@ -182,7 +182,7 @@ private: res.insert("Content-Type", "text/html"); res.body = std::string{"An internal error occurred"} + e.what(); - res.prepare(); + res.prepare_payload(); } write(sock, res, ec); if(ec) diff --git a/src/test/jtx/impl/JSONRPCClient.cpp b/src/test/jtx/impl/JSONRPCClient.cpp index 5250550c44..a09fa7af42 100644 --- a/src/test/jtx/impl/JSONRPCClient.cpp +++ b/src/test/jtx/impl/JSONRPCClient.cpp @@ -130,7 +130,7 @@ public: } req.body = to_string(jr); } - req.prepare(); + req.prepare_payload(); write(stream_, req); response res; diff --git a/src/test/nodestore/import_test.cpp b/src/test/nodestore/import_test.cpp index db28d3f4b4..ad1930f43c 100644 --- a/src/test/nodestore/import_test.cpp +++ b/src/test/nodestore/import_test.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -258,7 +258,7 @@ public: } }; -std::map +std::map parse_args(std::string const& s) { // '=' @@ -274,7 +274,7 @@ parse_args(std::string const& s) , boost::regex_constants::optimize ); std::map map; + std::string, beast::iless> map; auto const v = beast::rfc2616::split( s.begin(), s.end(), ','); for (auto const& kv : v) diff --git a/src/test/server/ServerStatus_test.cpp b/src/test/server/ServerStatus_test.cpp index 16158fde4d..4ac941cdad 100644 --- a/src/test/server/ServerStatus_test.cpp +++ b/src/test/server/ServerStatus_test.cpp @@ -123,7 +123,7 @@ class ServerStatus_test : req.insert("Content-Type", "application/json; charset=UTF-8"); req.body = body; } - req.prepare(); + req.prepare_payload(); return req; } @@ -131,7 +131,7 @@ class ServerStatus_test : void doRequest( boost::asio::yield_context& yield, - beast::http::request const& req, + beast::http::request& req, std::string const& host, uint16_t port, bool secure, @@ -161,7 +161,7 @@ class ServerStatus_test : ss.async_handshake(ssl::stream_base::client, yield[ec]); if(ec) return; - async_write(ss, req, yield[ec]); + beast::http::async_write(ss, req, yield[ec]); if(ec) return; async_read(ss, sb, resp, yield[ec]); @@ -174,7 +174,7 @@ class ServerStatus_test : async_connect(sock, it, yield[ec]); if(ec) return; - async_write(sock, req, yield[ec]); + beast::http::async_write(sock, req, yield[ec]); if(ec) return; async_read(sock, sb, resp, yield[ec]); @@ -195,10 +195,11 @@ class ServerStatus_test : { auto const port = env.app().config()["port_ws"]. get("port"); - auto const ip = env.app().config()["port_ws"]. + auto ip = env.app().config()["port_ws"]. get("ip"); + auto req = makeWSUpgrade(*ip, *port); doRequest( - yield, makeWSUpgrade(*ip, *port), *ip, *port, secure, resp, ec); + yield, req, *ip, *port, secure, resp, ec); return; } @@ -215,9 +216,10 @@ class ServerStatus_test : get("port"); auto const ip = env.app().config()["port_rpc"]. get("ip"); + auto req = makeHTTPRequest(*ip, *port, body); doRequest( yield, - makeHTTPRequest(*ip, *port, body), + req, *ip, *port, secure,