AlteriomPainlessMesh v2.1.1
Easy ESP32/ESP8266 mesh networking with Alteriom IoT extensions
Loading...
Searching...
No Matches
Public Member Functions | List of all members
painlessmesh::gateway::ChunkedBodyDecoder Class Reference

Removes HTTP/1.1 chunked transfer framing from a body read a byte at a time, and passes the content on to a ResponseExcerpt. More...

#include <gateway.hpp>

Public Member Functions

 ChunkedBodyDecoder (ResponseExcerpt &excerpt)
 
bool add (char c)
 
void add (const TSTRING &raw)
 
bool complete () const
 

Detailed Description

Removes HTTP/1.1 chunked transfer framing from a body read a byte at a time, and passes the content on to a ResponseExcerpt.

HTTPClient's getString() decodes a chunked body but keeps all of it; the gateway reads the raw stream to keep only a bounded excerpt, and the raw stream is the framing: CallMeBot's real reply reached the application as "a6 Message to: ... Message queued. ... 0" (hardware rig, 2026-09-15) – the chunk size in front, the terminating zero-length chunk behind. This reads the framing (hex size, optional ;extensions, CRLF, data, CRLF, ..., 0, trailers) and forwards only the data. A malformed size line stops decoding rather than guessing: what was decoded so far is kept.

Constructor & Destructor Documentation

◆ ChunkedBodyDecoder()

painlessmesh::gateway::ChunkedBodyDecoder::ChunkedBodyDecoder ( ResponseExcerpt &  excerpt)
inlineexplicit

Member Function Documentation

◆ add() [1/2]

bool painlessmesh::gateway::ChunkedBodyDecoder::add ( char  c)
inline

One byte of the raw body; false once the body ended or the excerpt is full, when the caller can stop reading.

◆ add() [2/2]

void painlessmesh::gateway::ChunkedBodyDecoder::add ( const TSTRING &  raw)
inline

◆ complete()

bool painlessmesh::gateway::ChunkedBodyDecoder::complete ( ) const
inline

True when the terminating zero-length chunk was read.


The documentation for this class was generated from the following file: