#31612 [NEW]: No error message returned from curl_error() when connection fails by IP.
| From: | brian dot sanders at cometsystems dot com | Date: | Wed, 19 Jan 2005 16:02:16 +0000 |
| Subject: | #31612 [NEW]: No error message returned from curl_error() when connection fails by IP. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-72466@lists.php.net to get a copy of this message | ||
From: brian dot sanders at cometsystems dot com
Operating system: Fedora Core 3
PHP version: 5.0.2
PHP Bug Type: cURL related
Bug description: No error message returned from curl_error() when connection fails by IP.
Description:
------------
When requesting a file from a bad IP (in this case 127.0.0.1, with no Web
server running) cURL fails to retreive a page (as expected.) curl_errno()
returns an error code of 7, but curl_error returns NULL.
Reproduce code:
---------------
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1);
curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1');
$result = curl_exec($ch);
print('Error code: '.curl_errno($ch)."\n");
print('Error message: '.curl_error($ch)."\n");
?>
Expected result:
----------------
7
Failed to connect (or some such error)
Actual result:
--------------
7
--
Edit bug report at http://bugs.php.net/?id=31612&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31612&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31612&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31612&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31612&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31612&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31612&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31612&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31612&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31612&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31612&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=31612&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=31612&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31612&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31612&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31612&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31612&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31612&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31612&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31612&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31612&r=mysqlcfg