Edit report at https://bugs.php.net/bug.php?id=60790&edit=1
ID: 60790
Comment by: bompus at gmail dot com
Reported by: leonchuk at gmail dot com
Summary: "curl_multi_select" executed first time always one
second
Status: Open
Type: Bug
Package: cURL related
Operating System: windows (XP,7)
PHP Version: 5.3.9
Block user comment: N
Private report: N
New Comment:
I've noticed this as well. The function should return as soon as it is finished
I
believe. This could be a CURL issue or a PHP issue. I'm interested to hear what
the dev's say since I've had all kinds of issues with curl_multi_select in
newer
PHP versions. I keep having to revert to 5.3.6.. I've tried 5.3.10 and using
curl_multi_select within a loop checking for != -1 and it causes an infinite
loop
since it always returns -1 on Windows 7 x64/x86, PHP 5.3.10
Previous Comments:
------------------------------------------------------------------------
[2012-01-18 13:18:08] leonchuk at gmail dot com
Description:
------------
In Windows (tested XP and w7) function "curl_multi_select" executed first time
always one second (equal to default parameter - $timeout)
---
>From manual page:
>http://www.php.net/function.curl-multi-init#refsect1-function.curl-multi-init-examples
---
Test script:
---------------
$ch1 = curl_init();
curl_setopt_array($ch1, array(CURLOPT_URL=>"http://lxr.php.net/",
CURLOPT_HEADER=>0, CURLOPT_RETURNTRANSFER=>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);
$start_time = microtime(true);
while ($active && $mrc == CURLM_OK) {
if (curl_multi_select($mh) != -1) { #after first run = 1 sec
echo (microtime(true)-$start_time)."<br>".PHP_EOL;
do $mrc = curl_multi_exec($mh, $active);
while ($mrc == CURLM_CALL_MULTI_PERFORM);
}
}
curl_multi_remove_handle($mh, $ch1); curl_multi_close($mh);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60790&edit=1