Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/WebHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ bool AsyncStaticWebHandler::_searchFile(AsyncWebServerRequest *request, const St
char *_tempPath = (char *)malloc(pathLen + 1);
if (_tempPath == NULL) {
async_ws_log_e("Failed to allocate");
request->abort();
request->_tempFile.close();
request->abort();
return false;
}
snprintf_P(_tempPath, pathLen + 1, PSTR("%s"), path.c_str());
Expand Down
5 changes: 3 additions & 2 deletions src/WebRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ void AsyncWebServerRequest::onDisconnect(ArDisconnectHandler fn) {
}

void AsyncWebServerRequest::_onDisconnect() {
// os_printf("d\n");
async_ws_log_v("onDisconnect() cb for request: %s", _url.c_str());
if (_onDisconnectfn) {
_onDisconnectfn();
}
Expand Down Expand Up @@ -1066,8 +1066,9 @@ void AsyncWebServerRequest::abort() {
_sent = true;
_paused = false;
_this.reset();
// async_ws_log_e("AsyncWebServerRequest::abort");
async_ws_log_v("Abort request: %s", _url.c_str());
_client->abort();
_onDisconnect();
}
}

Expand Down
Loading