Merge pull request #52 from nexor/tcpconnection_leastsize

Fix incorrect return value in TCPConnection.leastSize()
This commit is contained in:
Sönke Ludwig 2018-02-14 13:07:12 +01:00 committed by GitHub
commit 34cd10b57d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()