浏览代码

Use a faster method to detect errors when reading a line from the server.

Daniele Alessandri 14 年之前
父节点
当前提交
4b1302a93a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/Predis.php

+ 1 - 1
lib/Predis.php

@@ -1407,7 +1407,7 @@ class Connection implements IConnection {
         $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;