arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
HttpChunkReader Class Reference

Http might reply with chunks. So we need to dechunk the data. see https://en.wikipedia.org/wiki/Chunked_transfer_encoding. More...

#include <HttpChunkReader.h>

Inheritance diagram for HttpChunkReader:
HttpLineReader

Public Member Functions

 HttpChunkReader ()
 default constructor
 
 HttpChunkReader (HttpReplyHeader &header)
 constructor for processing final header information
 
int available ()
 returns the number of bytes which are still available in the current chunk
 
bool open (Client &client)
 opens the chunk reader and reads the first chunk length
 
int read (Client &client, uint8_t *str, int len)
 reads a block of data from the chunks
 
int readln (Client &client, uint8_t *str, int len, bool incl_nl=true)
 reads a single line from the chunks
 
virtual int readlnInternal (Stream &client, uint8_t *str, int len, bool incl_nl=true)
 
void setTimeout (int timeoutMs)
 Timout is just used for logging.
 

Protected Member Functions

bool readChunkLen (Client &client)
 
void removeCRLF (Client &client)
 

Protected Attributes

bool has_ended = false
 
HttpReplyHeaderhttp_header_ptr
 
int open_chunk_len = 0
 
int timeout = 0
 

Detailed Description

Http might reply with chunks. So we need to dechunk the data. see https://en.wikipedia.org/wiki/Chunked_transfer_encoding.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ HttpChunkReader() [1/2]

HttpChunkReader ( )
inline

default constructor

◆ HttpChunkReader() [2/2]

HttpChunkReader ( HttpReplyHeader header)
inline

constructor for processing final header information

Member Function Documentation

◆ available()

int available ( )
inline

returns the number of bytes which are still available in the current chunk

◆ open()

bool open ( Client client)
inline

opens the chunk reader and reads the first chunk length

◆ read()

int read ( Client client,
uint8_t str,
int  len 
)
inline

reads a block of data from the chunks

◆ readChunkLen()

bool readChunkLen ( Client client)
inlineprotected

◆ readln()

int readln ( Client client,
uint8_t str,
int  len,
bool  incl_nl = true 
)
inline

reads a single line from the chunks

◆ readlnInternal()

virtual int readlnInternal ( Stream client,
uint8_t str,
int  len,
bool  incl_nl = true 
)
inlinevirtualinherited

◆ removeCRLF()

void removeCRLF ( Client client)
inlineprotected

◆ setTimeout()

void setTimeout ( int  timeoutMs)
inline

Timout is just used for logging.

Member Data Documentation

◆ has_ended

bool has_ended = false
protected

◆ http_header_ptr

HttpReplyHeader* http_header_ptr
protected

◆ open_chunk_len

int open_chunk_len = 0
protected

◆ timeout

int timeout = 0
protected

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