diff options
Diffstat (limited to 'ext/sockets/tests')
| -rw-r--r-- | ext/sockets/tests/bug51958.phpt | 22 | ||||
| -rw-r--r-- | ext/sockets/tests/socket_strerror.phpt | 2 |
2 files changed, 23 insertions, 1 deletions
diff --git a/ext/sockets/tests/bug51958.phpt b/ext/sockets/tests/bug51958.phpt new file mode 100644 index 000000000..afccd6ce2 --- /dev/null +++ b/ext/sockets/tests/bug51958.phpt @@ -0,0 +1,22 @@ +--TEST--
+Bug #51958: socket_accept() fails on IPv6 server sockets
+--SKIPIF--
+<?php
+if (!extension_loaded('sockets')) {
+ die('skip sockets extension not available.');
+}
+if (!defined('IPPROTO_IPV6')) {
+ die('skip IPv6 not available.');
+}
+if (PHP_OS != "WINNT")
+ die('skip test relies Winsock\'s error code for WSAEWOULDBLOCK/EAGAIN');
+--FILE--
+<?php
+$listenfd = socket_create(AF_INET6, SOCK_STREAM, SOL_TCP);
+socket_bind($listenfd, "::1", 13579);
+socket_listen($listenfd);
+socket_set_nonblock($listenfd);
+$connfd = @socket_accept($listenfd);
+echo socket_last_error();
+--EXPECT--
+10035
diff --git a/ext/sockets/tests/socket_strerror.phpt b/ext/sockets/tests/socket_strerror.phpt index d1759c582..52e7a0a48 100644 --- a/ext/sockets/tests/socket_strerror.phpt +++ b/ext/sockets/tests/socket_strerror.phpt @@ -154,4 +154,4 @@ string(20) "Key has been revoked" string(27) "Key was rejected by service" string(10) "Owner died" string(21) "State not recoverable" -string(17) "Unknown error 132" +string(%d) "%s" |
