mirror of
https://github.com/danog/ext-uv.git
synced 2024-11-30 04:29:01 +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->address = NULL; \
|
||||||
uv->read2_cb = NULL; \
|
uv->read2_cb = NULL; \
|
||||||
uv->getaddr_cb = NULL; \
|
uv->getaddr_cb = NULL; \
|
||||||
uv->fs_poll_cb = NULL; \
|
|
||||||
uv->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);
|
zval_ptr_dtor(&obj->getaddr_cb);
|
||||||
obj->getaddr_cb = NULL;
|
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) {
|
if (obj->poll_cb) {
|
||||||
PHP_UV_DEBUG_PRINT("zval_ptr_dtor: poll_cb\n");
|
PHP_UV_DEBUG_PRINT("zval_ptr_dtor: poll_cb\n");
|
||||||
zval_ptr_dtor(&obj->poll_cb);
|
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[2] = &p;
|
||||||
params[3] = &c;
|
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(&rsc);
|
||||||
zval_ptr_dtor(&stat);
|
zval_ptr_dtor(&stat);
|
||||||
@ -5709,21 +5703,23 @@ PHP_FUNCTION(uv_fs_poll_init)
|
|||||||
*/
|
*/
|
||||||
PHP_FUNCTION(uv_fs_poll_start)
|
PHP_FUNCTION(uv_fs_poll_start)
|
||||||
{
|
{
|
||||||
zval *handle, *callback = NULL;
|
zval *handle = NULL;
|
||||||
php_uv_t *uv;
|
php_uv_t *uv;
|
||||||
char *path;
|
char *path;
|
||||||
unsigned long interval = 0;
|
unsigned long interval = 0;
|
||||||
int error, path_len = 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,
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZEND_FETCH_RESOURCE(uv, php_uv_t *, &handle, -1, PHP_UV_RESOURCE_NAME, uv_resource_handle);
|
ZEND_FETCH_RESOURCE(uv, php_uv_t *, &handle, -1, PHP_UV_RESOURCE_NAME, uv_resource_handle);
|
||||||
|
|
||||||
Z_ADDREF_P(callback);
|
php_uv_cb_init(&cb, uv, &fci, &fcc, PHP_UV_FS_POLL_CB);
|
||||||
uv->fs_poll_cb = callback;
|
|
||||||
uv->uv.fs_poll.data = uv;
|
uv->uv.fs_poll.data = uv;
|
||||||
zend_list_addref(uv->resource_id);
|
zend_list_addref(uv->resource_id);
|
||||||
|
|
||||||
|
1
php_uv.h
1
php_uv.h
@ -124,7 +124,6 @@ typedef struct {
|
|||||||
zval *address;
|
zval *address;
|
||||||
zval *read2_cb;
|
zval *read2_cb;
|
||||||
zval *getaddr_cb;
|
zval *getaddr_cb;
|
||||||
zval *fs_poll_cb;
|
|
||||||
zval *poll_cb;
|
zval *poll_cb;
|
||||||
php_uv_cb_t *callback[PHP_UV_CB_MAX];
|
php_uv_cb_t *callback[PHP_UV_CB_MAX];
|
||||||
} php_uv_t;
|
} php_uv_t;
|
||||||
|
Loading…
Reference in New Issue
Block a user