If USING_AK_GLOBALLY is not defined, the name IsLvalueReference might
not be available in the global namespace. Follow the pattern established
in LibTest to fully qualify AK types in macros to avoid this problem.
We don't need to call `can_read_line()` as the buffer will be populated
by `find_and_populate_until_any_of()`. The change is also beneficial as
the buffer will be populated until a candidate is found and not
necessarily a new line.
The search used to go through the buffer from the start, even if we just
appended a small number of bytes at the end. It now remembers the last
stop and resume the search from it.
This parameter allows to start searching after an offset. For example,
to resume a search.
It is unfortunately a breaking change in API so this patch also modifies
one user and one test.
The previously defined operator was swap-based. With the defaulted
implementation, both integers are now copied, but it doesn't matter as
only the `ByteBuffer` allocates memory (i.e. non-null integers values
won't affect the destruction).
The old approach was basically a linear scan, which is slower than a
hash map for the currently 303 elements, as evidenced by the new
benchmark in TestCSSIDSpeed.
Before: Completed benchmark 'value_id_from_string' in 3238ms
After: Completed benchmark 'value_id_from_string' in 193ms
Introduce `TableWrapper` type so table wrappers could be
distinguished from block containers and override width
calculation for table wrappers (CSS 2.2 spec, section 17.5.2)
inside BFCs in the way that their width should be equal to
width of table box they wrap.
Previously, the job was shutdown only on a deferred invoke while there
was still data to be read. This meant that the read callback would get
called again and again, and, potentially throw the error again and again
This patch introoduces a failed state for the protocol parser and
returns early from the read callback if it has already failed
Starting a gemini request creates a pipe for the output stream for the
response, and a Core::Stream::File object is created from that pipe.
Previously, the length of the response was computed by calling
output_stream.size() which used lseek on the file descriptor. Doing that
returned an error from lseek. Computing the value by counting the
received bytes (via Gemini::Job::response_length) avoids that crash.
Unlike HTTP responses, Gemini responses do not have a length header or a
delimiter for the end of a response. A response simply continues until
the connection is closed and its length is the number of bytes received.
So, the response length method only returns the result if it has
finished
Ladybird currently doesn't render any webpages on FreeBSD and throws
hundreds of errors,beginning with this:
IPC::ConnectionBase (0x0000000805bf2b00) had an error (File descriptor
passing not supported on this platform), disconnecting.
WebContent process crashed!
There is no particular reason why we shouldn't allow zero-sized reads or
writes here, and this actually might cause issues with our common
stream-to-stream copy pattern if we end up at an unfortunate offset
where the next read would be zero-sized and trigger EOF only after that.
We don't have anything fallible in there yet, but we will soon switch
the seekback buffer to the new `CircularBuffer`, which has a fallible
constructor.
We have to do the same for the internal `GzipDecompressor::Member`
class, as it needs to construct a `DeflateCompressor` from its received
stream.
It turns out return a ThrowCompletionOr<T const&> is flawed, as the GCC
expansion trick used with TRY will always make a copy. PrimitiveString
is luckily the only such use case.
These are formatters that can only be used with debug print
functions, such as dbgln(). Currently this is limited to
Formatter<ErrorOr<T>>. With this you can still debug log ErrorOr
values (good for debugging), but trying to use them in any
String::formatted() call will fail (which prevents .to_string()
errors with the new failable strings being ignored).
You make a formatter debug only by adding a constexpr method like:
static constexpr bool is_debug_only() { return true; }