Fixing command list delimiter depth.
This commit is contained in:
parent
45aee7ab6f
commit
9af17daed6
@ -11,20 +11,20 @@ namespace core {
|
||||
|
||||
void CommandList::remove(Command &command) {}
|
||||
|
||||
bool CommandList::processRequest(coreutils::ZString &request, TCPSession &session) {
|
||||
int CommandList::processRequest(coreutils::ZString &request, TCPSession &session) {
|
||||
if(session.grab != NULL)
|
||||
return session.grab->processCommand(request, session);
|
||||
else {
|
||||
if(request.equals(""))
|
||||
return false;
|
||||
request.split(delimiter, 10);
|
||||
return 0;
|
||||
request.split(delimiter, depth);
|
||||
request.reset();
|
||||
try {
|
||||
auto command = commands.at(request[0].str());
|
||||
return command->processCommand(request, session);
|
||||
}
|
||||
catch(...) {
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@ -40,12 +40,9 @@ namespace core {
|
||||
}
|
||||
|
||||
int CommandList::processCommand(coreutils::ZString &request, TCPSession &session) {
|
||||
// for(Command *command : commands)
|
||||
// session.out << command->getName() << std::endl;
|
||||
// for(Command *command : commands)
|
||||
// session.out << command->getName() << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@ namespace core {
|
||||
/// then control is given to the process handler holding the grab on the input.
|
||||
///
|
||||
|
||||
bool processRequest(coreutils::ZString &request, TCPSession &session);
|
||||
int processRequest(coreutils::ZString &request, TCPSession &session);
|
||||
|
||||
///
|
||||
/// Use grabInput() within a Command object to force the requesting handler to receive
|
||||
|
@ -1 +0,0 @@
|
||||
0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos: 0.000000| pos:
|
@ -18,7 +18,7 @@ namespace core {
|
||||
|
||||
void TCPSession::protocol(coreutils::ZString &data) {
|
||||
if(data.getLength() != 0) {
|
||||
if(!server.commands.processRequest(data, *this)) {
|
||||
if(server.commands.processRequest(data, *this) == 0) {
|
||||
coreutils::Log(coreutils::LOG_DEBUG_1) << "Received data could not be parsed: " << data.str();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user