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

Fix checks where error code took precedence over cancellation.

Whenever a function with a cancellation signal argument gets it triggered, it
should err out with `boost::asio::error::operation_aborted` regardless of
other errors, otherwise checks like `ouinet::return_or_throw_on_error` are
going to cause failed assertions.
parent 6df0f20d
......@@ -810,7 +810,7 @@ Session Client::State::fetch_fresh_through_simple_proxy
// Send request
http::async_write(con, request, yield[ec].tag("inj-request"));
if (!ec && cancel_slot) {
if (cancel_slot) {
ec = asio::error::operation_aborted;
}
......
......@@ -38,7 +38,7 @@ fetch_http( Stream& con
// Send the HTTP request to the remote host
http::async_write(con, req, yield[ec]);
if (!ec && cancel_slot) {
if (cancel_slot) {
ec = asio::error::operation_aborted;
}
if (ec) {
......@@ -55,7 +55,7 @@ fetch_http( Stream& con
// Receive the HTTP response
_recv_http_response(con, buffer, res, yield[ec]);
if (!ec && cancel_slot) {
if (cancel_slot) {
ec = asio::error::operation_aborted;
}
if (ec) {
......
......@@ -72,7 +72,7 @@ public:
self->_self = nullptr;
self->_cancel_signal = nullptr;
if (!ec && cancel) ec = asio::error::operation_aborted;
if (cancel) ec = asio::error::operation_aborted;
self->_result = Result{ ec, std::move(retval) };
......
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