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

From: Date: Fri, 25 Apr 2014 09:41:59 +0000
Subject: Req->Bug #27618 [Opn->Fbk]: curl_multi_info_read does not appear to work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185437@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: mike@php.net Reported by: jason at neodisco dot com Summary: curl_multi_info_read does not appear to work -Status: Open +Status: Feedback -Type: Feature/Change Request +Type: Bug Package: cURL related Operating System: * PHP Version: * Block user comment: N Private report: N New Comment: Cannot reproduce. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#185437) next »