mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
PeerFinder and Peers fixes:
- Fix bootcache incorrect failure on socket cancel - Fix peer connect race on stop - Simplify some loops - Require boost 1.55 via static_assert
This commit is contained in:
@@ -215,14 +215,23 @@ public:
|
||||
assert (result.second);
|
||||
}
|
||||
++m_child_count;
|
||||
}
|
||||
|
||||
// VFALCO NOTE Why not do this in the ctor?
|
||||
peer->accept ();
|
||||
// This has to happen while holding the lock,
|
||||
// otherwise the socket might not be canceled during a stop.
|
||||
peer->accept ();
|
||||
}
|
||||
}
|
||||
|
||||
void connect (IP::Endpoint const& remote_endpoint)
|
||||
{
|
||||
if (isStopping())
|
||||
{
|
||||
m_journal.debug <<
|
||||
"Skipping " << remote_endpoint <<
|
||||
" connect on stop";
|
||||
return;
|
||||
}
|
||||
|
||||
PeerFinder::Slot::ptr const slot (
|
||||
m_peerFinder->new_outbound_slot (remote_endpoint));
|
||||
|
||||
@@ -244,10 +253,11 @@ public:
|
||||
assert (result.second);
|
||||
}
|
||||
++m_child_count;
|
||||
}
|
||||
|
||||
// VFALCO NOTE Why not do this in the ctor?
|
||||
peer->connect (remote_endpoint);
|
||||
// This has to happen while holding the lock,
|
||||
// otherwise the socket might not be canceled during a stop.
|
||||
peer->connect (remote_endpoint);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user