diff options
author | Daniel Plasa <dplasa@gmail.com> | 2020-05-31 14:43:26 +0200 |
---|---|---|
committer | Daniel Plasa <dplasa@gmail.com> | 2020-05-31 14:43:26 +0200 |
commit | 5094cb3c168ed5c08dbdaa982fe1c096482c5ecc (patch) | |
tree | 618593e64517b17b3e2876c12a71e11c6f76d855 /FTPCommon.cpp | |
parent | describe limited use of FuseFS clients (diff) | |
download | FTPCLientServer-5094cb3c168ed5c08dbdaa982fe1c096482c5ecc.tar FTPCLientServer-5094cb3c168ed5c08dbdaa982fe1c096482c5ecc.tar.gz FTPCLientServer-5094cb3c168ed5c08dbdaa982fe1c096482c5ecc.tar.bz2 FTPCLientServer-5094cb3c168ed5c08dbdaa982fe1c096482c5ecc.tar.lz FTPCLientServer-5094cb3c168ed5c08dbdaa982fe1c096482c5ecc.tar.xz FTPCLientServer-5094cb3c168ed5c08dbdaa982fe1c096482c5ecc.tar.zst FTPCLientServer-5094cb3c168ed5c08dbdaa982fe1c096482c5ecc.zip |
Diffstat (limited to '')
-rw-r--r-- | FTPCommon.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/FTPCommon.cpp b/FTPCommon.cpp index 4b8af4c..0651022 100644 --- a/FTPCommon.cpp +++ b/FTPCommon.cpp @@ -1,7 +1,6 @@ #include "FTPCommon.h" -FTPCommon::FTPCommon(FS &_FSImplementation) : - THEFS(_FSImplementation), sTimeOutMs(FTP_TIME_OUT*60*1000), aTimeout(FTP_TIME_OUT*60*1000) +FTPCommon::FTPCommon(FS &_FSImplementation) : THEFS(_FSImplementation), sTimeOutMs(FTP_TIME_OUT * 60 * 1000), aTimeout(FTP_TIME_OUT * 60 * 1000) { } @@ -23,14 +22,17 @@ void FTPCommon::setTimeout(uint32_t timeoutMs) sTimeOutMs = timeoutMs; } +// +// allocate a big buffer for file transfers +// uint16_t FTPCommon::allocateBuffer(uint16_t desiredBytes) { - // allocate a big buffer for file transfers +#if (defined ESP8266) uint16_t maxBlock = ESP.getMaxFreeBlockSize() / 2; if (desiredBytes > maxBlock) desiredBytes = maxBlock; - +#endif while (fileBuffer == NULL && desiredBytes > 0) { fileBuffer = (uint8_t *)malloc(desiredBytes); @@ -141,7 +143,7 @@ bool FTPCommon::doNetworkToFile() void FTPCommon::closeTransfer() { - freeBuffer(); - file.close(); - data.stop(); + freeBuffer(); + file.close(); + data.stop(); } |