Bug #27618 [Fbk->NoF]: curl_multi_info_read does not appear to work

From: Date: Tue, 30 Dec 2014 10:41:26 +0000
Subject: Bug #27618 [Fbk->NoF]: curl_multi_info_read does not appear to work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189376@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=27618&edit=1

 ID:               27618
 Updated by:       php-bugs@lists.php.net
 Reported by:      jason at neodisco dot com
 Summary:          curl_multi_info_read does not appear to work
-Status:           Feedback
+Status:           No Feedback
 Type:             Bug
 Package:          cURL related
 Operating System: *
 PHP Version:      *
 Private report:   N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[2014-04-25 09:41:59] mike@php.net

Cannot reproduce.

------------------------------------------------------------------------
[2005-11-19 23:42:30] 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);

?>

------------------------------------------------------------------------
[2004-03-17 00:02:22] 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



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



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


Thread (4 messages)

« previous php.bugs (#189376) next »