Commit 7bd4d4b4 authored by Ivan Vilata-i-Balaguer's avatar Ivan Vilata-i-Balaguer
Browse files

Differentiate upstream cancellation from timeout in `with_timeout`.

parent 6c8a2bd5
......@@ -80,9 +80,11 @@ auto with_timeout( const asio::executor& ex
auto ret = f(timeout.abort_signal(), yield[ec]);
if (ec == asio::error::operation_aborted && timeout.timed_out()) {
if (!abort_signal && ec == asio::error::operation_aborted && timeout.timed_out()) {
ec = asio::error::timed_out;
}
// If `abort_signal` itself was triggered,
// keep the error from `f` (probably `asio::error::operation_aborted`).
return or_throw(yield, ec, std::move(ret));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment