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>