Skip to content

Commit

Permalink
stupid hack to workaround bug chmorgan#93
Browse files Browse the repository at this point in the history
  • Loading branch information
pabbott-lumitec committed Nov 24, 2020
1 parent d0d2f64 commit ffabf41
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/httpd-espfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Connector to let httpd use the espfs filesystem to serve the files in it.
#ifdef CONFIG_ESPHTTPD_USE_ESPFS
#include "espfs.h"
#include "espfsformat.h" // just for FLAG_GZIP
#define LOG_LOCAL_LEVEL ESP_LOG_DEBUG
#include "esp_log.h"
const static char* TAG = "httpdespfs";

Expand Down Expand Up @@ -200,6 +201,11 @@ serveStaticFile(HttpdConnData *connData, const char* filepath) {

len=espFsRead(file, buff, FILE_CHUNK_LEN);
if (len>0) httpdSend(connData, buff, len);
// workaround if file size is exact multiple of FILE_CHUNK_LEN
if (len == 0){
httpdSend(connData,"\r\n",2);
ESP_LOGD(TAG, "multiple of 1024 detected!");
}
if (len!=FILE_CHUNK_LEN) {
//We're done.
espFsClose(file);
Expand Down

0 comments on commit ffabf41

Please sign in to comment.