1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

LibCore+Everywhere: Make Core::Stream read_until() return Bytes

This affects BufferedSeekable::read_until() and ::read_until_any_of().
For the reasoning, see the previous commit about Core::Stream::read().
This commit is contained in:
Sam Atkins 2022-04-15 13:44:23 +01:00 committed by Tim Flynn
parent 3b1e063d30
commit c4134e9794
4 changed files with 19 additions and 19 deletions

View file

@ -64,9 +64,9 @@ void Client::start()
if (!maybe_can_read.value())
break;
auto maybe_nread = m_socket->read_until_any_of(buffer, Array { "\r"sv, "\n"sv, "\r\n"sv });
if (maybe_nread.is_error()) {
warnln("Failed to read a line from the request: {}", maybe_nread.error());
auto maybe_bytes_read = m_socket->read_until_any_of(buffer, Array { "\r"sv, "\n"sv, "\r\n"sv });
if (maybe_bytes_read.is_error()) {
warnln("Failed to read a line from the request: {}", maybe_bytes_read.error());
die();
return;
}
@ -76,7 +76,7 @@ void Client::start()
break;
}
builder.append(StringView { buffer.data(), maybe_nread.value() });
builder.append(StringView { maybe_bytes_read.value() });
builder.append("\r\n");
}