From d053797340ae16b16186fe31d60bb12979ba9b81 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Aug 2015 19:00:02 +0200 Subject: protocol/Result: move command_list_num to class Response --- src/client/Response.cxx | 4 ++-- src/client/Response.hxx | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src/client') diff --git a/src/client/Response.cxx b/src/client/Response.cxx index c7b25e84c..9af3c74ed 100644 --- a/src/client/Response.cxx +++ b/src/client/Response.cxx @@ -65,8 +65,8 @@ Response::Error(enum ack code, const char *msg) void Response::FormatError(enum ack code, const char *fmt, ...) { - Format("ACK [%i@%i] {%s} ", - (int)code, command_list_num, current_command); + Format("ACK [%i@%u] {%s} ", + (int)code, list_index, current_command); va_list args; va_start(args, fmt); diff --git a/src/client/Response.hxx b/src/client/Response.hxx index ba53298c8..044bdf307 100644 --- a/src/client/Response.hxx +++ b/src/client/Response.hxx @@ -31,8 +31,15 @@ class Client; class Response { Client &client; + /** + * This command's index in the command list. Used to generate + * error messages. + */ + const unsigned list_index; + public: - explicit Response(Client &_client):client(_client) {} + Response(Client &_client, unsigned _list_index) + :client(_client), list_index(_list_index) {} Response(const Response &) = delete; Response &operator=(const Response &) = delete; -- cgit v1.2.3