summaryrefslogtreecommitdiffstats
path: root/espFtpServer.cpp
diff options
context:
space:
mode:
authorDaniel Plasa <dplasa@gmail.com>2020-05-26 04:56:07 +0200
committerDaniel Plasa <dplasa@gmail.com>2020-05-26 04:56:07 +0200
commit863ff54097231ceae6e34908d843586adc83a44d (patch)
tree28d5d8cefb34c55c1b56f3e573052bcc02ea04ce /espFtpServer.cpp
parenttry subtile malloc()'ing buffers with 16 byte steps until we get something (diff)
downloadFTPCLientServer-863ff54097231ceae6e34908d843586adc83a44d.tar
FTPCLientServer-863ff54097231ceae6e34908d843586adc83a44d.tar.gz
FTPCLientServer-863ff54097231ceae6e34908d843586adc83a44d.tar.bz2
FTPCLientServer-863ff54097231ceae6e34908d843586adc83a44d.tar.lz
FTPCLientServer-863ff54097231ceae6e34908d843586adc83a44d.tar.xz
FTPCLientServer-863ff54097231ceae6e34908d843586adc83a44d.tar.zst
FTPCLientServer-863ff54097231ceae6e34908d843586adc83a44d.zip
Diffstat (limited to 'espFtpServer.cpp')
-rw-r--r--espFtpServer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/espFtpServer.cpp b/espFtpServer.cpp
index a6c705f..aa67fe3 100644
--- a/espFtpServer.cpp
+++ b/espFtpServer.cpp
@@ -1030,9 +1030,9 @@ int32_t FtpServer::allocateBuffer(int32_t desiredBytes)
if (maxBlock - desiredBytes < 0)
desiredBytes = maxBlock;
- // leave at least (10% of heap) as reserve
- if (maxHeap - desiredBytes < (maxHeap / 10))
- desiredBytes -= (maxHeap / 10);
+ // leave at least (20% of heap) as reserve
+ if (maxHeap - desiredBytes < (maxHeap / 5))
+ desiredBytes -= (maxHeap / 5);
// round down on 4byte bound
desiredBytes &= ~3;