Update xdrv_98_filesystem.ino

This commit is contained in:
gemu2015 2021-01-01 08:41:36 +01:00
parent 55d0f99910
commit 03a9d5b71f

View File

@ -373,7 +373,7 @@ void UFS_ListDir(char *path, uint8_t depth) {
if (!*(pp + 1)) pp++; if (!*(pp + 1)) pp++;
char *cp = name; char *cp = name;
// osx formatted disks contain a lot of stuff we dont want // osx formatted disks contain a lot of stuff we dont want
if (ufs_reject((char*)ep)) goto fclose; if (!ufs_reject((char*)ep)) {
for (uint8_t cnt = 0; cnt<depth; cnt++) { for (uint8_t cnt = 0; cnt<depth; cnt++) {
*cp++ = '-'; *cp++ = '-';
@ -394,7 +394,7 @@ void UFS_ListDir(char *path, uint8_t depth) {
snprintf_P(npath, sizeof(npath), UFS_FORM_SDC_HREF, WiFi.localIP().toString().c_str(), pp,ep); snprintf_P(npath, sizeof(npath), UFS_FORM_SDC_HREF, WiFi.localIP().toString().c_str(), pp,ep);
WSContentSend_P(UFS_FORM_SDC_DIRb, npath, ep, name, tstr, entry.size()); WSContentSend_P(UFS_FORM_SDC_DIRb, npath, ep, name, tstr, entry.size());
} }
fclose: }
entry.close(); entry.close();
} }
dir.close(); dir.close();
@ -405,8 +405,6 @@ uint8_t UFS_DownloadFile(char *file) {
File download_file; File download_file;
WiFiClient download_Client; WiFiClient download_Client;
//AddLog_P(LOG_LEVEL_INFO, PSTR("file not found %s"),file);
if (!ufsp->exists(file)) { if (!ufsp->exists(file)) {
AddLog_P(LOG_LEVEL_INFO, PSTR("file not found")); AddLog_P(LOG_LEVEL_INFO, PSTR("file not found"));
return 0; return 0;
@ -457,6 +455,7 @@ uint8_t UFS_DownloadFile(char *file) {
// loop(); // loop();
//} //}
} }
delay(0);
} }
download_file.close(); download_file.close();
download_Client.stop(); download_Client.stop();