Skip to content

Commit af337ae

Browse files
committed
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.
1 parent 71e1d37 commit af337ae

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

sapi/fpm/tests/tester.inc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,17 @@ class Tester
856856
{
857857
$port = $this->getPort($type, $pool, true);
858858
if ($type === 'uds') {
859-
return $this->getFile($port . '.sock');
859+
$address = $this->getFile($port . '.sock');
860+
861+
// Socket max path length is 108 on Linux and 104 on BSD,
862+
// so we use the latter
863+
if (strlen($address) <= 104) {
864+
return $address;
865+
}
866+
867+
return sys_get_temp_dir().'/'.
868+
hash('crc32', dirname($address)).'-'.
869+
basename($address);
860870
}
861871

862872
return $this->getHost($type) . ':' . $port;

0 commit comments

Comments
 (0)