diff options
author | Max Kellermann <max@duempel.org> | 2015-08-06 22:10:25 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-08-12 08:41:05 +0200 |
commit | 7652a2986b0d0ad55b2776685130f1c68d7108c7 (patch) | |
tree | b4d45e60e97757454f1ff8e4dc793a1e7d852c36 /src/command/NeighborCommands.cxx | |
parent | b1480167be487d09ff46bb86ad02041fb28acff1 (diff) | |
download | mpd-7652a2986b0d0ad55b2776685130f1c68d7108c7.tar.gz mpd-7652a2986b0d0ad55b2776685130f1c68d7108c7.tar.xz mpd-7652a2986b0d0ad55b2776685130f1c68d7108c7.zip |
client/Response: new Client wrapper class for writing responses
Diffstat (limited to 'src/command/NeighborCommands.cxx')
-rw-r--r-- | src/command/NeighborCommands.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/command/NeighborCommands.cxx b/src/command/NeighborCommands.cxx index 10dbe3074..d1b2ec7c7 100644 --- a/src/command/NeighborCommands.cxx +++ b/src/command/NeighborCommands.cxx @@ -21,9 +21,9 @@ #include "NeighborCommands.hxx" #include "Request.hxx" #include "client/Client.hxx" +#include "client/Response.hxx" #include "Instance.hxx" #include "Partition.hxx" -#include "protocol/Result.hxx" #include "neighbor/Glue.hxx" #include "neighbor/Info.hxx" #include "util/ConstBuffer.hxx" @@ -42,19 +42,19 @@ neighbor_commands_available(const Instance &instance) CommandResult handle_listneighbors(Client &client, gcc_unused Request args) { + Response r(client); + const NeighborGlue *const neighbors = client.partition.instance.neighbors; if (neighbors == nullptr) { - command_error(client, ACK_ERROR_UNKNOWN, - "No neighbor plugin configured"); + r.Error(ACK_ERROR_UNKNOWN, "No neighbor plugin configured"); return CommandResult::ERROR; } for (const auto &i : neighbors->GetList()) - client_printf(client, - "neighbor: %s\n" - "name: %s\n", - i.uri.c_str(), - i.display_name.c_str()); + r.Format("neighbor: %s\n" + "name: %s\n", + i.uri.c_str(), + i.display_name.c_str()); return CommandResult::OK; } |