Commit 6c8a2bd5 authored by Ivan Vilata-i-Balaguer's avatar Ivan Vilata-i-Balaguer
Browse files

Check for cancellation when passing handler to session flush op.

Otherwise `ouinet::return_or_throw_on_error` will trigger a failed assertion.
parent 7ea440e5
......@@ -154,6 +154,7 @@ Session::flush_response(Cancel& cancel,
_head_was_read = true;
h(http_response::Part{std::move(_head)}, cancel, yield[ec]);
if (cancel) ec = asio::error::operation_aborted;
return_or_throw_on_error(yield, cancel, ec);
while (true) {
......@@ -162,6 +163,7 @@ Session::flush_response(Cancel& cancel,
return_or_throw_on_error(yield, cancel, ec);
if (!opt_part) break;
h(std::move(*opt_part), cancel, yield[ec]);
if (cancel) ec = asio::error::operation_aborted;
return_or_throw_on_error(yield, cancel, ec);
}
}
......
Supports Markdown
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