Updated TCPServer and WEBServer core logic
This commit is contained in:
parent
1450a8c0e5
commit
c777e23a52
@ -140,9 +140,9 @@ class TCPServer
|
|||||||
|
|
||||||
if(_currentClient->_dataSize > 0)
|
if(_currentClient->_dataSize > 0)
|
||||||
{
|
{
|
||||||
processClientData(_currentClient);//We process the actual data
|
|
||||||
_currentClient->_newDataAvailable = false;
|
_currentClient->_newDataAvailable = false;
|
||||||
}
|
}
|
||||||
|
processClientData(_currentClient);//We process the actual data
|
||||||
|
|
||||||
if(_currentClient->_clientState == TCPClient::ClientState::DISCARDED)
|
if(_currentClient->_clientState == TCPClient::ClientState::DISCARDED)
|
||||||
{
|
{
|
||||||
|
@ -34,7 +34,7 @@ class WEBServer : public TCPServer<T>
|
|||||||
uint16_t maxBodyBuffer;
|
uint16_t maxBodyBuffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
WEBServer(unsigned int port = 80, SDCardManager *sdCardManager = NULL, uint8_t maxClient = MAX_CLIENT, uint16_t clientDataBufferSize = 512) : TCPServer<T>(port, maxClient, clientDataBufferSize), _sdCardManager(sdCardManager) {}
|
WEBServer(unsigned int port = 80, SDCardManager *sdCardManager = NULL, uint8_t maxClient = MAX_CLIENT, uint16_t clientDataBufferSize = 255) : TCPServer<T>(port, maxClient, clientDataBufferSize), _sdCardManager(sdCardManager) {}
|
||||||
|
|
||||||
boolean addApiRoutine(const char *uri, boolean (*apiRoutine)(HttpRequestData&, WiFiClient*, void*), void *pData, HttpRequestMethod HRM = UNDEFINED)
|
boolean addApiRoutine(const char *uri, boolean (*apiRoutine)(HttpRequestData&, WiFiClient*, void*), void *pData, HttpRequestMethod HRM = UNDEFINED)
|
||||||
{
|
{
|
||||||
@ -51,7 +51,7 @@ class WEBServer : public TCPServer<T>
|
|||||||
private:
|
private:
|
||||||
virtual T* createNewClient(WiFiClient wc)
|
virtual T* createNewClient(WiFiClient wc)
|
||||||
{
|
{
|
||||||
return new T(wc, TCPServer<T>::freeClientId());
|
return new T(wc, TCPServer<T>::freeClientId(), TCPServer<T>::_clientDataBufferSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void greetClient(T *client)
|
virtual void greetClient(T *client)
|
||||||
@ -60,6 +60,8 @@ class WEBServer : public TCPServer<T>
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void processClientData(T *client)
|
virtual void processClientData(T *client)
|
||||||
|
{
|
||||||
|
if(client->_dataSize > 0)
|
||||||
{
|
{
|
||||||
switch(client->_WEBClientState)
|
switch(client->_WEBClientState)
|
||||||
{
|
{
|
||||||
@ -89,6 +91,7 @@ class WEBServer : public TCPServer<T>
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void queryParser(T *client)
|
void queryParser(T *client)
|
||||||
{
|
{
|
||||||
|
@ -17,5 +17,6 @@
|
|||||||
#define SOFT_VERSION "1.2.1" //Corrected a bug in the TaskSchedulerManager class
|
#define SOFT_VERSION "1.2.1" //Corrected a bug in the TaskSchedulerManager class
|
||||||
#define SOFT_VERSION "1.3.0" //Implemented multi-client non blocking webserver
|
#define SOFT_VERSION "1.3.0" //Implemented multi-client non blocking webserver
|
||||||
#define SOFT_VERSION "1.3.1" //Fixed sdCardUnmount api call
|
#define SOFT_VERSION "1.3.1" //Fixed sdCardUnmount api call
|
||||||
|
#define SOFT_VERSION "1.3.2" //Modified TCPServer and WEBServer core logic
|
||||||
|
|
||||||
#endif //VERSIONS_H
|
#endif //VERSIONS_H
|
||||||
|
Loading…
Reference in New Issue
Block a user