don't invoke completion handler within async function

This commit is contained in:
orignal
2026-08-05 10:09:53 -04:00
parent 346c9c0cd0
commit 72aeea494e
2 changed files with 27 additions and 7 deletions
+6 -1
View File
@@ -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));
}