diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-10-11 19:28:50 +0200 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-10-11 19:28:50 +0200 |
commit | 3ea7edf8c9bf7583c426178d4aaff4fb5b736bd2 (patch) | |
tree | ae78ebf9e9d1f70da8a6fdad1504063644ee8f1e /src/operator-idle.cc | |
parent | 1a7c572099edf744d6bb67318cff215de3fcd897 (diff) |
use some enum classes
move ParseResult to recursivedescent.h
Diffstat (limited to 'src/operator-idle.cc')
-rw-r--r-- | src/operator-idle.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/operator-idle.cc b/src/operator-idle.cc index 7c5ce40..3ce9673 100644 --- a/src/operator-idle.cc +++ b/src/operator-idle.cc @@ -57,7 +57,7 @@ const std::string IdleOperator::getName() const return "IDLE"; } -int IdleOperator::getState() const +Session::State IdleOperator::getState() const { return Session::SELECTED; } @@ -120,7 +120,7 @@ Operator::ProcessResult IdleOperator::process(Depot &depot, Request &command) session.setState(Session::LOGOUT); close(newfd); close(curfd); - return NOTHING; + return Operator::ProcessResult::NOTHING; } else #endif if (time(nullptr) > startTime + IDLE_TIMEOUT) @@ -128,7 +128,7 @@ Operator::ProcessResult IdleOperator::process(Depot &depot, Request &command) bincClient << "* BYE Timeout after " << IDLE_TIMEOUT << " seconds of inactivity." << endl; session.setState(Session::LOGOUT); - return NOTHING; + return Operator::ProcessResult::NOTHING; } } @@ -181,7 +181,7 @@ Operator::ProcessResult IdleOperator::process(Depot &depot, Request &command) close(newfd); close(curfd); #endif - return NO; + return Operator::ProcessResult::NO; } #ifdef HAVE_FNOTIFY @@ -211,21 +211,21 @@ Operator::ProcessResult IdleOperator::process(Depot &depot, Request &command) close(newfd); close(curfd); #endif - return OK; + return Operator::ProcessResult::OK; } -Operator::ParseResult IdleOperator::parse(Request &c_in) const +Parser::ParseResult IdleOperator::parse(Request &c_in) { Session &session = Session::getInstance(); - if (c_in.getUidMode()) return REJECT; + if (c_in.getUidMode()) return Parser::ParseResult::REJECT; - Operator::ParseResult res; - if ((res = expectCRLF()) != ACCEPT) { + Parser::ParseResult res; + if ((res = expectCRLF()) != Parser::ParseResult::ACCEPT) { session.setLastError("Expected CRLF after IDLE"); return res; } c_in.setName("IDLE"); - return ACCEPT; + return Parser::ParseResult::ACCEPT; } |