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) {}
|
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)
|
if(session.grab != NULL)
|
||||||
return session.grab->processCommand(request, session);
|
return session.grab->processCommand(request, session);
|
||||||
else {
|
else {
|
||||||
if(request.equals(""))
|
if(request.equals(""))
|
||||||
return false;
|
return 0;
|
||||||
request.split(delimiter, 10);
|
request.split(delimiter, depth);
|
||||||
request.reset();
|
request.reset();
|
||||||
try {
|
try {
|
||||||
auto command = commands.at(request[0].str());
|
auto command = commands.at(request[0].str());
|
||||||
return command->processCommand(request, session);
|
return command->processCommand(request, session);
|
||||||
}
|
}
|
||||||
catch(...) {
|
catch(...) {
|
||||||
return false;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -46,6 +46,3 @@ namespace core {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ namespace core {
|
|||||||
/// then control is given to the process handler holding the grab on the input.
|
/// 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
|
/// 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) {
|
void TCPSession::protocol(coreutils::ZString &data) {
|
||||||
if(data.getLength() != 0) {
|
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();
|
coreutils::Log(coreutils::LOG_DEBUG_1) << "Received data could not be parsed: " << data.str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user