From 86e036c3933def22b6ff0eae5bcf9cd7103240e7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 13 Aug 2015 12:48:31 +0200 Subject: command: pass Response object to command callbacks --- src/command/FileCommands.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/command/FileCommands.cxx') diff --git a/src/command/FileCommands.cxx b/src/command/FileCommands.cxx index c30dad8c8..73b9b3dbe 100644 --- a/src/command/FileCommands.cxx +++ b/src/command/FileCommands.cxx @@ -70,10 +70,9 @@ skip_path(Path name_fs) #endif CommandResult -handle_listfiles_local(Client &client, const char *path_utf8) +handle_listfiles_local(Client &client, Response &r, + const char *path_utf8) { - Response r(client); - const auto path_fs = AllocatedPath::FromUTF8(path_utf8); if (path_fs.IsNull()) { r.Error(ACK_ERROR_NO_EXIST, "unsupported file name"); @@ -214,10 +213,8 @@ translate_uri(const char *uri) } CommandResult -handle_read_comments(Client &client, Request args) +handle_read_comments(Client &client, Request args, Response &r) { - Response r(client); - assert(args.size == 1); const char *const uri = translate_uri(args.front()); -- cgit v1.2.3