From 16b260e3718d4ac9475383ba5582cd8c3a3a8643 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 3 Feb 2017 20:46:53 +0100 Subject: Client: eliminate client_puts(), use Client::Write() instead --- src/client/Client.hxx | 5 ----- src/client/ClientIdle.cxx | 2 +- src/client/ClientProcess.cxx | 2 +- src/client/ClientWrite.cxx | 6 ------ src/protocol/Result.cxx | 2 +- 5 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/client/Client.hxx b/src/client/Client.hxx index 960984296..d1b0d1752 100644 --- a/src/client/Client.hxx +++ b/src/client/Client.hxx @@ -214,11 +214,6 @@ void client_new(EventLoop &loop, Partition &partition, int fd, SocketAddress address, int uid); -/** - * Write a C string to the client. - */ -void client_puts(Client &client, const char *s); - /** * Write a printf-like formatted string to the client. */ diff --git a/src/client/ClientIdle.cxx b/src/client/ClientIdle.cxx index ca562233f..2791bb9a4 100644 --- a/src/client/ClientIdle.cxx +++ b/src/client/ClientIdle.cxx @@ -40,7 +40,7 @@ Client::IdleNotify() idle_names[i]); } - client_puts(*this, "OK\n"); + Write("OK\n"); TimeoutMonitor::Schedule(client_timeout); } diff --git a/src/client/ClientProcess.cxx b/src/client/ClientProcess.cxx index 4d0efbf73..b5591cd1b 100644 --- a/src/client/ClientProcess.cxx +++ b/src/client/ClientProcess.cxx @@ -44,7 +44,7 @@ client_process_command_list(Client &client, bool list_ok, if (ret != CommandResult::OK || client.IsExpired()) break; else if (list_ok) - client_puts(client, "list_OK\n"); + client.Write("list_OK\n"); } return ret; diff --git a/src/client/ClientWrite.cxx b/src/client/ClientWrite.cxx index 965d70bd6..963c4d40a 100644 --- a/src/client/ClientWrite.cxx +++ b/src/client/ClientWrite.cxx @@ -37,12 +37,6 @@ Client::Write(const char *data) return Write(data, strlen(data)); } -void -client_puts(Client &client, const char *s) -{ - client.Write(s); -} - void client_vprintf(Client &client, const char *fmt, va_list args) { diff --git a/src/protocol/Result.cxx b/src/protocol/Result.cxx index b58fcaea0..f43a3f156 100644 --- a/src/protocol/Result.cxx +++ b/src/protocol/Result.cxx @@ -24,5 +24,5 @@ void command_success(Client &client) { - client_puts(client, "OK\n"); + client.Write("OK\n"); } -- cgit v1.2.3