1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:18:11 +00:00

Kernel: Don't put closed/listener sockets into the closing_sockets list

This commit is contained in:
Gunnar Beutner 2021-04-30 19:19:53 +02:00 committed by Andreas Kling
parent d8f92bdf96
commit 866e577f1d

View file

@ -471,8 +471,10 @@ KResult TCPSocket::close()
set_state(State::LastAck);
}
Locker locker(closing_sockets().lock());
closing_sockets().resource().set(tuple(), *this);
if (state() != State::Closed && state() != State::Listen) {
Locker locker(closing_sockets().lock());
closing_sockets().resource().set(tuple(), *this);
}
return result;
}