소스 검색

Merge remote-tracking branch 'origin/pr/116' into v0.8

Daniele Alessandri 11 년 전
부모
커밋
04e597ebba
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      lib/Predis/Connection/PhpiredisConnection.php

+ 2 - 2
lib/Predis/Connection/PhpiredisConnection.php

@@ -236,10 +236,10 @@ class PhpiredisConnection extends AbstractConnection
         $host = $parameters->host;
 
         if (ip2long($host) === false) {
-            if (($address = gethostbyname($host)) === $host) {
+            if (($addresses = gethostbynamel($host)) === false) {
                 $this->onConnectionError("Cannot resolve the address of $host");
             }
-            return $address;
+            return $addresses[array_rand($addresses)];
         }
 
         return $host;