mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:17:34 +00:00
AK: Make ByteBuffer::try_* functions return ErrorOr<void>
Same as Vector, ByteBuffer now also signals allocation failure by returning an ENOMEM Error instead of a bool, allowing us to use the TRY() and MUST() patterns.
This commit is contained in:
parent
88b6428c25
commit
a15ed8743d
20 changed files with 59 additions and 70 deletions
|
@ -35,7 +35,7 @@ void TLSv12::consume(ReadonlyBytes record)
|
|||
|
||||
dbgln_if(TLS_DEBUG, "Consuming {} bytes", record.size());
|
||||
|
||||
if (!m_context.message_buffer.try_append(record)) {
|
||||
if (m_context.message_buffer.try_append(record).is_error()) {
|
||||
dbgln("Not enough space in message buffer, dropping the record");
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue