Skip to content

ESP/Netsender: Remove dynamic allocation from HTTP request paths - #166

Merged
ao-david merged 2 commits into
speaker/pr02-audio-buffersfrom
speaker/pr03-netsender-alloc
Oct 29, 2026
Merged

ao-david merged 2 commits into
speaker/pr02-audio-buffersfrom
speaker/pr03-netsender-alloc

Conversation

@ao-david

Copy link
Copy Markdown
Member

Stacked on #165.

Replace netsender_extract_json's std::string interface with a bounded
(const char *) API that writes into caller-provided buffers. Response
fields are now parsed directly from the fixed HTTP response buffer, so
the poll/vars/config paths no longer allocate temporary strings.

Remove std::string from the variable state helpers in favour of
std::string_view and fixed character buffers, and replace std::stoi
with non-throwing parsing. Update gen_vars.py so regenerated headers keep
the allocation-free behaviour.
The pin readers and variable parser are intentionally non-capturing
functions, so store them as plain function pointers instead of
std::function. Convert the logging reader from a lambda to a static
function as well.
@ao-david
ao-david added this pull request to stack #173 October 29, 2026 06:47
@ao-david
ao-david merged commit 87ccbdc into main Oct 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant