php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27618 curl_multi_info_read does not appear to work
Submitted: 2004-03-17 00:02 UTC Modified: 2014-12-30 10:41 UTC
Votes:7
Avg. Score:4.9 ± 0.3
Reproduced:7 of 7 (100.0%)
Same Version:1 (14.3%)
Same OS:3 (42.9%)
From: jason at neodisco dot com Assigned:
Status: No Feedback Package: cURL related
PHP Version: * OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jason at neodisco dot com
New email:
PHP Version: OS:

 

 [2004-03-17 00:02 UTC] jason at neodisco dot com
Description:
------------
Hello! 

I am writing a php-cgi server, using curl-multi.  It needs to start a bunch of curl  'threads', and steadily process the results of finished 'threads' and start new ones in  their place.   

It seems to be working other than curl_multi_info_read() - this function does not  return any data so I cannot see which curl threads have finished and are ready for  processing.   

Looking at the curl.haxx.se curl-lib docs, it doesn't look too complicated (I'm not a C  programmer though!) to implement, seeing as everything else is working.  Perhaps I  have missed something entirely.   

I assume it is the same problem as mentioned here:? 

http://marc.theaimsgroup.com/?l=php-dev&m=104791992407964&w=2 

Thank you in advance for any help or suggestions you can offer, or perhaps even an  ETA on when this function might be finished so I can either wait, or skin the cat  another way. 

Warm regards, 

Jason 


Reproduce code:
---------------
$status_of_ch_threads = curl_multi_info_read();

Expected result:
----------------
Have the status returned


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-19 23:42 UTC] adamsch1 at yahoo dot com
Seeing this on php 5.05 on windows.  Basically from the code (5.05) it looks like curl_multi_info_read *should* return an array so one can determine the state of the requests.  However this function doesn't return anything.  

I've included my test wrapper which does work outside the call to info_read.

Not supporing this function really cripples the usefulness of more sophisticated programs that use curl_multi.

<?php

#-- Array of stuff
$connomains = array(
   "http://www.cnn.com/",
   "http://www.canada.com/",
   "http://www.yahoo.com/",
   "http://www.google.com/",
   "http://www.popmonkey.com/"
   );

#-- Initalize our multiple request
$mh = curl_multi_init();

#-- Setup each handle
foreach ($connomains as $i => $url) {
       $conn[$i]=curl_init($url);
       curl_setopt($conn[$i],CURLOPT_RETURNTRANSFER,1);
       curl_multi_add_handle ($mh,$conn[$i]);
}

#-- Perform the request
$lastactive = 5;
do {
  $n=curl_multi_exec($mh,$active);
  if( $active != $lastactive )  {
    $lastactive = $active;
    print_r( curl_multi_info_read( $mh ) );
    print "Left: $active \n";
  }
} while ($active);

foreach ($connomains as $i => $url) {
       $res[$i]=curl_multi_getcontent($conn[$i]);
       curl_close($conn[$i]);
}

#print_r($res);

?>
 [2011-04-08 21:45 UTC] jani@php.net
-Package: Feature/Change Request +Package: cURL related -Operating System: Any +Operating System: * -PHP Version: 6CVS, 5CVS, 4CVS +PHP Version: *
 [2014-04-25 09:41 UTC] mike@php.net
-Status: Open +Status: Feedback -Type: Feature/Change Request +Type: Bug
 [2014-04-25 09:41 UTC] mike@php.net
Cannot reproduce.
 [2014-12-30 10:41 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 11:01:27 2024 UTC