class BaseLoop: ignore daemon socket commands case insensitive
This commit is contained in:
+2
-3
@@ -66,7 +66,6 @@ std::string BaseLoop::decodeMessage(const std::string& data)
|
|||||||
std::istringstream stream(data);
|
std::istringstream stream(data);
|
||||||
std::vector<std::string> cmd;
|
std::vector<std::string> cmd;
|
||||||
|
|
||||||
// split stream
|
|
||||||
while (std::getline(stream, token, ' ') != 0)
|
while (std::getline(stream, token, ' ') != 0)
|
||||||
cmd.push_back(token);
|
cmd.push_back(token);
|
||||||
|
|
||||||
@@ -103,7 +102,7 @@ std::string BaseLoop::decodeMessage(const std::string& data)
|
|||||||
Command* command = new Command(index, (*m_commands)[index], busCommand->getResult().c_str());
|
Command* command = new Command(index, (*m_commands)[index], busCommand->getResult().c_str());
|
||||||
|
|
||||||
// return result
|
// return result
|
||||||
result << command->calcResult(cmd);
|
result << command->getResult(cmd);
|
||||||
|
|
||||||
delete command;
|
delete command;
|
||||||
delete busCommand;
|
delete busCommand;
|
||||||
@@ -130,7 +129,7 @@ std::string BaseLoop::decodeMessage(const std::string& data)
|
|||||||
Command* command = new Command(index, (*m_commands)[index], cycdata.c_str());
|
Command* command = new Command(index, (*m_commands)[index], cycdata.c_str());
|
||||||
|
|
||||||
// return result
|
// return result
|
||||||
result << command->calcResult(cmd);
|
result << command->getResult(cmd);
|
||||||
|
|
||||||
delete command;
|
delete command;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+5
-5
@@ -76,11 +76,11 @@ private:
|
|||||||
|
|
||||||
ClientCommand getCase(const std::string& item)
|
ClientCommand getCase(const std::string& item)
|
||||||
{
|
{
|
||||||
if (item == "get") return get;
|
if (strcasecmp(item.c_str(), "get") == 0) return get;
|
||||||
if (item == "set") return set;
|
if (strcasecmp(item.c_str(), "set") == 0) return set;
|
||||||
if (item == "cyc") return cyc;
|
if (strcasecmp(item.c_str(), "cyc") == 0) return cyc;
|
||||||
if (item == "dump") return dump;
|
if (strcasecmp(item.c_str(), "dump") == 0) return dump;
|
||||||
if (item == "log") return log;
|
if (strcasecmp(item.c_str(), "log") == 0) return log;
|
||||||
|
|
||||||
return notfound;
|
return notfound;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user