mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Fix Overlay stop on exit:
The stop sequence for Overlay had a race condition where autoconnect could be called after close_all, resulting in a hang on exit. This resolves the problem by putting the close and timer operations on a strand: * Rename some Overlay members * Put close on strand and tidy up members * Use completion handler instead of coroutine for timer * Use App io_service in PeerFinder
This commit is contained in:
@@ -30,7 +30,8 @@ PeerImp::PeerImp (socket_type&& socket, beast::IP::Endpoint remoteAddress,
|
||||
OverlayImpl& overlay, Resource::Manager& resourceManager,
|
||||
PeerFinder::Manager& peerFinder, PeerFinder::Slot::ptr const& slot,
|
||||
std::shared_ptr<boost::asio::ssl::context> const& context)
|
||||
: journal_ (deprecatedLogs().journal("Peer"))
|
||||
: Child (overlay)
|
||||
, journal_ (deprecatedLogs().journal("Peer"))
|
||||
, ssl_bundle_(std::make_unique<beast::asio::ssl_bundle>(
|
||||
context, std::move(socket)))
|
||||
, socket_ (ssl_bundle_->socket)
|
||||
@@ -53,7 +54,8 @@ PeerImp::PeerImp (beast::IP::Endpoint remoteAddress,
|
||||
Resource::Manager& resourceManager, PeerFinder::Manager& peerFinder,
|
||||
PeerFinder::Slot::ptr const& slot,
|
||||
std::shared_ptr<boost::asio::ssl::context> const& context)
|
||||
: journal_ (deprecatedLogs().journal("Peer"))
|
||||
: Child (overlay)
|
||||
, journal_ (deprecatedLogs().journal("Peer"))
|
||||
, ssl_bundle_(std::make_unique<beast::asio::ssl_bundle>(
|
||||
context, io_service))
|
||||
, socket_ (ssl_bundle_->socket)
|
||||
|
||||
Reference in New Issue
Block a user