mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-26 22:15:52 +00:00
Always use HTTP handshaking in overlay:
Inbound and outbound peer connections always use HTTP handshakes to negotiate connections, instead of the deprecated TMHello protocol message. rippled versions 0.27.0 and later support both optional HTTP handshakes and legacy TMHello messages, so always using HTTP handshakes should not cause disruption. However, versions before 0.27.0 will no longer be able to participate in the overlay network - support for handshaking via the TMHello message is removed.
This commit is contained in:
committed by
Tom Ritchford
parent
e43ffa6f2b
commit
f56e37398c
@@ -154,37 +154,6 @@ OverlayImpl::~OverlayImpl ()
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void
|
||||
OverlayImpl::onLegacyPeerHello (
|
||||
std::unique_ptr<beast::asio::ssl_bundle>&& ssl_bundle,
|
||||
boost::asio::const_buffer buffer, endpoint_type remote_endpoint)
|
||||
{
|
||||
error_code ec;
|
||||
auto const local_endpoint (ssl_bundle->socket.local_endpoint(ec));
|
||||
if (ec)
|
||||
return;
|
||||
|
||||
auto const slot = m_peerFinder->new_inbound_slot (
|
||||
beast::IPAddressConversion::from_asio(local_endpoint),
|
||||
beast::IPAddressConversion::from_asio(remote_endpoint));
|
||||
|
||||
if (slot == nullptr)
|
||||
// self connect, close
|
||||
return;
|
||||
|
||||
auto const peer = std::make_shared<PeerImp>(next_id_++,
|
||||
remote_endpoint, slot, boost::asio::const_buffers_1(buffer),
|
||||
std::move(ssl_bundle), *this);
|
||||
{
|
||||
// As we are not on the strand, run() must be called
|
||||
// while holding the lock, otherwise new I/O can be
|
||||
// queued after a call to stop().
|
||||
std::lock_guard <decltype(mutex_)> lock (mutex_);
|
||||
add(peer);
|
||||
peer->run();
|
||||
}
|
||||
}
|
||||
|
||||
Handoff
|
||||
OverlayImpl::onHandoff (std::unique_ptr <beast::asio::ssl_bundle>&& ssl_bundle,
|
||||
beast::http::message&& request,
|
||||
@@ -764,7 +733,6 @@ setup_Overlay (BasicConfig const& config)
|
||||
{
|
||||
Overlay::Setup setup;
|
||||
auto const& section = config.section("overlay");
|
||||
set (setup.http_handshake, "http_handshake", section);
|
||||
set (setup.auto_connect, "auto_connect", section);
|
||||
std::string promote;
|
||||
set (promote, "become_superpeer", section);
|
||||
|
||||
Reference in New Issue
Block a user