Re[2]: [PEAR-DEV] Re: go-pear. Was:Re[2]: [PEAR-DEV] XML_RPC
| From: | anatoly techtonik | Date: | Thu, 09 Dec 2004 09:38:42 +0000 |
| Subject: | Re[2]: [PEAR-DEV] Re: go-pear. Was:Re[2]: [PEAR-DEV] XML_RPC | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-34943@lists.php.net to get a copy of this message | ||
Hello Pierre-Alain,
>> Sorry, my fault. There should be phrase 'internet connection
>> "isn\'t" available' or the word 'unavailable' in my post.
PAJ> I used a local pear server, it can be done sometimes. In my
PAJ> opininion the current error message is correct.
What error message do you mean? Could you provide it here to assure
we are talking of the same thing?
>> PAJ> Do you have any other good ideas? Calling gethostbyname
>> PAJ> before fsockopen is nothing than ugly and slow.
>>
>> fsockopen will call it anyway. You can try to call fsockopen with
>> some fiction url and meditate a bit about it's error message. I'd
>> be very glad if you can make a solution how to handle that error
>> or at least suppress to handle it later.
PAJ> Gethostbyname will not tell that there is an internet access. Local
PAJ> DNS cache or other local things can get cached dns entries.
PAJ> The error is to do not silent fsockopen, the io handler being
PAJ> checked later. I was sure it was behind an ugly '@'...
Even if you place an '@'... (which I have missed in my patch), think
about the error message the user will get (I'm using PHP 4.3.9)
<?php
$host = 'zzzz';
$fp = @fsockopen($host, 80, $errno, $errstr);
if (!$fp) {
print("\nconnect to '$host' failed: $errstr ($errno)\n");
}
?>
>connect to 'zzzz' failed: The operation completed successfully. (0)
Rather confusing if you ask me.
t
--