Bug #70060 [NEW]: write events should be disabled in curl_multi_select
| From: | xiaoyjy at mail dot com | Date: | Mon, 13 Jul 2015 07:57:23 +0000 |
| Subject: | Bug #70060 [NEW]: write events should be disabled in curl_multi_select | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-194376@lists.php.net to get a copy of this message | ||
From: xiaoyjy at mail dot com
Operating system: Linux
PHP version: 5.6.11
Package: HTTP related
Bug Type: Bug
Bug description:write events should be disabled in curl_multi_select
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));
}
--
Edit bug report at https://bugs.php.net/bug.php?id=70060&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70060&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70060&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70060&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70060&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70060&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70060&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70060&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70060&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70060&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70060&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70060&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70060&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70060&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70060&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70060&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70060&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70060&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70060&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70060&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70060&r=mysqlcfg