Do not perform useless read operations in the bulk reply handler.

This commit is contained in:
Daniele Alessandri
2011-01-13 00:17:03 +01:00
parent a605190354
commit 40dfabb139
+1 -7
View File
@@ -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;