From 13e6c2aa41f696f39f3754e5737ca77c510a0f7e Mon Sep 17 00:00:00 2001 From: Pavel Chebotarev Date: Sat, 27 Jan 2018 18:53:16 +0300 Subject: [PATCH] Fix incorrect return value in TCPConnection.leastSize() --- source/vibe/core/net.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/vibe/core/net.d b/source/vibe/core/net.d index 1bef7d7..7c5c56e 100644 --- a/source/vibe/core/net.d +++ b/source/vibe/core/net.d @@ -535,7 +535,7 @@ struct TCPConnection { return s >= ConnectionState.connected && s < ConnectionState.activeClose; } @property bool empty() { return leastSize == 0; } - @property ulong leastSize() { waitForData(); return m_context && m_context.readBuffer.length; } + @property ulong leastSize() { waitForData(); return m_context ? m_context.readBuffer.length : 0; } @property bool dataAvailableForRead() { return waitForData(0.seconds); } void close()