mirror of
https://github.com/danog/ext-uv.git
synced 2024-11-26 20:14:47 +01:00
use fci and fcc for fs poll cb
This commit is contained in:
parent
e5b8b8d768
commit
0cbdc2f42e
18
php_uv.c
18
php_uv.c
@ -62,7 +62,6 @@
|
||||
uv->address = NULL; \
|
||||
uv->read2_cb = NULL; \
|
||||
uv->getaddr_cb = NULL; \
|
||||
uv->fs_poll_cb = NULL; \
|
||||
uv->poll_cb = NULL; \
|
||||
}
|
||||
|
||||
@ -515,11 +514,6 @@ void static destruct_uv(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
zval_ptr_dtor(&obj->getaddr_cb);
|
||||
obj->getaddr_cb = NULL;
|
||||
}
|
||||
if (obj->fs_poll_cb) {
|
||||
PHP_UV_DEBUG_PRINT("zval_ptr_dtor: fs_poll_cb\n");
|
||||
zval_ptr_dtor(&obj->fs_poll_cb);
|
||||
obj->fs_poll_cb = NULL;
|
||||
}
|
||||
if (obj->poll_cb) {
|
||||
PHP_UV_DEBUG_PRINT("zval_ptr_dtor: poll_cb\n");
|
||||
zval_ptr_dtor(&obj->poll_cb);
|
||||
@ -1232,7 +1226,7 @@ static void php_uv_fs_poll_cb(uv_fs_poll_t* handle, int status, const uv_statbuf
|
||||
params[2] = &p;
|
||||
params[3] = &c;
|
||||
|
||||
php_uv_do_callback(&retval_ptr, uv->fs_poll_cb, params, 4 TSRMLS_CC);
|
||||
php_uv_do_callback2(&retval_ptr, uv, params, 4, PHP_UV_FS_POLL_CB TSRMLS_CC);
|
||||
|
||||
zval_ptr_dtor(&rsc);
|
||||
zval_ptr_dtor(&stat);
|
||||
@ -5709,21 +5703,23 @@ PHP_FUNCTION(uv_fs_poll_init)
|
||||
*/
|
||||
PHP_FUNCTION(uv_fs_poll_start)
|
||||
{
|
||||
zval *handle, *callback = NULL;
|
||||
zval *handle = NULL;
|
||||
php_uv_t *uv;
|
||||
char *path;
|
||||
unsigned long interval = 0;
|
||||
int error, path_len = 0;
|
||||
zend_fcall_info fci = empty_fcall_info;
|
||||
zend_fcall_info_cache fcc = empty_fcall_info_cache;
|
||||
php_uv_cb_t *cb;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
|
||||
"zzsl", &handle, &callback, &path, &path_len, &interval) == FAILURE) {
|
||||
"zfsl", &handle, &fci, &fcc, &path, &path_len, &interval) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(uv, php_uv_t *, &handle, -1, PHP_UV_RESOURCE_NAME, uv_resource_handle);
|
||||
|
||||
Z_ADDREF_P(callback);
|
||||
uv->fs_poll_cb = callback;
|
||||
php_uv_cb_init(&cb, uv, &fci, &fcc, PHP_UV_FS_POLL_CB);
|
||||
uv->uv.fs_poll.data = uv;
|
||||
zend_list_addref(uv->resource_id);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user