Bug->Doc #61141 [Asn->Nab]: curl_multi_select returns -1

From: Date: Sat, 22 Sep 2012 13:22:02 +0000
Subject: Bug->Doc #61141 [Asn->Nab]: curl_multi_select returns -1
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8883@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61141&edit=1 ID: 61141 Updated by: pierrick@php.net Reported by: amoo_miki at yahoo dot com Summary: curl_multi_select returns -1 -Status: Assigned +Status: Not a bug -Type: Bug +Type: Documentation Problem Package: cURL related Operating System: Windows 7 x64 PHP Version: 5.3.10 Assigned To: pierrick Block user comment: N Private report: N New Comment: I tried this on my windows setup with the same version of PHP but two different versions of libcurl (7.19 and 7.24) and this difference is due to the libcurl version used to compile ext/curl but this is in fact not a bug. Internally php curl_multi_select uses libcurl curl_multi_fdset function to set all the fd_set and the maxfd value. The libcurl curl_multi_fdset documentation says : When libcurl returns -1 in max_fd, it is because libcurl currently does something that isn't possible for your application to monitor with a socket and unfortunately you can then not know exactly when the current action is completed using select(). When max_fd returns with -1, you need to wait a while and then proceed and call curl_multi_perform anyway. How long to wait? I would suggest 100 milliseconds at least, but you may want to test it out in your own particular conditions to find a suitable value. If you modify the script to wait some time if the curl_multi_select return -1 and then do the curl_multi_exec it should work (it worked on my setup with both curl versions). Previous Comments: ------------------------------------------------------------------------ [2012-09-22 09:35:07] amoo_miki at yahoo dot com PHP 5.3.17 and 5.4.7 too suffer from this bug. ------------------------------------------------------------------------ [2012-06-06 20:57:57] ihate at spam dot com Always returns -1 on Windows 7 64bit. Tried on 5.4 and 5.4.3. It worked a couple of months ago, perhaps some Win7 update changed something. ------------------------------------------------------------------------ [2012-05-30 02:48:04] laruence@php.net Pierrick, could you please look at this? :) ------------------------------------------------------------------------ [2012-05-29 11:52:09] amoo_miki at yahoo dot com I can confirm that PHP 5.4.3 (cli) (built: May 8 2012 00:23:27) suffers from the same bug. ------------------------------------------------------------------------ [2012-05-25 12:08:45] kulminaator at gmail dot com Running PHP 5.4.0 on Windows 7 has the same issue, curl_multi_select always returns -1 PHP Version => 5.4.0 System => Windows NT MSA-3644048 6.1 build 7601 (Windows 7 Enterprise Edition Service Pack 1) i586 cURL support => enabled cURL Information => 7.24.0 Age => 3 Features AsynchDNS => Yes Debug => No GSS-Negotiate => Yes IDN => No IPv6 => Yes Largefile => Yes NTLM => Yes SPNEGO => No SSL => Yes SSPI => Yes krb4 => No libz => Yes CharConv => No Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp Host => i386-pc-win32 SSL Version => OpenSSL/0.9.8t ZLib Version => 1.2.5 libSSH Version => libssh2/1.3.0 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=61141 -- Edit this bug report at https://bugs.php.net/bug.php?id=61141&edit=1

« previous php.doc.bugs (#8883) next »