Prevent crash at shutdown by shutting down rate_limiting asyncs before boost filesystem global constructors execute.
This commit is contained in:
parent
72088c548b
commit
13d536c119
1 changed files with 19 additions and 0 deletions
|
|
@ -216,6 +216,7 @@ namespace fc
|
|||
|
||||
rate_limiting_group_impl(uint32_t upload_bytes_per_second, uint32_t download_bytes_per_second,
|
||||
uint32_t burstiness_in_seconds = 1);
|
||||
~rate_limiting_group_impl();
|
||||
|
||||
virtual size_t readsome(boost::asio::ip::tcp::socket& socket, char* buffer, size_t length) override;
|
||||
virtual size_t readsome(boost::asio::ip::tcp::socket& socket, const std::shared_ptr<char>& buffer, size_t length, size_t offset) override;
|
||||
|
|
@ -249,6 +250,24 @@ namespace fc
|
|||
{
|
||||
}
|
||||
|
||||
rate_limiting_group_impl::~rate_limiting_group_impl()
|
||||
{
|
||||
try
|
||||
{
|
||||
_process_pending_reads_loop_complete.cancel_and_wait();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
try
|
||||
{
|
||||
_process_pending_writes_loop_complete.cancel_and_wait();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
size_t rate_limiting_group_impl::readsome(boost::asio::ip::tcp::socket& socket, const std::shared_ptr<char>& buffer, size_t length, size_t offset)
|
||||
{
|
||||
return readsome_impl(socket, buffer, length, offset);
|
||||
|
|
|
|||
Loading…
Reference in a new issue