mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Allow fpm tests to be run with long socket path
Socket path is restricted to ~100 bytes, so we can use the system temp dir if the path ends up too long.
This commit is contained in:
parent
71e1d37938
commit
af337ae47e
@ -856,7 +856,17 @@ class Tester
|
||||
{
|
||||
$port = $this->getPort($type, $pool, true);
|
||||
if ($type === 'uds') {
|
||||
return $this->getFile($port . '.sock');
|
||||
$address = $this->getFile($port . '.sock');
|
||||
|
||||
// Socket max path length is 108 on Linux and 104 on BSD,
|
||||
// so we use the latter
|
||||
if (strlen($address) <= 104) {
|
||||
return $address;
|
||||
}
|
||||
|
||||
return sys_get_temp_dir().'/'.
|
||||
hash('crc32', dirname($address)).'-'.
|
||||
basename($address);
|
||||
}
|
||||
|
||||
return $this->getHost($type) . ':' . $port;
|
||||
|
Loading…
Reference in New Issue
Block a user