Properly handle all cases of php_uv_t * for uv_stop in uv_do_callback2()

This commit is contained in:
Bob Weinand 2020-02-15 22:19:26 +01:00
parent 67356706aa
commit 5be79e433d
2 changed files with 26 additions and 1 deletions

View File

@ -1361,7 +1361,29 @@ static int php_uv_do_callback2(zval *retval_ptr, php_uv_t *uv, zval *params, int
//zend_fcall_info_args_clear(&uv->callback[type]->fci, 0);
if (EG(exception)) {
uv_stop(uv->uv.handle.loop);
switch (type) {
case PHP_UV_FS_CB:
uv_stop(uv->uv.fs.loop);
break;
case PHP_UV_GETADDR_CB:
uv_stop(uv->uv.addrinfo.loop);
break;
case PHP_UV_AFTER_WORK_CB:
uv_stop(uv->uv.work.loop);
break;
case PHP_UV_SHUTDOWN_CB:
uv_stop(uv->uv.shutdown.handle->loop);
break;
case PHP_UV_SEND_CB:
uv_stop(uv->uv.udp_send.handle->loop);
break;
case PHP_UV_CONNECT_CB:
case PHP_UV_PIPE_CONNECT_CB:
uv_stop(uv->uv.connect.handle->loop);
break;
default:
uv_stop(uv->uv.handle.loop);
}
}
return error;

View File

@ -158,6 +158,9 @@ typedef struct {
uv_handle_t handle;
uv_req_t req;
uv_stream_t stream;
uv_shutdown_t shutdown;
uv_udp_send_t udp_send;
uv_connect_t connect;
uv_getaddrinfo_t addrinfo;
uv_prepare_t prepare;
uv_check_t check;