Updated WEBServerManager due to changes in the Dictionary utility class plus bug fixes

This commit is contained in:
Anatole SCHRAMM 2019-04-03 17:16:50 +02:00
parent b95716c38b
commit a33add50f1

View File

@ -325,19 +325,17 @@ boolean WEBServerManager::sendPageToClientFromApiDictio(WiFiClient *wifiClient)
{ {
if(_apiDictionary.count() == 0) if(_apiDictionary.count() == 0)
return false; return false;
Serial.println("___1"); ApiRoutine *ref = _apiDictionary(_httpRequestData.httpResource);
ApiRoutine *ref = _apiDictionary(_httpRequestData.httpResource).getValueRef();
Serial.println("___2");
if(ref == NULL) if(ref == NULL)
return false; return false;
if(ref->HRM == UNDEFINED) if(ref->HRM == UNDEFINED)
{ {
Serial.println("___3"); return (*(ref->apiRoutine))(_httpRequestData, wifiClient, ref->pData);
return (*ref->apiRoutine)(_httpRequestData, wifiClient, ref->pData);
}else if(ref->HRM == _httpRequestData.HRM) }else if(ref->HRM == _httpRequestData.HRM)
{ {
return (*ref->apiRoutine)(_httpRequestData, wifiClient, ref->pData); return (*(ref->apiRoutine))(_httpRequestData, wifiClient, ref->pData);
} }
else else
return false; return false;
@ -445,4 +443,3 @@ void WEBServerManager::clearHttpRequestData()
_httpRequestData.httpResource = NULL;_httpRequestData.httpBody = NULL; _httpRequestData.httpResource = NULL;_httpRequestData.httpBody = NULL;
} }