Skip to content

Commit 87d199f

Browse files
committed
Fix forward declaration of FS
1 parent eb596d5 commit 87d199f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

hardware/esp8266com/esp8266/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include <Arduino.h>
2525
#include "WiFiServer.h"
2626
#include "WiFiClient.h"
27-
#include "FS.h"
2827
#include "ESP8266WebServer.h"
28+
#include "FS.h"
2929
#include "detail/RequestHandler.h"
3030
// #define DEBUG
3131
#define DEBUG_OUTPUT Serial
@@ -181,7 +181,7 @@ void ESP8266WebServer::sendContent(const String& content) {
181181
const size_t unit_size = HTTP_DOWNLOAD_UNIT_SIZE;
182182
size_t size_to_send = content.length();
183183
const char* send_start = content.c_str();
184-
184+
185185
while (size_to_send) {
186186
size_t will_send = (size_to_send < unit_size) ? size_to_send : unit_size;
187187
size_t sent = _currentClient.write(send_start, will_send);

hardware/esp8266com/esp8266/libraries/ESP8266WebServer/src/ESP8266WebServer.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ enum HTTPUploadStatus { UPLOAD_FILE_START, UPLOAD_FILE_WRITE, UPLOAD_FILE_END };
3838
#define CONTENT_LENGTH_NOT_SET ((size_t) -2)
3939

4040
class RequestHandler;
41+
42+
namespace fs {
4143
class FS;
44+
}
4245

4346
typedef struct {
4447
HTTPUploadStatus status;
@@ -62,7 +65,7 @@ class ESP8266WebServer
6265
typedef std::function<void(void)> THandlerFunction;
6366
void on(const char* uri, THandlerFunction handler);
6467
void on(const char* uri, HTTPMethod method, THandlerFunction fn);
65-
void serveStatic(const char* uri, FS& fs, const char* path);
68+
void serveStatic(const char* uri, fs::FS& fs, const char* path);
6669
void onNotFound(THandlerFunction fn); //called when handler is not assigned
6770
void onFileUpload(THandlerFunction fn); //handle file uploads
6871

0 commit comments

Comments
 (0)