From:             dypa at bk dot ru
Operating system: linux
PHP version:      5.2CVS-2009-05-16 (snap)
PHP Bug Type:     cURL related
Bug description:  curl_errno return 0 on error

Description:
------------
when i use curl_multi curl_errno returns 0 on errors
see:
u...@localhost:/$php code.php

this bug related to: http://bugs.php.net/bug.php?id=33570

Reproduce code:
---------------
<?php
// create both cURL resources
$ch1 = curl_init();
$ch2 = curl_init();

// set URL and other appropriate options
curl_setopt($ch1, CURLOPT_URL, "http://404.php.net";);
curl_setopt($ch1, CURLOPT_HEADER, 0);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/";);
curl_setopt($ch2, CURLOPT_HEADER, 0);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);

//create the multiple cURL handle
$mh = curl_multi_init();

//add the two handles
curl_multi_add_handle($mh,$ch1);
curl_multi_add_handle($mh,$ch2);

$running=null;
//execute the handles
do {
    curl_multi_exec($mh,$running);
} while ($running > 0);

var_dump($ch1);
var_dump($ch2);

var_dump(curl_errno($ch1));
var_dump(curl_errno($ch2));

var_dump(curl_error($ch1));
var_dump(curl_error($ch2));

//close the handles
curl_multi_remove_handle($mh, $ch1);
curl_multi_remove_handle($mh, $ch2);
curl_multi_close($mh);


Expected result:
----------------
resource(4) of type (curl)
resource(5) of type (curl)
int(6) //CURLE_COULDNT_RESOLVE_HOST (6)
int(0)
string(35) "Couldn't resolve host '404.php.net'"
string(0) ""


Actual result:
--------------
resource(4) of type (curl)
resource(5) of type (curl)
int(0)
int(0)
string(35) "Couldn't resolve host '404.php.net'"
string(0) ""


-- 
Edit bug report at http://bugs.php.net/?id=48304&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=48304&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=48304&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=48304&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=48304&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48304&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=48304&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=48304&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=48304&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=48304&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=48304&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=48304&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=48304&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=48304&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=48304&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=48304&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=48304&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=48304&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=48304&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=48304&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=48304&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=48304&r=mysqlcfg

Reply via email to