mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
clear session on shutdown
This commit is contained in:
@@ -131,23 +131,3 @@ SubscriptionManager::unsubProposedTransactions(std::shared_ptr<session>& session
|
|||||||
{
|
{
|
||||||
streamSubscribers_[TransactionsProposed].erase(session);
|
streamSubscribers_[TransactionsProposed].erase(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
SubscriptionManager::clearSession(std::shared_ptr<session> const& session)
|
|
||||||
{
|
|
||||||
for(auto& stream : streamSubscribers_)
|
|
||||||
stream.erase(session);
|
|
||||||
|
|
||||||
for(auto& [account, subscribers] : accountSubscribers_)
|
|
||||||
{
|
|
||||||
if (subscribers.find(session) != subscribers.end())
|
|
||||||
accountSubscribers_[account].erase(session);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for(auto& [account, subscribers] : accountProposedSubscribers_)
|
|
||||||
{
|
|
||||||
if (subscribers.find(session) != subscribers.end())
|
|
||||||
accountProposedSubscribers_[account].erase(session);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -93,9 +93,6 @@ public:
|
|||||||
|
|
||||||
void
|
void
|
||||||
unsubProposedTransactions(std::shared_ptr<session>& session);
|
unsubProposedTransactions(std::shared_ptr<session>& session);
|
||||||
|
|
||||||
void
|
|
||||||
clearSession(std::shared_ptr<session> const& session);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //SUBSCRIPTION_MANAGER_H
|
#endif //SUBSCRIPTION_MANAGER_H
|
||||||
@@ -220,6 +220,17 @@ public:
|
|||||||
&session::on_write, shared_from_this()));
|
&session::on_write, shared_from_this()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
close(boost::beast::websocket::close_reason const& cr)
|
||||||
|
{
|
||||||
|
boost::beast::error_code ec;
|
||||||
|
|
||||||
|
ws_.close(cr, ec);
|
||||||
|
|
||||||
|
if (ec)
|
||||||
|
return fail(ec, "close");
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Get on the correct executor
|
// Get on the correct executor
|
||||||
@@ -287,7 +298,7 @@ private:
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (ec)
|
if (ec)
|
||||||
return fail(ec, "read");
|
fail(ec, "read");
|
||||||
|
|
||||||
std::string msg{
|
std::string msg{
|
||||||
static_cast<char const*>(buffer_.data().data()), buffer_.size()};
|
static_cast<char const*>(buffer_.data().data()), buffer_.size()};
|
||||||
|
|||||||
Reference in New Issue
Block a user