mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:57: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
|
@ -157,8 +157,8 @@ void Job::register_on_ready_to_read(Function<void()> callback)
|
|||
ErrorOr<String> Job::read_line(size_t size)
|
||||
{
|
||||
auto buffer = TRY(ByteBuffer::create_uninitialized(size));
|
||||
auto nread = TRY(m_socket->read_until(buffer, "\r\n"sv));
|
||||
return String::copy(buffer.span().slice(0, nread));
|
||||
auto bytes_read = TRY(m_socket->read_until(buffer, "\r\n"sv));
|
||||
return String::copy(bytes_read);
|
||||
}
|
||||
|
||||
ErrorOr<ByteBuffer> Job::receive(size_t size)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue