mirror of
https://github.com/predis/predis.git
synced 2026-08-31 12:43:31 +00:00
Merge remote-tracking branch 'origin/pr/116' into v0.8
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user