forked from boostorg/beast
Fix async_base immediate completion
`complete(false, ...)` used the wrong executor when an async operation completed immediately, potentially executing the completion handler on the IO executor in some cases. Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
@@ -340,7 +340,7 @@ public:
|
||||
if(! is_continuation)
|
||||
{
|
||||
net::post(net::bind_executor(
|
||||
wg1_.get_executor(),
|
||||
get_executor(),
|
||||
beast::bind_front_handler(
|
||||
std::move(h_),
|
||||
std::forward<Args>(args)...)));
|
||||
@@ -348,8 +348,8 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
h_(std::forward<Args>(args)...);
|
||||
wg1_.reset();
|
||||
h_(std::forward<Args>(args)...);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user