Skip to content

Commit

Permalink
Improve async compute file hash and switch thread back to caller
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackarain committed Dec 15, 2023
1 parent 94a104d commit 682b68e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion proxy/include/proxy/proxy_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3366,7 +3366,13 @@ R"x*x*x(<html>
boost::system::error_code ec;
auto hash = file_hash(p, ec);

handler(ec, hash);
auto ex = net::get_associated_executor(handler);

net::post(ex,
[handler = std::move(handler), ec, hash]() mutable
{
handler(ec, hash);
});
}
).detach();
}, token);
Expand Down

0 comments on commit 682b68e

Please sign in to comment.