mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +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:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user