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 /FTPClient.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 'FTPClient.cpp')
-rw-r--r-- | FTPClient.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/FTPClient.cpp b/FTPClient.cpp index ef4db15..d385c43 100644 --- a/FTPClient.cpp +++ b/FTPClient.cpp @@ -155,7 +155,12 @@ void FTPClient::handleFTP() millisBeginTrans = millis(); bytesTransfered = 0; ftpState = cTransfer; - allocateBuffer(TCP_MSS); + if (allocateBuffer() == 0) + { + _serverStatus.code = errorMemory; + _serverStatus.desc = F("No memory for transfer buffer"); + ftpState = cError; + } if (_direction & FTP_PUT_NONBLOCKING) { FTP_DEBUG_MSG(">>> STOR %s", _remoteFileName.c_str()); @@ -208,7 +213,7 @@ int8_t FTPClient::controlConnect() { FTP_DEBUG_MSG("Ignoring CA verification - FTP only"); } - control.connect(_server->servername, _server->port); + control.connect(_server->servername.c_str(), _server->port); FTP_DEBUG_MSG("Connection to %s:%d ... %S", _server->servername.c_str(), _server->port, control.connected() ? PSTR("OK") : PSTR("failed")); if (control.connected()) return 1; |