0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-19 16:30:52 +01:00

ircd::net: Close socket before its dtor on accept except.

This commit is contained in:
Jason Volk 2018-03-12 15:56:30 -07:00
parent f7ecc4342b
commit 949a006950

View file

@ -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),