mirror of
https://github.com/php/php-src.git
synced 2024-11-28 12:26:37 +08:00
commit
669459da8c
20
ext/standard/tests/network/bug64330.phpt
Normal file
20
ext/standard/tests/network/bug64330.phpt
Normal file
@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #64330 (stream_socket_server() creates wrong Abstract Namespace UNIX sockets)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!in_array("unix", stream_get_transports())) die("SKIP unix domain sockets unavailable");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Test\n";
|
||||
$server = stream_socket_server("unix://\x00/MyBindName");
|
||||
$client = stream_socket_client("unix://\x00/MyBindName");
|
||||
if ($client) {
|
||||
echo "ok\n";
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
Test
|
||||
ok
|
||||
===DONE===
|
@ -588,7 +588,8 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *
|
||||
|
||||
parse_unix_address(xparam, &unix_addr TSRMLS_CC);
|
||||
|
||||
return bind(sock->socket, (struct sockaddr *)&unix_addr, sizeof(unix_addr));
|
||||
return bind(sock->socket, (const struct sockaddr *)&unix_addr,
|
||||
(socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + xparam->inputs.namelen);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user