Moved the HttpRequestData Structure from the WEBClient class to the WEBServer class

This commit is contained in:
anschrammh 2019-10-10 18:15:59 +02:00
parent a95a387d30
commit 3bad569f21
2 changed files with 3 additions and 19 deletions

View File

@ -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) 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)
{ {
#ifdef DEBUG_WEBCL #ifdef DEBUG_WEBCL
Serial.println("WEBClient : Standard constructor called"); Serial.println("WEBClient : Standard constructor called");

View File

@ -15,25 +15,9 @@ class WEBClient : public TCPClient
protected: protected:
WEBServer<WEBClient>::WEBClientState _WEBClientState; WEBServer<WEBClient>::WEBClientState _WEBClientState;
private: private:
struct HttpRequestData WEBServer<WEBClient>::HttpRequestData _httpRequestData;
{
WEBServer<WEBClient>::HttpRequestMethod HRM;
WEBServer<WEBClient>::HttpVersion HV;
WEBServer<WEBClient>::HttpMIMEType HMT;
Dictionary<DictionaryHelper::StringEntity> getParams;
char *getParamsDataPointer; //Used in the getParams algorithm
Dictionary<DictionaryHelper::StringEntity> postParams;
char *postParamsDataPointer; //Used in the postParams algorithm
char *httpResource;
uint16_t maxResourceBuffer;
char *httpBody;
uint16_t maxBodyBuffer;
} _httpRequestData;
WEBServer<WEBClient>::HttpParserStatus _httpParserState; WEBServer<WEBClient>::HttpParserStatus _httpParserState;
uint64_t _fileSentBytes;
void clearHttpRequestData(); void clearHttpRequestData();
}; };