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:
Vinnie Falco
2015-02-22 14:48:34 -08:00
committed by Tom Ritchford
parent e43ffa6f2b
commit f56e37398c
14 changed files with 12 additions and 536 deletions

View File

@@ -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);