Size must be greater then max output buffer
This commit is contained in:
@ -190,12 +190,18 @@ abstract class Connection
|
|||||||
throw new ConnectionFail('Probably connection lost');
|
throw new ConnectionFail('Probably connection lost');
|
||||||
}
|
}
|
||||||
|
|
||||||
$buffer = new ByteBuffer(
|
$buffer = new ByteBuffer();
|
||||||
$socket->read(
|
|
||||||
// @phpstan-ignore-next-line
|
/** @phpstan-ignore-next-line */
|
||||||
unpack('N', $size)[1]
|
$size = unpack('N', $size)[1];
|
||||||
)
|
|
||||||
);
|
do {
|
||||||
|
$chunk = $socket->read($size);
|
||||||
|
|
||||||
|
$buffer->append($chunk);
|
||||||
|
|
||||||
|
$size -= \strlen($chunk);
|
||||||
|
} while (0 < $size);
|
||||||
|
|
||||||
$this->logger->debug('Received buffer: '.addcslashes($buffer->bytes(), PHP_EOL));
|
$this->logger->debug('Received buffer: '.addcslashes($buffer->bytes(), PHP_EOL));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user