From 51321af9e4e71f91ad57f8af2dc2e3975a5f1dde Mon Sep 17 00:00:00 2001 From: Daniel Plasa Date: Fri, 29 May 2020 23:29:08 +0200 Subject: use a buffer size that depends on the size of the lwip buffer configuration --- FTPClient.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'FTPClient.cpp') diff --git a/FTPClient.cpp b/FTPClient.cpp index 84c4fdb..c498ed0 100644 --- a/FTPClient.cpp +++ b/FTPClient.cpp @@ -160,15 +160,14 @@ void FTPClient::handleFTP() millisBeginTrans = millis(); bytesTransfered = 0; ftpState = cTransfer; + allocateBuffer(4 * TCP_MSS); if (_direction & FTP_PUT_NONBLOCKING) { CLIENT_SEND("STOR %s", _remoteFileName.c_str()); - allocateBuffer(file.size()); } else if (_direction & FTP_GET_NONBLOCKING) { CLIENT_SEND("RETR %s", _remoteFileName.c_str()); - allocateBuffer(2048); } } } -- cgit v1.2.3