mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-08-28 00:44:42 +00:00
don't invoke completion handler within async function
This commit is contained in:
@@ -960,7 +960,12 @@ namespace stream
|
||||
if (len > 0 && buf)
|
||||
buffer = std::make_shared<i2p::stream::SendBuffer>(buf, len, std::move (handler));
|
||||
else if (handler)
|
||||
handler(boost::system::error_code (), 0);
|
||||
{
|
||||
boost::asio::post (GetService (), [handler = std::move(handler)]() mutable
|
||||
{
|
||||
handler(boost::system::error_code (), 0);
|
||||
});
|
||||
}
|
||||
Send (std::move (buffer));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user