From 1f523be72decf652dfe64ac6885770d8e86de0c7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 15 Dec 2013 22:39:30 +0100 Subject: util/PeakBuffer: return ConstBuffer --- src/event/FullyBufferedSocket.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/event') diff --git a/src/event/FullyBufferedSocket.cxx b/src/event/FullyBufferedSocket.cxx index 87d29296e..9bb82a600 100644 --- a/src/event/FullyBufferedSocket.cxx +++ b/src/event/FullyBufferedSocket.cxx @@ -60,15 +60,14 @@ FullyBufferedSocket::Flush() { assert(IsDefined()); - size_t length; - const void *data = output.Read(&length); - if (data == nullptr) { + const auto data = output.Read(); + if (data.IsNull()) { IdleMonitor::Cancel(); CancelWrite(); return true; } - auto nbytes = DirectWrite(data, length); + auto nbytes = DirectWrite(data.data, data.size); if (gcc_unlikely(nbytes <= 0)) return nbytes == 0; -- cgit v1.2.3