0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 18:18:56 +02:00

ircd::client: Adjust main exception handlers for ctx::terminated.

This commit is contained in:
Jason Volk 2018-05-06 15:09:12 -07:00
parent e90603b762
commit 2183c6bea9

View file

@ -399,14 +399,14 @@ noexcept try
else
client->close(net::dc::SSL_NOTIFY).wait();
}
catch(const std::exception &e)
catch(...)
{
log::derror
{
"socket(%p) client(%p) (below main): %s",
"socket(%p) client(%p) (below main) :%s",
client->sock.get(),
client.get(),
e.what()
what(std::current_exception())
};
}
@ -625,20 +625,6 @@ noexcept try
return true;
}
catch(const ctx::interrupted &e)
{
log::warning
{
"socket(%p) local[%s] remote[%s] Request interrupted: %s",
sock.get(),
string(local(*this)),
string(remote(*this)),
e.what()
};
close(net::dc::RST, net::close_ignore);
return false;
}
catch(const boost::system::system_error &e)
{
using namespace boost::system::errc;
@ -713,6 +699,20 @@ catch(const boost::system::system_error &e)
close(net::dc::RST, net::close_ignore);
return false;
}
catch(const ctx::interrupted &e)
{
log::warning
{
"socket(%p) local[%s] remote[%s] Request interrupted: %s",
sock.get(),
string(local(*this)),
string(remote(*this)),
e.what()
};
close(net::dc::SSL_NOTIFY, net::close_ignore);
return false;
}
catch(const std::exception &e)
{
log::critical
@ -726,6 +726,11 @@ catch(const std::exception &e)
return false;
}
catch(const ctx::terminated &)
{
close(net::dc::RST, net::close_ignore);
return false;
}
/// Handle a single request within the client main() loop.
///