mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:17:35 +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:
parent
3b1e063d30
commit
c4134e9794
4 changed files with 19 additions and 19 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue