Added new structure to handle partial content requests
This commit is contained in:
parent
5fb02304be
commit
bf05086381
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
//#define DEBUG_WEBCL
|
//#define DEBUG_WEBCL
|
||||||
|
|
||||||
WEBClient::WEBClient(WiFiClient client, uint8_t id, uint16_t maxResourceBuffer, uint16_t maxBodyBuffer, uint16_t dataBufferSize) : TCPClient(client, id, dataBufferSize), _WEBClientState(WEBServer<WEBClient>::WEBClientState::ACCEPTED), _httpParserState(WEBServer<WEBClient>::HttpParserStatus::HTTP_VERB), _fileSentBytes(0), _range(0)
|
WEBClient::WEBClient(WiFiClient client, uint8_t id, uint16_t maxResourceBuffer, uint16_t maxBodyBuffer, uint16_t dataBufferSize) : TCPClient(client, id, dataBufferSize)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_WEBCL
|
#ifdef DEBUG_WEBCL
|
||||||
Serial.println("WEBClient : Standard constructor called");
|
Serial.println("WEBClient : Standard constructor called");
|
||||||
|
@ -12,12 +12,18 @@ class WEBClient : public TCPClient
|
|||||||
WEBClient(WiFiClient client, uint8_t id, uint16_t maxResourceBuffer = 255, uint16_t maxBodyBuffer = 255, uint16_t dataBufferSize = 511);
|
WEBClient(WiFiClient client, uint8_t id, uint16_t maxResourceBuffer = 255, uint16_t maxBodyBuffer = 255, uint16_t dataBufferSize = 511);
|
||||||
virtual ~WEBClient();
|
virtual ~WEBClient();
|
||||||
protected:
|
protected:
|
||||||
WEBServer<WEBClient>::WEBClientState _WEBClientState;
|
WEBServer<WEBClient>::WEBClientState _WEBClientState = WEBServer<WEBClient>::WEBClientState::ACCEPTED;
|
||||||
private:
|
private:
|
||||||
WEBServer<WEBClient>::HttpRequestData _httpRequestData;
|
WEBServer<WEBClient>::HttpRequestData _httpRequestData;
|
||||||
WEBServer<WEBClient>::HttpParserStatus _httpParserState;
|
WEBServer<WEBClient>::HttpParserStatus _httpParserState = WEBServer<WEBClient>::HttpParserStatus::HTTP_VERB;
|
||||||
uint64_t _fileSentBytes;
|
uint64_t _fileSentBytes = 0;
|
||||||
uint64_t _range; //Used to store the value of the range param for file downloading
|
struct
|
||||||
|
{
|
||||||
|
bool _rangeRequest;
|
||||||
|
size_t _rangeStart;
|
||||||
|
size_t _rangeEnd;
|
||||||
|
} _rangeData = {false, 0, 0}; //Used to store the values of the range param for file downloads and media playback
|
||||||
|
bool _keepAlive = false;
|
||||||
void clearHttpRequestData();
|
void clearHttpRequestData();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user