0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 07:23:53 +01:00

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.
This commit is contained in:
Jason Volk 2018-02-27 07:12:04 -08:00
parent b90d3a9447
commit a5389dfd95

View file

@ -1532,12 +1532,10 @@ noexcept try
// After life_guard is constructed it is safe to use *this in this frame.
const life_guard<socket> 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() };