Add an overload for detail::select_read() that accepts two FDs and
reports readability via two boolean out parameters. This is required to
implement interruptible reads.
Both overloads build on top of a common implementation that optimizes to
the same assembly for the common, single FD case.
Refactor detail::random_string() to output random bytes in addition to
random alphanumeric strings, and change the interface to fill a buffer
given a char pointer and length, instead of returning a string.
Rename the new function to random_bytes().
Add an overload random_string() that implements the old behavior on top
of random_bytes().
Introduce a new callback StreamHandler that replaces all other
content-serving mechanisms, if set. The handler is not called in
response to HEAD or CONNECT requests, or when following a redirect.
In conjunction with a response handler, it provides a minimal interface
to implement a WebSocket client.
Modify for OpenVMS x86 C++. Make tests on OpenVMS currently not supported due to no cmake support.
Changes tested on OpenVMS clang C++ and Fedora & GCC
RFC-9110 '14.1.2. Byte Ranges':
A client can limit the number of bytes requested without knowing the
size of the selected representation. If the last-pos value is absent,
or if the value is greater than or equal to the current length of the
representation data, the byte range is interpreted as the remainder of
the representation (i.e., the server replaces the value of last-pos
with a value that is one less than the current length of the selected
representation).
https://www.rfc-editor.org/rfc/rfc9110.html#section-14.1.2-6
The testsuite checks for the exact size of the compressed content. The
exact size can change if the zlib library is using a different strategy.
In thise case using zlib-ng results in a slightly larger content leading
to a failure in the test.
Check that the compressed content is less than 10MiB which is a tenth of
the orignal content and proves that compression works.
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>