diff options
author | Max Kellermann <max@duempel.org> | 2013-12-15 22:39:30 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-12-15 23:07:08 +0100 |
commit | 1f523be72decf652dfe64ac6885770d8e86de0c7 (patch) | |
tree | 530d9367773757f1f3b826a7afd1d4daa5ffd9b6 /src/event | |
parent | f2a20a0a800e879b0e52681b7f9b8829047c55a7 (diff) | |
download | mpd-1f523be72decf652dfe64ac6885770d8e86de0c7.tar.gz mpd-1f523be72decf652dfe64ac6885770d8e86de0c7.tar.xz mpd-1f523be72decf652dfe64ac6885770d8e86de0c7.zip |
util/PeakBuffer: return ConstBuffer<void>
Diffstat (limited to 'src/event')
-rw-r--r-- | src/event/FullyBufferedSocket.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
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; |