util/PeakBuffer: return ConstBuffer<void>

This commit is contained in:
Max Kellermann
2013-12-15 22:39:30 +01:00
parent f2a20a0a80
commit 1f523be72d
3 changed files with 16 additions and 11 deletions

View File

@@ -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;