From aff50d6a9cf19dfe6675e13ef3965803a1851b3c Mon Sep 17 00:00:00 2001 From: Niklas Jensen Date: Sun, 18 Jan 2026 21:43:03 +0100 Subject: [PATCH] Fixed comments and useless function declarations --- esp32/include/communication/proto_helpers.h | 2 +- esp32/src/filesystem_ws.cpp | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/esp32/include/communication/proto_helpers.h b/esp32/include/communication/proto_helpers.h index 053eb37..02313ab 100644 --- a/esp32/include/communication/proto_helpers.h +++ b/esp32/include/communication/proto_helpers.h @@ -6,7 +6,7 @@ #include #include -#define PROTO_BUFFER_SIZE 2048 // Increased for chunked file transfer responses +#define PROTO_BUFFER_SIZE 2048 template struct MessageTraits; diff --git a/esp32/src/filesystem_ws.cpp b/esp32/src/filesystem_ws.cpp index c0e7d13..4ec3f64 100644 --- a/esp32/src/filesystem_ws.cpp +++ b/esp32/src/filesystem_ws.cpp @@ -24,6 +24,7 @@ void FileSystemHandler::setSendCallbacks( sendUploadCompleteCallback_ = sendUploadComplete; } +// This transfer is can be simplified, current "xfer" is just to distinguish a fs transfer id from any other, but relistically is just a waste of 5 bytes for every chunk sent std::string FileSystemHandler::generateTransferId() { return "xfer_" + std::to_string(millis()) + "_" + std::to_string(++transferIdCounter_); } @@ -347,10 +348,6 @@ bool FileSystemHandler::sendNextDownloadChunk(const std::string& transferId) { return true; } -void FileSystemHandler::processPendingDownloads() { - // Process any pending downloads (in case we want non-blocking downloads) - // Currently downloads are synchronous in handleDownloadRequest -} // ===== STREAMING UPLOAD ===== @@ -467,7 +464,7 @@ void FileSystemHandler::handleUploadData(const socket_message_FSUploadData& req) } } -// Note that the finalize upload takes a insane amount of time, as it is flushing from ram to an incredibly slow LittleFS SPIFFS (Tested to roughly 12 seconds for 1 mb file) +// Note that the finalize upload takes an insane amount of time, as it is flushing from ram to an incredibly slow LittleFS SPIFFS (Tested to roughly 12 seconds for 1 mb file) void FileSystemHandler::finalizeUpload(const std::string& transferId, bool success, const std::string& error) { auto it = uploads_.find(transferId); if (it == uploads_.end()) {