From 43d80ee2ecd4f62c60a26abdceb0590139919053 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Wed, 12 Aug 2015 22:40:21 +0300 Subject: [PATCH] Fix forward declaration of FS --- libraries/ESP8266WebServer/src/ESP8266WebServer.cpp | 4 ++-- libraries/ESP8266WebServer/src/ESP8266WebServer.h | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp b/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp index 99068661c8..2f5b68a14d 100644 --- a/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp +++ b/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp @@ -24,8 +24,8 @@ #include #include "WiFiServer.h" #include "WiFiClient.h" -#include "FS.h" #include "ESP8266WebServer.h" +#include "FS.h" #include "detail/RequestHandler.h" // #define DEBUG #define DEBUG_OUTPUT Serial @@ -181,7 +181,7 @@ void ESP8266WebServer::sendContent(const String& content) { const size_t unit_size = HTTP_DOWNLOAD_UNIT_SIZE; size_t size_to_send = content.length(); const char* send_start = content.c_str(); - + while (size_to_send) { size_t will_send = (size_to_send < unit_size) ? size_to_send : unit_size; size_t sent = _currentClient.write(send_start, will_send); diff --git a/libraries/ESP8266WebServer/src/ESP8266WebServer.h b/libraries/ESP8266WebServer/src/ESP8266WebServer.h index 74d3ecb45d..ae38eb8ccf 100644 --- a/libraries/ESP8266WebServer/src/ESP8266WebServer.h +++ b/libraries/ESP8266WebServer/src/ESP8266WebServer.h @@ -38,7 +38,10 @@ enum HTTPUploadStatus { UPLOAD_FILE_START, UPLOAD_FILE_WRITE, UPLOAD_FILE_END }; #define CONTENT_LENGTH_NOT_SET ((size_t) -2) class RequestHandler; + +namespace fs { class FS; +} typedef struct { HTTPUploadStatus status; @@ -62,7 +65,7 @@ class ESP8266WebServer typedef std::function THandlerFunction; void on(const char* uri, THandlerFunction handler); void on(const char* uri, HTTPMethod method, THandlerFunction fn); - void serveStatic(const char* uri, FS& fs, const char* path); + void serveStatic(const char* uri, fs::FS& fs, const char* path); void onNotFound(THandlerFunction fn); //called when handler is not assigned void onFileUpload(THandlerFunction fn); //handle file uploads