@@ -94,6 +94,11 @@ static zend_result select_backend_add(php_poll_ctx *ctx, int fd, uint32_t events
94
94
select_backend_data_t * backend_data = (select_backend_data_t * ) ctx -> backend_data ;
95
95
php_socket_t sock = (php_socket_t ) fd ;
96
96
97
+ if (events & PHP_POLL_ET ) {
98
+ php_poll_set_error (ctx , PHP_POLL_ERR_NOSUPPORT );
99
+ return FAILURE ;
100
+ }
101
+
97
102
#ifdef FD_SETSIZE
98
103
if (sock >= FD_SETSIZE ) {
99
104
php_poll_set_error (ctx , PHP_POLL_ERR_INVALID );
@@ -139,6 +144,11 @@ static zend_result select_backend_modify(
139
144
select_backend_data_t * backend_data = (select_backend_data_t * ) ctx -> backend_data ;
140
145
php_socket_t sock = (php_socket_t ) fd ;
141
146
147
+ if (events & PHP_POLL_ET ) {
148
+ php_poll_set_error (ctx , PHP_POLL_ERR_NOSUPPORT );
149
+ return FAILURE ;
150
+ }
151
+
142
152
php_poll_fd_entry * entry = php_poll_fd_table_find (backend_data -> fd_table , fd );
143
153
if (!entry ) {
144
154
php_poll_set_error (ctx , PHP_POLL_ERR_NOTFOUND );
@@ -293,18 +303,15 @@ static int select_backend_wait(
293
303
php_poll_fd_table_foreach (backend_data -> fd_table , process_select_result_callback , & result_ctx );
294
304
int event_count = result_ctx .event_count ;
295
305
296
- /* Apply edge-trigger simulation */
297
- int nfds = php_poll_simulate_edge_trigger (backend_data -> fd_table , events , event_count );
298
-
299
306
/* Handle oneshot removals */
300
- for (int i = 0 ; i < nfds ; i ++ ) {
307
+ for (int i = 0 ; i < event_count ; i ++ ) {
301
308
php_poll_fd_entry * entry = php_poll_fd_table_find (backend_data -> fd_table , events [i ].fd );
302
309
if (entry && (entry -> events & PHP_POLL_ONESHOT ) && events [i ].revents != 0 ) {
303
310
select_handle_oneshot_removal (backend_data , events [i ].fd );
304
311
}
305
312
}
306
313
307
- return nfds ;
314
+ return event_count ;
308
315
}
309
316
310
317
static bool select_backend_is_available (void )
0 commit comments