1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 02:35:07 +00:00
serenity/Userland/Services/TelnetServer
Sam Atkins 3b1e063d30 LibCore+Everywhere: Make Core::Stream::read() return Bytes
A mistake I've repeatedly made is along these lines:
```c++
auto nread = TRY(source_file->read(buffer));
TRY(destination_file->write(buffer));
```

It's a little clunky to have to create a Bytes or StringView from the
buffer's data pointer and the nread, and easy to forget and just use
the buffer. So, this patch changes the read() function to return a
Bytes of the data that were just read.

The other read_foo() methods will be modified in the same way in
subsequent commits.

Fixes #13687
2022-04-16 13:27:51 -04:00
..
Client.cpp LibCore+Everywhere: Make Core::Stream::read() return Bytes 2022-04-16 13:27:51 -04:00
Client.h LibCore+Userland+Tests: Convert Stream APIs to construct on heap 2022-01-13 15:16:12 +03:30
CMakeLists.txt TelnetServer: Port to LibMain 2021-12-27 22:00:01 +01:00
Command.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
main.cpp LibCore+Userland+Tests: Convert Stream APIs to construct on heap 2022-01-13 15:16:12 +03:30
Parser.cpp TelnetServer: Ignore null and \n when parsing 2022-04-14 16:12:16 +02:00
Parser.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00