Skip to content

Commit 14b376e

Browse files
committed
Fixes cancelation of async_exec (2).
1 parent 4f9dcc7 commit 14b376e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/aedis/detail/connection_ops.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ struct exec_op {
139139

140140
if (is_cancelled(self)) {
141141
if (info->is_written()) {
142-
if (self.get_cancellation_state().cancelled() == boost::asio::cancellation_type_t::terminal) {
142+
using c_t = boost::asio::cancellation_type;
143+
auto const c = self.get_cancellation_state().cancelled();
144+
if ((c & (c_t::total | c_t::terminal)) != c_t::none) {
143145
// Cancellation requires closing the connection
144146
// otherwise it stays in inconsistent state.
145147
conn->cancel(operation::run);

0 commit comments

Comments
 (0)