diff --git a/include/ircd/net/socket.h b/include/ircd/net/socket.h index 318b1657d..31417f43b 100644 --- a/include/ircd/net/socket.h +++ b/include/ircd/net/socket.h @@ -101,7 +101,7 @@ struct ircd::net::socket void wait(const wait_opts &); void wait(const wait_opts &, wait_callback_ec); void wait(const wait_opts &, wait_callback_eptr); - bool cancel() noexcept; + void cancel() noexcept; // Alias to wait() template auto operator()(args&&...); diff --git a/ircd/net.cc b/ircd/net.cc index fc717fe2b..e19524981 100644 --- a/ircd/net.cc +++ b/ircd/net.cc @@ -1365,19 +1365,17 @@ catch(const std::exception &e) throw; } -bool +void ircd::net::socket::cancel() noexcept { - static const auto good{[](const auto &ec) - { - return ec == boost::system::errc::success; - }}; + boost::system::error_code ec; - boost::system::error_code ec[2]; - sd.cancel(ec[0]); - timer.cancel(ec[1]); - return std::all_of(begin(ec), end(ec), good); + sd.cancel(ec); + assert(!ec); + + timer.cancel(ec); + assert(!ec); } void