|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-02-25 05:08 UTC] foxkill at gmx dot de
[2004-03-15 10:48 UTC] sniper@php.net
[2004-03-17 06:07 UTC] foxkill at gmx dot de
[2005-01-10 19:40 UTC] dtorop933 at gmail dot com
[2005-01-26 04:47 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 26 05:00:01 2025 UTC |
Description: ------------ I try to use curl_multi_fdset() together with curl_multi_exec() in php5. But this doesn't work. I modelled my php code after the sample (multi-app.c) which is provided by the curl-src package. Reproduce code: --------------- this is the code I use for php5 (three single curl handles were added): while (CURLM_CALL_MULTI_PERFORM == curl_multi_exec($m, $still_running)) ; while ($still_running) { $fd = curl_multi_select($m, 1); switch($fd) { case -1: break; case 0: default: while (CURLM_CALL_MULTI_PERFORM == curl_multi_exec($m, $still_running)) ; } } Expected result: ---------------- The code should behave like the multi-app.c sample. See [curl-src]/docs/examples/multi-app.c. Actual result: -------------- The code runs in an endless loop. Because curl_multi_exec() (alias curl_multi_perform()) needs to reference the variables readfds, writefds which were set by a previous call to curl_multi_fdset(). But these fdsets have gone out of scope. The C Code works because the fdsets are still present on the stack. See man 3 curl_multi_fdset for further details. curl --version gives: curl 7.10.8 (i686-pc-linux-gnu) libcurl/7.10.8 OpenSSL/0.9.7c zlib/1.1.4 Protocols: ftp gopher ldap http file https ftps Features: SSL libz NTLM