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:
parent
9b5a391e14
commit
1128187bf5
1 changed files with 11 additions and 1 deletions
12
ircd/net.cc
12
ircd/net.cc
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue