Minor changes for test purposes | this class is going to be rewritten at some point

This commit is contained in:
Anatole SCHRAMM 2019-05-02 17:25:16 +02:00
parent f0d6486ef0
commit d5e1addbb6
2 changed files with 4 additions and 3 deletions

View File

@ -269,7 +269,8 @@ boolean WEBServerManager::parseQuery(WiFiClient *wifiClient)
_clientTimeout = millis(); _clientTimeout = millis();
} }
yield(); //yield(); //Likely causing a crash
ESP.wdtFeed();
} }
if(parseBuffer != NULL) if(parseBuffer != NULL)
@ -478,7 +479,7 @@ char *WEBServerManager::getFileExtension(char *name)
return ""; return "";
} }
char *WEBServerManager::getFilePathByHttpResource(const char *res) char *WEBServerManager::getFilePathByHttpResource(char *res)
{ {
uint16_t buffSize = strlen(WWW_DIR) + (strcmp(res, "/") == 0 ? 10:strlen(res)) + 1;//10 for /index.htm +1 for \0 uint16_t buffSize = strlen(WWW_DIR) + (strcmp(res, "/") == 0 ? 10:strlen(res)) + 1;//10 for /index.htm +1 for \0
char *filePath = (char*) malloc( sizeof(char) * buffSize); char *filePath = (char*) malloc( sizeof(char) * buffSize);

View File

@ -48,7 +48,7 @@ class WEBServerManager
boolean sendPageToClientFromApiDictio(WiFiClient *wifiClient); boolean sendPageToClientFromApiDictio(WiFiClient *wifiClient);
HttpRequestMethod getHttpVerbEnumValue(const char *parseBuffer); HttpRequestMethod getHttpVerbEnumValue(const char *parseBuffer);
HttpVersion getHttpVersionEnumValue(const char *parseBuffer); HttpVersion getHttpVersionEnumValue(const char *parseBuffer);
char *getFilePathByHttpResource(const char *res); char *getFilePathByHttpResource(char *res);
char *getFileExtension(char *name); char *getFileExtension(char *name);
HttpMIMEType getMIMETypeByExtension(const char *extension); HttpMIMEType getMIMETypeByExtension(const char *extension);
char *getHTTPHeader(HttpMIMEType httpMIMEType, unsigned long size); char *getHTTPHeader(HttpMIMEType httpMIMEType, unsigned long size);