class BaseLoop: ignore daemon socket commands case insensitive

This commit is contained in:
Roland Jax
2014-04-23 21:49:21 +02:00
parent d38c30339b
commit ec1ce841d0
2 changed files with 7 additions and 8 deletions
+2 -3
View File
@@ -66,7 +66,6 @@ std::string BaseLoop::decodeMessage(const std::string& data)
std::istringstream stream(data);
std::vector<std::string> cmd;
// split stream
while (std::getline(stream, token, ' ') != 0)
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());
// return result
result << command->calcResult(cmd);
result << command->getResult(cmd);
delete command;
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());
// return result
result << command->calcResult(cmd);
result << command->getResult(cmd);
delete command;
} else {
+5 -5
View File
@@ -76,11 +76,11 @@ private:
ClientCommand getCase(const std::string& item)
{
if (item == "get") return get;
if (item == "set") return set;
if (item == "cyc") return cyc;
if (item == "dump") return dump;
if (item == "log") return log;
if (strcasecmp(item.c_str(), "get") == 0) return get;
if (strcasecmp(item.c_str(), "set") == 0) return set;
if (strcasecmp(item.c_str(), "cyc") == 0) return cyc;
if (strcasecmp(item.c_str(), "dump") == 0) return dump;
if (strcasecmp(item.c_str(), "log") == 0) return log;
return notfound;
}