From a5389dfd955cd5f65ac72e53c0a5508dc65dae51 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 27 Feb 2018 07:12:04 -0800 Subject: [PATCH] ircd::net: Assertion found case where (timedout && !ec) is valid: This happens when handle_timeout is executed while handle_ready has already hit the asio queue. The sd.cancel() is too late to cause ec==operation_canceled. --- ircd/net.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ircd/net.cc b/ircd/net.cc index 1964e8e50..c21f028f7 100644 --- a/ircd/net.cc +++ b/ircd/net.cc @@ -1532,12 +1532,10 @@ noexcept try // After life_guard is constructed it is safe to use *this in this frame. const life_guard s{wp}; - if(timedout) - { - assert(ec == operation_canceled); + if(!timedout) + cancel_timeout(); + else ec = { timed_out, system_category() }; - } - else cancel_timeout(); if(!ec && !sd.is_open()) ec = { bad_file_descriptor, system_category() };