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

LibIPC: Prepend each message with its size

This makes it much simpler to determine when we've read a complete message, and
will make it possible to integrate recvfd() in the future commit.
This commit is contained in:
Sergey Bugaev 2020-11-21 21:55:00 +03:00 committed by Andreas Kling
parent d62346c0b1
commit fa2e3e2be4
3 changed files with 35 additions and 23 deletions

View file

@ -66,7 +66,7 @@ public:
GenericLexer lexer { pattern };
while (!lexer.is_eof()) {
// FIXME: It is a bit inconvinient, that 'consume_until' also consumes the 'stop' character, this makes
// FIXME: It is a bit inconvenient, that 'consume_until' also consumes the 'stop' character, this makes
// the method less generic because there is no way to check if the 'stop' character ever appeared.
const auto consume_until_without_consuming_stop_character = [&](char stop) {
return lexer.consume_while([&](char ch) { return ch != stop; });