forked from qt-creator/qt-creator
CmbIpc: Call bytesAvailable after every manipulation
The saved bytesAvailable value has hidden the block size bug. Change-Id: I751d6e11194a91c839be3dcf678e5fe4cc3f75b3 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
committed by
Nikolai Kosjar
parent
e2d60fdcc3
commit
264132da27
@@ -95,15 +95,13 @@ void ReadCommandBlock::resetCounter()
|
||||
|
||||
bool ReadCommandBlock::isTheWholeCommandReadable(QDataStream &in)
|
||||
{
|
||||
const qint64 bytesAvailable = ioDevice->bytesAvailable();
|
||||
|
||||
if (bytesAvailable == 0)
|
||||
if (ioDevice->bytesAvailable() == 0)
|
||||
return false;
|
||||
|
||||
if (blockSize == 0)
|
||||
in >> blockSize;
|
||||
|
||||
if (bytesAvailable < blockSize)
|
||||
if (ioDevice->bytesAvailable() < blockSize)
|
||||
return false;
|
||||
|
||||
blockSize = 0;
|
||||
|
||||
Reference in New Issue
Block a user