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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: eja40 at cam dot ac dot uk
New email:
PHP Version: OS:

 

 [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-2020 The PHP Group
All rights reserved.
Last updated: Tue Jun 02 12:01:25 2020 UTC