Minor cleanup of AsyncWebServer, removing unneeded casts. (#156)
This commit is contained in:
parent
ab61227a8a
commit
2c4128c7cd
|
@ -369,7 +369,7 @@ class AsyncWebServer {
|
|||
AsyncServer _server;
|
||||
LinkedList<AsyncWebRewrite*> _rewrites;
|
||||
LinkedList<AsyncWebHandler*> _handlers;
|
||||
AsyncWebHandler* _catchAllHandler;
|
||||
AsyncCallbackWebHandler* _catchAllHandler;
|
||||
|
||||
public:
|
||||
AsyncWebServer(uint16_t port);
|
||||
|
|
|
@ -163,15 +163,15 @@ AsyncStaticWebHandler& AsyncWebServer::serveStatic(const char* uri, fs::FS& fs,
|
|||
}
|
||||
|
||||
void AsyncWebServer::onNotFound(ArRequestHandlerFunction fn){
|
||||
((AsyncCallbackWebHandler*)_catchAllHandler)->onRequest(fn);
|
||||
_catchAllHandler->onRequest(fn);
|
||||
}
|
||||
|
||||
void AsyncWebServer::onFileUpload(ArUploadHandlerFunction fn){
|
||||
((AsyncCallbackWebHandler*)_catchAllHandler)->onUpload(fn);
|
||||
_catchAllHandler->onUpload(fn);
|
||||
}
|
||||
|
||||
void AsyncWebServer::onRequestBody(ArBodyHandlerFunction fn){
|
||||
((AsyncCallbackWebHandler*)_catchAllHandler)->onBody(fn);
|
||||
_catchAllHandler->onBody(fn);
|
||||
}
|
||||
|
||||
void AsyncWebServer::reset(){
|
||||
|
@ -179,9 +179,9 @@ void AsyncWebServer::reset(){
|
|||
_handlers.free();
|
||||
|
||||
if (_catchAllHandler != NULL){
|
||||
((AsyncCallbackWebHandler*)_catchAllHandler)->onRequest(NULL);
|
||||
((AsyncCallbackWebHandler*)_catchAllHandler)->onUpload(NULL);
|
||||
((AsyncCallbackWebHandler*)_catchAllHandler)->onBody(NULL);
|
||||
_catchAllHandler->onRequest(NULL);
|
||||
_catchAllHandler->onUpload(NULL);
|
||||
_catchAllHandler->onBody(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue