1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:27:45 +00:00

LibIPC: Fix losing messages when connection is closed

This fixes not processing any messages read up until a connection
close is detected. We were returning from the function despite having
read some messages.
This commit is contained in:
Tom 2021-07-20 15:59:57 -06:00 committed by Andreas Kling
parent c09071e166
commit 7e8a5d7323

View file

@ -197,9 +197,10 @@ protected:
if (nread == 0) { if (nread == 0) {
if (bytes.is_empty()) { if (bytes.is_empty()) {
deferred_invoke([this](auto&) { shutdown(); }); deferred_invoke([this](auto&) { shutdown(); });
}
return false; return false;
} }
break;
}
bytes.append(buffer, nread); bytes.append(buffer, nread);
} }