From 2b809325e09d09821ea2bb623019e72e12f35514 Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Tue, 4 Jan 2011 11:08:55 +0100 Subject: [PATCH] Use a faster method to detect errors when reading a line from the server. --- lib/Predis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Predis.php b/lib/Predis.php index e3c47365..8ef0dc61 100644 --- a/lib/Predis.php +++ b/lib/Predis.php @@ -1449,7 +1449,7 @@ class TcpConnection extends Connection implements IConnectionSingle { $value = ''; do { $chunk = fgets($socket); - if ($chunk === false || strlen($chunk) == 0) { + if ($chunk === false || $chunk === '') { $this->onCommunicationException('Error while reading line from the server'); } $value .= $chunk;