wharmby Fri Jan 23 23:49:40 2009 UTC Modified files: /php-src/ext/standard/tests/streams stream_get_meta_data_socket_variation3.phpt stream_get_meta_data_socket_variation4.phpt stream_get_meta_data_socket_variation1.phpt stream_get_meta_data_socket_variation2.phpt Log: Make test more robust; avoid hangs if fsockopen() fails. Tested on Windows, Linux and Linux 64 bit http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt diff -u php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt:1.5 php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt:1.6 --- php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt:1.5 Fri Aug 15 09:27:14 2008 +++ php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt Fri Jan 23 23:49:40 2009 @@ -5,21 +5,15 @@ /* Setup socket server */ $server = stream_socket_server('tcp://127.0.0.1:31337'); -if ($server === false) { - die("stream_socket_server() failed\n"); -} /* Connect to it */ $client = fsockopen('tcp://127.0.0.1:31337'); -if ($client === false) { - die("fsockopen() failed\n"); +if (!$client) { + die("Unable to create socket"); } /* Accept that connection */ $socket = stream_socket_accept($server); -if ($socket === false) { - die("stream_socket_accept() failed\n"); -} var_dump(stream_get_meta_data($client)); http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt diff -u php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt:1.4 php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt:1.5 --- php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt:1.4 Fri Aug 15 09:27:14 2008 +++ php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt Fri Jan 23 23:49:40 2009 @@ -5,21 +5,15 @@ /* Setup socket server */ $server = stream_socket_server('tcp://127.0.0.1:31337'); -if ($server === false) { - die("stream_socket_server() failed\n"); -} /* Connect to it */ $client = fsockopen('tcp://127.0.0.1:31337'); -if ($client === false) { - die("fsockopen() failed\n"); +if (!$client) { + die("Unable to create socket"); } /* Accept that connection */ $socket = stream_socket_accept($server); -if ($socket === false) { - die("stream_socket_accept() failed\n"); -} echo "Write some data:\n"; fwrite($socket, "abcdefg\n1234567\nxyzxyz\n"); http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt diff -u php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt:1.5 php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt:1.6 --- php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt:1.5 Fri Aug 15 09:27:14 2008 +++ php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt Fri Jan 23 23:49:40 2009 @@ -5,21 +5,15 @@ /* Setup socket server */ $server = stream_socket_server('tcp://127.0.0.1:31337'); -if ($server === false) { - die("stream_socket_server() failed\n"); -} /* Connect to it */ $client = fsockopen('tcp://127.0.0.1:31337'); -if ($client === false) { - die("fsockopen() failed\n"); +if (!$client) { + die("Unable to create socket"); } /* Accept that connection */ $socket = stream_socket_accept($server); -if ($socket === false) { - die("stream_socket_accept() failed\n"); -} echo "Write some data:\n"; fwrite($socket, "abcdefg\n1234567\nxyzxyz\n"); http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt diff -u php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt:1.5 php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt:1.6 --- php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt:1.5 Fri Aug 15 09:27:14 2008 +++ php-src/ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt Fri Jan 23 23:49:40 2009 @@ -5,21 +5,15 @@ /* Setup socket server */ $server = stream_socket_server('tcp://127.0.0.1:31337'); -if ($server === false) { - die("stream_socket_server() failed\n"); -} /* Connect to it */ $client = fsockopen('tcp://127.0.0.1:31337'); -if ($client === false) { - die("fsockopen() failed\n"); +if (!$client) { + die("Unable to create socket"); } /* Accept that connection */ $socket = stream_socket_accept($server); -if ($socket === false) { - die("stream_socket_accept() failed\n"); -} var_dump(stream_get_meta_data($client));
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php