aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/ClientWrite.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/ClientWrite.cxx')
-rw-r--r--src/client/ClientWrite.cxx20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/client/ClientWrite.cxx b/src/client/ClientWrite.cxx
index b5d172a8d..f30f2f8b3 100644
--- a/src/client/ClientWrite.cxx
+++ b/src/client/ClientWrite.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -18,35 +18,29 @@
*/
#include "config.h"
-#include "ClientInternal.hxx"
+#include "Client.hxx"
#include "util/FormatString.hxx"
#include <string.h>
-/**
- * Write a block of data to the client.
- */
-static void
-client_write(Client &client, const char *data, size_t length)
+bool
+Client::Write(const void *data, size_t length)
{
/* if the client is going to be closed, do nothing */
- if (client.IsExpired() || length == 0)
- return;
-
- client.Write(data, length);
+ return !IsExpired() && FullyBufferedSocket::Write(data, length);
}
void
client_puts(Client &client, const char *s)
{
- client_write(client, s, strlen(s));
+ client.Write(s, strlen(s));
}
void
client_vprintf(Client &client, const char *fmt, va_list args)
{
char *p = FormatNewV(fmt, args);
- client_write(client, p, strlen(p));
+ client.Write(p, strlen(p));
delete[] p;
}