mirror of
https://github.com/matrix-construct/construct
synced 2024-11-19 08:21:09 +01:00
ircd::net: Close socket before its dtor on accept except.
This commit is contained in:
parent
f7ecc4342b
commit
949a006950
1 changed files with 9 additions and 0 deletions
|
@ -947,6 +947,15 @@ noexcept try
|
||||||
return;
|
return;
|
||||||
|
|
||||||
--accepting;
|
--accepting;
|
||||||
|
const unwind::exceptional drop{[&sock]
|
||||||
|
{
|
||||||
|
if(!bool(sock))
|
||||||
|
return;
|
||||||
|
|
||||||
|
error_code ec;
|
||||||
|
sock->sd.close(ec);
|
||||||
|
}};
|
||||||
|
|
||||||
assert(bool(sock));
|
assert(bool(sock));
|
||||||
log.debug("%s: socket(%p) accepted(%zu) %s %s",
|
log.debug("%s: socket(%p) accepted(%zu) %s %s",
|
||||||
std::string(*this),
|
std::string(*this),
|
||||||
|
|
Loading…
Reference in a new issue