Skip to content

Commit b69a98c

Browse files
committed
Unset ai_canonname field in dump
Okay, looks like ai_canonname does not get set on macos even if AI_CANONNAME is specified, so canonicalize this in the other direction instead and unset ai_canonname if it is present.
1 parent 25bdf9d commit b69a98c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ext/sockets/tests/socket_addrinfo_explain.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ 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,
1413
));
15-
var_dump(socket_addrinfo_explain($addrinfo[0]));
14+
$result = socket_addrinfo_explain($addrinfo[0]);
15+
// Musl sets ai_canonname even if AI_CANONNAME is not specified.
16+
unset($result['ai_canonname']);
17+
var_dump($result);
1618
echo "Done";
1719
--EXPECTF--
18-
array(6) {
20+
array(5) {
1921
["ai_flags"]=>
2022
int(%d)
2123
["ai_family"]=>
@@ -24,8 +26,6 @@ array(6) {
2426
int(2)
2527
["ai_protocol"]=>
2628
int(%d)
27-
["ai_canonname"]=>
28-
string(9) "127.0.0.1"
2929
["ai_addr"]=>
3030
array(2) {
3131
["sin_port"]=>

0 commit comments

Comments
 (0)