Skip to content

Commit

Permalink
modify return value format of client list (OpenAtomFoundation#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
shangyukang authored and Axlgrep committed Dec 18, 2018
1 parent dc4885c commit cf0490b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pika_admin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,14 @@ void ClientCmd::Do() {
std::vector<ClientInfo> clients;
g_pika_server->ClientList(&clients);
std::vector<ClientInfo>::iterator iter= clients.begin();
std::string reply = "+";
std::string reply = "";
char buf[128];
while (iter != clients.end()) {
snprintf(buf, sizeof(buf), "addr=%s fd=%d idle=%ld\n", iter->ip_port.c_str(), iter->fd, iter->last_interaction == 0 ? 0 : now.tv_sec - iter->last_interaction);
reply.append(buf);
iter++;
}
res_.AppendContent(reply);
res_.AppendString(reply);
} else if (operation_ == CLIENT_KILL_S && ip_port_ == "all") {
g_pika_server->ClientKillAll();
res_.SetRes(CmdRes::kOk);
Expand Down

0 comments on commit cf0490b

Please sign in to comment.