Using new command error system
This commit is contained in:
@@ -232,11 +232,11 @@ bool WebClient::closeConnection(const std::chrono::system_clock::time_point& tim
|
||||
return true;
|
||||
}
|
||||
|
||||
CommandResult WebClient::handleCommand(Command &command) {
|
||||
command_result WebClient::handleCommand(Command &command) {
|
||||
if(this->connectionState() == ConnectionState::INIT_HIGH && this->handshake.state == HandshakeState::SUCCEEDED){
|
||||
if(command.command() == "clientinit") {
|
||||
auto result = this->handleCommandClientInit(command);
|
||||
if(!result)
|
||||
if(result.error_code())
|
||||
this->closeConnection(system_clock::now() + seconds(1));
|
||||
return result;
|
||||
}
|
||||
@@ -624,7 +624,7 @@ bool WebClient::disconnect(const std::string &reason) {
|
||||
return this->closeConnection(system_clock::now() + seconds(1));
|
||||
}
|
||||
|
||||
CommandResult WebClient::handleCommandClientInit(Command &command) {
|
||||
command_result WebClient::handleCommandClientInit(Command &command) {
|
||||
return SpeakingClient::handleCommandClientInit(command);
|
||||
}
|
||||
|
||||
|
||||
@@ -109,8 +109,8 @@ namespace ts {
|
||||
|
||||
protected:
|
||||
|
||||
CommandResult handleCommand(Command &command) override;
|
||||
CommandResult handleCommandClientInit(Command &command) override;
|
||||
command_result handleCommand(Command &command) override;
|
||||
command_result handleCommandClientInit(Command &command) override;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user