mirror of
https://github.com/php/php-src.git
synced 2025-08-20 17:34:35 +02:00
fix flaky sockets test - form of response is OS dependent
This commit is contained in:
parent
abe38b5e48
commit
c54a247cb0
1 changed files with 23 additions and 30 deletions
|
@ -55,7 +55,28 @@ $data = [
|
||||||
];
|
];
|
||||||
var_dump($data);
|
var_dump($data);
|
||||||
if (!socket_recvmsg($s, $data, 0)) die("recvmsg");
|
if (!socket_recvmsg($s, $data, 0)) die("recvmsg");
|
||||||
print_r($data);
|
|
||||||
|
if ($data["control"]) {
|
||||||
|
$control = $data["control"][0];
|
||||||
|
if ($control["level"] == SOL_SOCKET &&
|
||||||
|
$control["type"] == SCM_RIGHTS) {
|
||||||
|
foreach ($control["data"] as $resource) {
|
||||||
|
if (!is_resource($resource)) {
|
||||||
|
echo "FAIL RES\n";
|
||||||
|
var_dump($data);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
echo "OK";
|
||||||
|
} else {
|
||||||
|
echo "FAIL RIGHTS\n";
|
||||||
|
var_dump($data);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "FAIL CONTROL\n";
|
||||||
|
var_dump($data);
|
||||||
|
}
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
creating send socket
|
creating send socket
|
||||||
resource(%d) of type (Socket)
|
resource(%d) of type (Socket)
|
||||||
|
@ -72,32 +93,4 @@ array(3) {
|
||||||
["controllen"]=>
|
["controllen"]=>
|
||||||
int(%d)
|
int(%d)
|
||||||
}
|
}
|
||||||
Array
|
OK
|
||||||
(
|
|
||||||
[name] =>
|
|
||||||
[control] => Array
|
|
||||||
(
|
|
||||||
[0] => Array
|
|
||||||
(
|
|
||||||
[level] => %d
|
|
||||||
[type] => %d
|
|
||||||
[data] => Array
|
|
||||||
(
|
|
||||||
[0] => Resource id #%d
|
|
||||||
[1] => Resource id #%d
|
|
||||||
[2] => Resource id #%d
|
|
||||||
[3] => Resource id #%d
|
|
||||||
)
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
[iov] => Array
|
|
||||||
(
|
|
||||||
[0] => test thing
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
[flags] => 0
|
|
||||||
)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue