mirror of
https://github.com/danog/ext-uv.git
synced 2024-11-30 04:29:01 +01:00
unix: add type check for uv_shutdown
This commit is contained in:
parent
89a46643ca
commit
17b1436023
7
php_uv.c
7
php_uv.c
@ -3593,6 +3593,13 @@ PHP_FUNCTION(uv_shutdown)
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(uv, php_uv_t *, &client, -1, PHP_UV_RESOURCE_NAME, uv_resource_handle);
|
||||
#ifndef PHP_WIN32
|
||||
/* uv_shutdown (unix) only supports uv_handle_t right now */
|
||||
if (uv->type != IS_UV_TCP && uv->type != IS_UV_PIPE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "passed resource didn't initialize for uv_tcp or uv_pipe");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
php_uv_cb_init(&cb, uv, &fci, &fcc, PHP_UV_SHUTDOWN_CB);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user