mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 06:25:51 +00:00
Fixes to Overlay:
* Make ~Peer virtual * Call close in ConnectAttempt::stop * Handle nullptr return in new_outbound_slot * Check gracefulClose_ in read loop
This commit is contained in:
@@ -362,10 +362,18 @@ OverlayImpl::connect (beast::IP::Endpoint const& remote_endpoint)
|
||||
"Over resource limit: " << remote_endpoint;
|
||||
return;
|
||||
}
|
||||
|
||||
auto const slot = peerFinder().new_outbound_slot(remote_endpoint);
|
||||
if (slot == nullptr)
|
||||
{
|
||||
if (journal_.debug) journal_.debug <<
|
||||
"Connect: No slot for " << remote_endpoint;
|
||||
return;
|
||||
}
|
||||
|
||||
auto const p = std::make_shared<ConnectAttempt>(
|
||||
io_service_, beast::IPAddressConversion::to_asio_endpoint(remote_endpoint),
|
||||
usage, setup_.context, next_id_++,
|
||||
usage, setup_.context, next_id_++, slot,
|
||||
deprecatedLogs().journal("Peer"), *this);
|
||||
|
||||
std::lock_guard<decltype(mutex_)> lock(mutex_);
|
||||
|
||||
Reference in New Issue
Block a user