Skip to content

Commit

Permalink
wsd: simplify shutting down in checkRemoval
Browse files Browse the repository at this point in the history
It's cleaner to only signal for async-shutdown,
followed by forced shutting down, when the
socket isn't already closed.

Also, repetition is unnecessary.

Change-Id: Ifdc15723bcedccdd432f1bdec9cc335a183e6239
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
  • Loading branch information
Ashod authored and caolanm committed Jan 10, 2025
1 parent 9c32337 commit 7b6a118
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions net/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1490,12 +1490,11 @@ bool StreamSocket::checkRemoval(std::chrono::steady_clock::time_point now)
if (!isClosed())
{
// Note: Ensure proper semantics of onDisconnect()
LOG_WRN("Socket still open post onDisconnect(), forced shutdown.");
shutdown(); // signal
closeConnection(); // real -> setClosed()
LOG_WRN("Socket still open post onDisconnect(), forcing shutdown");
}
}
else

if (!isClosed())
{
shutdown(); // signal
closeConnection(); // real -> setClosed()
Expand Down

0 comments on commit 7b6a118

Please sign in to comment.