Skip to content

Commit 741daa8

Browse files
committed
Set AI_CANONNAME flag in socket_addrinfo test
Musl always populates ai_canonname. Set the flag to avoid output discrepancies.
1 parent 58ab491 commit 741daa8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/sockets/tests/socket_addrinfo_explain.phpt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ if (!extension_loaded('sockets')) {
1010
$addrinfo = socket_addrinfo_lookup('127.0.0.1', 2000, array(
1111
'ai_family' => AF_INET,
1212
'ai_socktype' => SOCK_DGRAM,
13+
'ai_flags' => AI_CANONNAME,
1314
));
1415
var_dump(socket_addrinfo_explain($addrinfo[0]));
1516
echo "Done";
1617
--EXPECTF--
17-
array(5) {
18+
array(6) {
1819
["ai_flags"]=>
1920
int(%d)
2021
["ai_family"]=>
@@ -23,6 +24,8 @@ array(5) {
2324
int(2)
2425
["ai_protocol"]=>
2526
int(%d)
27+
["ai_canonname"]=>
28+
string(9) "127.0.0.1"
2629
["ai_addr"]=>
2730
array(2) {
2831
["sin_port"]=>

0 commit comments

Comments
 (0)