diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/Response.cxx | 3 | ||||
-rw-r--r-- | src/client/Response.hxx | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/client/Response.cxx b/src/client/Response.cxx index 9af3c74ed..d443e66a5 100644 --- a/src/client/Response.cxx +++ b/src/client/Response.cxx @@ -20,7 +20,6 @@ #include "config.h" #include "Response.hxx" #include "Client.hxx" -#include "protocol/Result.hxx" #include "util/FormatString.hxx" #include <string.h> @@ -66,7 +65,7 @@ void Response::FormatError(enum ack code, const char *fmt, ...) { Format("ACK [%i@%u] {%s} ", - (int)code, list_index, current_command); + (int)code, list_index, command); va_list args; va_start(args, fmt); diff --git a/src/client/Response.hxx b/src/client/Response.hxx index 044bdf307..5841e7f61 100644 --- a/src/client/Response.hxx +++ b/src/client/Response.hxx @@ -37,13 +37,22 @@ class Response { */ const unsigned list_index; + /** + * This command's name. Used to generate error messages. + */ + const char *command; + public: Response(Client &_client, unsigned _list_index) - :client(_client), list_index(_list_index) {} + :client(_client), list_index(_list_index), command("") {} Response(const Response &) = delete; Response &operator=(const Response &) = delete; + void SetCommand(const char *_command) { + command = _command; + } + bool Write(const void *data, size_t length); bool Write(const char *data); bool FormatV(const char *fmt, va_list args); |