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