summaryrefslogtreecommitdiff
path: root/src/operator-authenticate.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/operator-authenticate.cc')
-rw-r--r--src/operator-authenticate.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/operator-authenticate.cc b/src/operator-authenticate.cc
index 045b008..8689b2c 100644
--- a/src/operator-authenticate.cc
+++ b/src/operator-authenticate.cc
@@ -22,6 +22,10 @@
using namespace Binc;
using std::endl;
using std::string;
+constexpr auto BAD = Operator::ProcessResult::BAD;
+constexpr auto NO = Operator::ProcessResult::NO;
+constexpr auto OK = Operator::ProcessResult::OK;
+constexpr auto NOTHING = Operator::ProcessResult::NOTHING;
AuthenticateOperator::AuthenticateOperator() {}
@@ -32,7 +36,7 @@ const string AuthenticateOperator::getName() const
return "AUTHENTICATE";
}
-int AuthenticateOperator::getState() const
+Session::State AuthenticateOperator::getState() const
{
return Session::NONAUTHENTICATED;
}
@@ -276,13 +280,15 @@ Operator::ProcessResult AuthenticateOperator::process(Depot &depot, Request &com
return NOTHING;
}
-Operator::ParseResult AuthenticateOperator::parse(Request &c_in) const
+Parser::ParseResult AuthenticateOperator::parse(Request &c_in)
{
+ constexpr auto ACCEPT = Parser::ParseResult::ACCEPT;
+
Session &session = Session::getInstance();
- if (c_in.getUidMode()) return REJECT;
+ if (c_in.getUidMode()) return Parser::ParseResult::REJECT;
- Operator::ParseResult res;
+ Parser::ParseResult res;
if ((res = expectSPACE()) != ACCEPT) {
session.setLastError("Expected single SPACE after AUTHENTICATE");
@@ -292,7 +298,7 @@ Operator::ParseResult AuthenticateOperator::parse(Request &c_in) const
string authtype;
if ((res = expectAtom(authtype)) != ACCEPT) {
session.setLastError("Expected auth_type after AUTHENTICATE SPACE");
- return ERROR;
+ return Parser::ParseResult::ERROR;
}
if ((res = expectCRLF()) != ACCEPT) {