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

ircd::net: Handle case for belated timeout callback after socket close.

This commit is contained in:
Jason Volk 2018-03-11 14:12:39 -07:00
parent 3242c1929b
commit 8653d62c37

View file

@ -1657,6 +1657,30 @@ noexcept try
if(callback)
call_user(callback, ec);
}
catch(const boost::system::system_error &e)
{
using namespace boost::system::errc;
using boost::system::system_category;
const error_code &_ec{e.code()};
switch(_ec.value())
{
case bad_file_descriptor:
assert(ec.category() == system_category());
if(fini)
break;
default:
assert(0);
log.critical("socket(%p) handle timeout: %s",
(const void *)this,
string(e));
break;
}
if(callback)
call_user(callback, _ec);
}
catch(const std::exception &e)
{
log.critical("socket(%p) handle timeout: %s",