mirror of
https://github.com/predis/predis.git
synced 2026-09-02 13:49:32 +00:00
Do not perform useless read operations in the bulk reply handler.
This commit is contained in:
+1
-7
@@ -581,13 +581,7 @@ class ResponseBulkHandler implements IResponseHandler {
|
||||
|
||||
$dataLength = (int) $dataLength;
|
||||
if ($dataLength >= 0) {
|
||||
$value = $dataLength > 0 ? $connection->readBytes($dataLength) : '';
|
||||
if ($connection->readBytes(2) !== Protocol::NEWLINE) {
|
||||
Shared\Utils::onCommunicationException(new MalformedServerResponse(
|
||||
$connection, 'Did not receive a new-line at the end of a bulk response'
|
||||
));
|
||||
}
|
||||
return $value;
|
||||
return $dataLength > 0 ? substr($connection->readBytes($dataLength + 2), 0, -2) : '';
|
||||
}
|
||||
if ($dataLength == -1) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user