diff options
Diffstat (limited to '')
-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; |