php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33570 curl_errno does not return error codes on multi handles
Submitted: 2005-07-05 00:10 UTC Modified: 2005-07-12 01:00 UTC
Votes:22
Avg. Score:3.9 ± 0.8
Reproduced:21 of 21 (100.0%)
Same Version:4 (19.0%)
Same OS:3 (14.3%)
From: eja40 at cam dot ac dot uk Assigned:
Status: No Feedback Package: cURL related
PHP Version: 5.0.4 OS: Redhat 9
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
17 - 13 = ?
Subscribe to this entry?

 
 [2005-07-05 00:10 UTC] 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...


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-05 00:15 UTC] 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-12 01:00 UTC] 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".
 [2010-06-16 16:42 UTC] c dot madmax at gmail dot com
The bug still exists in PHP 5.2.9!
 [2012-10-10 15:42 UTC] jerry at jerryniman dot co dot uk
Bug still there at PHP 5.2.13

OS -  redhat linux
Build Date - May 1 2010 23:54:46

curl_error($ch) returns 'Couldn't resolve host'
curl_errno($ch) returns 0
 [2013-06-08 06:52 UTC] vps3721 at gmail dot com
PHP 5.4.15 CURL 7.30.0 CentOS 6.4 64BIT

demo.php
<?php
$ch1 = curl_init();
curl_setopt($ch1, CURLOPT_URL, "http://localhost/sleep.php");
curl_setopt($ch1, CURLOPT_HEADER, 0);
curl_setopt($ch1, CURLOPT_TIMEOUT, 1);
$mh = curl_multi_init();
curl_multi_add_handle($mh,$ch1);

$active = null;
do {
	$mrc = curl_multi_exec($mh, $active);
} while ($mrc == CURLM_CALL_MULTI_PERFORM);

while ($active && $mrc == CURLM_OK) {
	if (curl_multi_select($mh) != -1) {
		do {
			$mrc = curl_multi_exec($mh, $active);
		} while ($mrc == CURLM_CALL_MULTI_PERFORM);
	}
}
echo curl_errno( $ch1); //0
echo '<br />';
echo curl_error( $ch1); //Operation timed out after 1004 milliseconds with 0 out 
of -1 bytes received
curl_multi_remove_handle($mh, $ch1);
curl_multi_close($mh);

sleep.php
<?php
sleep( 60);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 14:01:29 2024 UTC