command: pass Response object to command callbacks

This commit is contained in:
Max Kellermann
2015-08-13 12:48:31 +02:00
parent 7652a2986b
commit 86e036c393
25 changed files with 246 additions and 395 deletions

View File

@@ -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());