]> granicus.if.org Git - php/commitdiff
Be smarter about which systems should register unix transports.
authorWez Furlong <wez@php.net>
Fri, 5 Dec 2003 13:41:02 +0000 (13:41 +0000)
committerWez Furlong <wez@php.net>
Fri, 5 Dec 2003 13:41:02 +0000 (13:41 +0000)
Fix skip conditions in these network tests

ext/standard/tests/network/udgloop.phpt
ext/standard/tests/network/udp6loop.phpt
ext/standard/tests/network/unixloop.phpt
main/streams/streams.c

index 2642d8568d9707904f4def727d9e454c2037c971..a61d082c189b98adfc23f33e96fc90d9bc00f104 100644 (file)
@@ -1,15 +1,15 @@
 --TEST--
 Streams Based Unix Domain Datagram Loopback test
 --SKIPIF--
-<?php
+<?php # vim:ft=php:
        if (array_search("udg",stream_get_transports()) === false)
-               die('No support for UNIX domain sockets.'); 
+               die('SKIP No support for UNIX domain sockets.'); 
 ?>
 --FILE--
 <?php
        $uniqid = uniqid();
        if (file_exists("/tmp/$uniqid.sock"))
-               die('Temporary socket already exists.');
+               die('Temporary socket /tmp/$uniqid.sock already exists.');
 
        /* Setup socket server */
        $server = stream_socket_server("udg:///tmp/$uniqid.sock", $errno, $errstr, STREAM_SERVER_BIND);
index fdf1b7727925e715d17238f23e121e9516fceb0e..5fcf7a7f46cd319347e4cb4b31c9ecc431e87684 100644 (file)
@@ -1,10 +1,16 @@
 --TEST--
 Streams Based IPv6 UDP Loopback test
 --SKIPIF--
-<?php
-    /* If IPv6 is supported on the platform this will error out with code 111 - Connection refused.
-       If IPv6 is NOT supported, $errno will be set to something else (indicating parse/getaddrinfo error)
-       Note: Might be a good idea to export an IPv6 support indicator (such as AF_INET6 exported by ext/sockets) */
+<?php # vim:ft=php:
+       /* If IPv6 is supported on the platform this will error out with code 111 -
+        * Connection refused.  If IPv6 is NOT supported, $errno will be set to
+        * something else (indicating parse/getaddrinfo error)
+        * Note: Might be a good idea to export an IPv6 support indicator
+        * (such as AF_INET6 exported by ext/sockets), however, since we
+        * cannot tell for sure if IPv6 works until we probe it at run time,
+        * this isn't really practical.
+        */
+
        @stream_socket_client('tcp://[::1]:0', $errno);
        if ($errno != 111) die('skip IPv6 not supported.');
 ?>
index 618f4866d362536cc1323975e5e5bc1f59e0f9bd..abb103b0d14cacfda0a72e1f35f4623e589d6149 100644 (file)
@@ -1,9 +1,9 @@
 --TEST--
 Streams Based Unix Domain Loopback test
 --SKIPIF--
-<?php
+<?php # vim:ft=php:
        if (array_search("unix",stream_get_transports()) === false)
-               die('No support for UNIX domain sockets.'); 
+               die('SKIP No support for UNIX domain sockets.'); 
 ?>
 --FILE--
 <?php
index c612e4ca4ddba6ba67b14df9b3e2748e4e6d8a0a..4a72d3840d6dc913b3168ea2fa874ba8f44cac70 100755 (executable)
@@ -1353,7 +1353,7 @@ int php_init_stream_wrappers(int module_number TSRMLS_DC)
                        php_stream_xport_register("tcp", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS
                        &&
                        php_stream_xport_register("udp", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS
-#ifdef AF_UNIX
+#if defined(AF_UNIX) && !(defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE))
                        &&
                        php_stream_xport_register("unix", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS
                        &&