#33570 [Com]: curl_errno does not return error codes on multi handles

From: Date: Mon, 20 Aug 2007 07:03:38 +0000
Subject: #33570 [Com]: curl_errno does not return error codes on multi handles
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-116336@lists.php.net to get a copy of this message
 ID:               33570
 Comment by:       curl dot user at inter dot nets
 Reported By:      eja40 at cam dot ac dot uk
 Status:           No Feedback
 Bug Type:         cURL related
 Operating System: Redhat 9
 PHP Version:      5.0.4
 New Comment:

It seems that this bug still exists. curl_errno() will return 0
(CURLE_OK) even when an error has occurred.

Reproduce code:
---------------
<?php

// Tested with PHP 5.2.3 on Windows XP
// The script "sleep20.php" contains sleep(20) to make sure the request
always times out

$mh = curl_multi_init();
$ch = curl_init('http://127.0.0.1/dev/sleep20.php');
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_multi_add_handle($mh, $ch);
$running = null;
do { curl_multi_exec($mh, $running); } while ($running > 0);

var_dump(curl_errno($ch)); // Error number
var_dump(curl_error($ch)); // Error string

curl_multi_remove_handle($mh, $ch);
curl_close($ch);
curl_multi_close($mh);

?>

Expected result:
----------------
int(28)
string(57) "Operation timed out after 5 seconds with 0 bytes received"

Actual result:
--------------
int(0)
string(57) "Operation timed out after 5 seconds with 0 bytes received"


Previous Comments:
------------------------------------------------------------------------

[2005-07-12 01:00:04] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------

[2005-07-05 00:15:15] tony2001@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip



------------------------------------------------------------------------

[2005-07-05 00:10:27] eja40 at cam dot ac dot uk

Description:
------------
curl_error($this->connections[$i]) returns 'Operation timed out with
27286 out of 64683 bytes received'

But:

curl_errno($this->connections[$i]) returns 0 regardless of the error
text

This only occurs on a multi-curl handle...



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33570&edit=1


Thread (6 messages)

« previous php.bugs (#116336) next »