ID: 44065
User updated by: joe at digg dot com
Reported By: joe at digg dot com
Status: Open
Bug Type: Streams related
Operating System: Linux devwww25 2.6.12-1-amd64-k8
PHP Version: 5.2.5
New Comment:
Did you run the reproduce code? I can consistently reproduce no error
and warnings being thrown from many machines. What was the output when
you ran the code below? Though, depending on the machine, I sometimes
get an error code.
Previous Comments:
------------------------------------------------------------------------
[2008-02-07 00:44:42] [EMAIL PROTECTED]
Hello,
I have not been able to reproduce it. Can please give us an extra
explanation about it?
------------------------------------------------------------------------
[2008-02-06 22:37:42] joe at digg dot com
Description:
------------
When getaddrinfo fails fsockopen() fails to return an error string or
error code.
Reproduce code:
---------------
<?php
$code = 0;
$message = '';
$fp = fsockopen('www.asdf98070978.org', 80, $code, $message);
if (!is_resource($fp)) {
echo 'ERROR: ' . $message . '(#' . $code . ')' . "\n";
} else {
echo 'Connected!' . "\n";
fclose($fp);
}
?>
Expected result:
----------------
fsockopen() should return false and set an appropriate error code and
error message.
Actual result:
--------------
It spits out a warning and doesn't include any sort of error message or
string:
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed:
Temporary failure in name resolution in
/home/jstump/repository/wildcat/branches/config/foo.php on line 5
Warning: fsockopen(): unable to connect to www.asdf98070978.org:80
(Unknown error) in
/home/jstump/repository/wildcat/branches/config/foo.php on line 5
ERROR: (#0)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44065&edit=1