From:             foxkill at gmx dot de
Operating system: Linux
PHP version:      5CVS-2003-11-20 (dev)
PHP Bug Type:     cURL related
Bug description:  Using curl_multi_exec with curl_multi_fdset doesnt work

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


-- 
Edit bug report at http://bugs.php.net/?id=26332&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26332&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26332&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26332&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26332&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26332&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=26332&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26332&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26332&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26332&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26332&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26332&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26332&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26332&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26332&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26332&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26332&r=float

Reply via email to