From 78b257612a7e014e9ddbf451ad9652e05efbadc2 Mon Sep 17 00:00:00 2001 From: Michael Theall Date: Wed, 18 Nov 2020 13:27:52 +0100 Subject: [PATCH] Remove redundant state change in PWD --- source/ftpSession.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/source/ftpSession.cpp b/source/ftpSession.cpp index c05f0aa..5ea27ee 100644 --- a/source/ftpSession.cpp +++ b/source/ftpSession.cpp @@ -2340,16 +2340,10 @@ void FtpSession::PORT (char const *args_) void FtpSession::PWD (char const *args_) { - // handle keep-alive - if (m_state == State::COMMAND) + if (!authorized ()) { - setState (State::COMMAND, false, false); - - if (!authorized ()) - { - sendResponse ("530 Not logged in\r\n"); - return; - } + sendResponse ("530 Not logged in\r\n"); + return; } auto const path = encodePath (m_cwd);