Bug #70060 [Opn]: write events should be disabled in curl_multi_select

From: Date: Mon, 13 Jul 2015 08:06:23 +0000
Subject: Bug #70060 [Opn]: write events should be disabled in curl_multi_select
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194377@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70060&edit=1 ID: 70060 User updated by: xiaoyjy at mail dot com Reported by: xiaoyjy at mail dot com Summary: write events should be disabled in curl_multi_select Status: Open Type: Bug -Package: HTTP related +Package: cURL related Operating System: Linux PHP Version: 5.6.11 Block user comment: N Private report: N New Comment: change Package to cURL ralated Previous Comments: ------------------------------------------------------------------------ [2015-07-13 07:57:22] xiaoyjy at mail dot com 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 this bug report at https://bugs.php.net/bug.php?id=70060&edit=1

« previous php.bugs (#194377) next »