|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-07-13 08:06 UTC] xiaoyjy at mail dot com
-Package: HTTP related
+Package: cURL related
[2015-07-13 08:06 UTC] xiaoyjy at mail dot com
[2015-07-13 09:07 UTC] laruence@php.net
[2015-07-15 02:49 UTC] laruence@php.net
-Status: Open
+Status: Not a bug
[2015-07-15 02:49 UTC] laruence@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 20:00:01 2025 UTC |
Description: ------------ As a clent fd, writefds are always available, the select function will always return immediately if the writefds is enabled. but we only care about read events in this case. PHP_FUNCTION(curl_multi_select) { zval *z_mh; php_curlm *mh; fd_set readfds; fd_set writefds; fd_set exceptfds; int maxfd; double timeout = 1.0; struct timeval to; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|d", &z_mh, &timeout) == FAILURE) { return; } ZEND_FETCH_RESOURCE(mh, php_curlm *, &z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle); _make_timeval_struct(&to, timeout); FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); curl_multi_fdset(mh->multi, &readfds, &writefds, &exceptfds, &maxfd); if (maxfd == -1) { RETURN_LONG(-1); } RETURN_LONG(select(maxfd + 1, &readfds, &writefds, &exceptfds, &to)); }