mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
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.
This commit is contained in:
parent
25bdf9d3e0
commit
b69a98cfb3
1 changed files with 5 additions and 5 deletions
|
@ -10,12 +10,14 @@ if (!extension_loaded('sockets')) {
|
|||
$addrinfo = socket_addrinfo_lookup('127.0.0.1', 2000, array(
|
||||
'ai_family' => AF_INET,
|
||||
'ai_socktype' => SOCK_DGRAM,
|
||||
'ai_flags' => AI_CANONNAME,
|
||||
));
|
||||
var_dump(socket_addrinfo_explain($addrinfo[0]));
|
||||
$result = socket_addrinfo_explain($addrinfo[0]);
|
||||
// Musl sets ai_canonname even if AI_CANONNAME is not specified.
|
||||
unset($result['ai_canonname']);
|
||||
var_dump($result);
|
||||
echo "Done";
|
||||
--EXPECTF--
|
||||
array(6) {
|
||||
array(5) {
|
||||
["ai_flags"]=>
|
||||
int(%d)
|
||||
["ai_family"]=>
|
||||
|
@ -24,8 +26,6 @@ array(6) {
|
|||
int(2)
|
||||
["ai_protocol"]=>
|
||||
int(%d)
|
||||
["ai_canonname"]=>
|
||||
string(9) "127.0.0.1"
|
||||
["ai_addr"]=>
|
||||
array(2) {
|
||||
["sin_port"]=>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue