Skip to content

Commit

Permalink
fix pubsub case (OpenAtomFoundation#738)
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghenshui authored and Axlgrep committed Aug 31, 2019
1 parent 4a73f12 commit 7fae751
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pika_pubsub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void PubSubCmd::DoInitial() {
}

void PubSubCmd::Do(std::shared_ptr<Partition> partition) {
if (subcommand_ == "channels") {
if (!strcasecmp(subcommand_.data(), "channels")) {
std::string pattern = "";
std::vector<std::string > result;
if (arguments_.size() == 1) {
Expand All @@ -97,7 +97,7 @@ void PubSubCmd::Do(std::shared_ptr<Partition> partition) {
res_.AppendStringLen((*it).length());
res_.AppendContent(*it);
}
} else if (subcommand_ == "numsub") {
} else if (!strcasecmp(subcommand_.data(), "numsub")) {
std::vector<std::pair<std::string, int>> result;
g_pika_server->PubSubNumSub(arguments_, &result);
res_.AppendArrayLen(result.size() * 2);
Expand All @@ -107,7 +107,7 @@ void PubSubCmd::Do(std::shared_ptr<Partition> partition) {
res_.AppendInteger(it->second);
}
return;
} else if (subcommand_ == "numpat") {
} else if (!strcasecmp(subcommand_.data(), "numpat")) {
int subscribed = g_pika_server->PubSubNumPat();
res_.AppendInteger(subscribed);
}
Expand Down

0 comments on commit 7fae751

Please sign in to comment.