From 1a9192c3e20edfc3acae5f7a8b4e5b35bac71abe Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Sat, 15 Feb 2020 20:53:51 +0100 Subject: [PATCH] Stop the loop on exception so that execution can continue with the exception --- php_uv.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/php_uv.c b/php_uv.c index 46d494d..e323898 100644 --- a/php_uv.c +++ b/php_uv.c @@ -1360,6 +1360,10 @@ static int php_uv_do_callback2(zval *retval_ptr, php_uv_t *uv, zval *params, int #endif //zend_fcall_info_args_clear(&uv->callback[type]->fci, 0); + if (EG(exception)) { + uv_stop(uv->uv.handle.loop); + } + return error; } @@ -1442,6 +1446,10 @@ static int php_uv_do_callback3(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); + } + return error; } #endif @@ -1543,6 +1551,10 @@ static void php_uv_write_cb(uv_write_t* req, int status) php_uv_do_callback(&retval, wr->cb, params, 2 TSRMLS_CC); + if (EG(exception)) { + uv_stop(uv->uv.handle.loop); + } + PHP_UV_DEBUG_OBJ_DEL_REFCOUNT(uv_write_cb, uv); zval_ptr_dtor(¶ms[0]); zval_ptr_dtor(¶ms[1]);