0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 08:12:37 +01:00

ircd::net: Unconditionally check opened(); handle unexpected on dtor.

This commit is contained in:
Jason Volk 2019-09-17 16:37:36 -07:00
parent 9b5a391e14
commit 1128187bf5

View file

@ -2789,7 +2789,7 @@ noexcept try
if(unlikely(--instances == 0))
net::dock.notify_all();
if((RB_DEBUG_LEVEL) && unlikely(opened(*this)))
if(unlikely(opened(*this)))
throw panic
{
"Failed to ensure socket(%p) is disconnected from %s before dtor.",
@ -2808,6 +2808,16 @@ catch(const std::exception &e)
return;
}
catch(...)
{
log::critical
{
log, "socket(%p) close: unexpected",
this,
};
ircd::terminate();
}
void
ircd::net::socket::connect(const endpoint &ep,