For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr, strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return pointers into their input arrays now have definitions as macros that return a pointer to a const-qualified type when the input argument is a pointer to a const-qualified type.
The /cmd getters serialized into fixed stack buffers (get_stats 20480,
get_meta 2048, get_protocols 102400). When a report exceeded its buffer
the output was silently corrupted into invalid JSON, not cleanly
truncated: the abuf string builder drops an oversized chunk but keeps
appending the smaller chunks that follow, so e.g. a get_stats reply with
~230 enabled decoders ended like `...,"name":,:8256}`. Clients then fail
to parse the response and the corresponding data never updates.
Make the serializer report truncation and add data_print_jsons_dup(),
which grows a heap buffer until the whole document fits, and use it for
the three JSON-payload getters:
- abuf gains an `overflow` flag, set by abuf_cat/abuf_printf and the
hand-rolled string formatter whenever a write is dropped or truncated.
- data_print_jsons_dup() retries with a doubled buffer until no overflow
(64 MiB sanity cap), so the report is never truncated.
- get_stats/get_meta/get_protocols use it and free the buffer after
responding; out-of-memory yields an error reply instead of a partial one.
Tests:
- data-test asserts a large report serializes to a complete object via
data_print_jsons_dup() while a fixed undersized buffer does not.
- the HTTP integration test now validates that get_protocols/get_stats/
get_meta return parseable JSON, not just HTTP 200.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add black-box integration tests for the HTTP/WS server and rtl_tcp,
plus a gcov coverage helper and supporting CI wiring.
Refs: #3541
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
make sure that char* declarations with a direct assignment of a constant are no longer valid in plugins. They must be char const * because string literals are "const" with newest compilers
Change all r_device declarations to const, which places them in the "read only" memory portion which is distinct from the limited quantity SRAM available on embedded platforms.