Whe we use this constructor
FTPClientSession::FTPClientSession(const StreamSocket& socket,
bool readWelcomeMessage,
Poco::UInt16 activeDataPort):
_pControlSocket(new DialogSocket(socket)),
_pDataStream(nullptr),
_host(socket.address().host().toString()),
_port(socket.address().port()),
_activeDataPort(activeDataPort),
_passiveMode(true),
_fileType(TYPE_BINARY),
_supports1738(true),
_serverReady(false),
_isLoggedIn(false),
_timeout(DEFAULT_TIMEOUT)
{
_pControlSocket->setReceiveTimeout(_timeout);
if (readWelcomeMessage)
{
receiveServerReadyReply();
}
else
{
_serverReady = true;
}
}
using readWelcomeMessage = false;
we end up setting _serverReady = true without actually read server reply. This cause next receiveServerReadyReply return without reading, I think is wrong here to set _serverReady = true
The only reason to put _serverReady = true is if you think that the message is already read outside the function
Whe we use this constructor
using
readWelcomeMessage = false;we end up setting
_serverReady = truewithout actually read server reply. This cause next receiveServerReadyReply return without reading, I think is wrong here to set_serverReady = trueThe only reason to put
_serverReady = trueis if you think that the message is already read outside the function