X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fphp_http_client.c;h=453e43c6ade56c18f5177abdf1698050b9116242;hb=3c7b514d38d844b855d430fcbaed6dea67c9c17b;hp=f1b1fc537acd0e9cb7e84445dc28939021dfa3f8;hpb=1ac722a1169ffe0f804f8d30a79c2f270d0d7999;p=m6w6%2Fext-http diff --git a/src/php_http_client.c b/src/php_http_client.c index f1b1fc5..453e43c 100644 --- a/src/php_http_client.c +++ b/src/php_http_client.c @@ -435,7 +435,9 @@ static ZEND_RESULT_CODE handle_response(void *arg, php_http_client_t *client, ph zend_fcall_info_argn(&e->closure.fci TSRMLS_CC, 1, &zresponse); zend_replace_error_handling(EH_NORMAL, NULL, &zeh TSRMLS_CC); + ++client->callback.depth; zend_fcall_info_call(&e->closure.fci, &e->closure.fcc, &retval, NULL TSRMLS_CC); + --client->callback.depth; zend_restore_error_handling(&zeh TSRMLS_CC); zend_fcall_info_argn(&e->closure.fci TSRMLS_CC, 0); @@ -490,7 +492,9 @@ static void handle_progress(void *arg, php_http_client_t *client, php_http_clien args[1] = &zprogress; zend_replace_error_handling(EH_NORMAL, NULL, &zeh TSRMLS_CC); + ++client->callback.depth; php_http_object_method_call(&client_obj->notify, zclient, NULL, 2, args TSRMLS_CC); + --client->callback.depth; zend_restore_error_handling(&zeh TSRMLS_CC); zval_ptr_dtor(&zclient); @@ -516,7 +520,9 @@ static void handle_debug(void *arg, php_http_client_t *client, php_http_client_e zend_replace_error_handling(EH_NORMAL, NULL, &zeh TSRMLS_CC); if (SUCCESS == zend_fcall_info_argn(&client_obj->debug.fci TSRMLS_CC, 4, &zclient, &zreq, &ztype, &zdata)) { + ++client_obj->client->callback.depth; zend_fcall_info_call(&client_obj->debug.fci, &client_obj->debug.fcc, NULL, NULL TSRMLS_CC); + --client_obj->client->callback.depth; zend_fcall_info_args_clear(&client_obj->debug.fci, 0); } zend_restore_error_handling(&zeh TSRMLS_CC); @@ -525,7 +531,6 @@ static void handle_debug(void *arg, php_http_client_t *client, php_http_client_e zval_ptr_dtor(&zreq); zval_ptr_dtor(&ztype); zval_ptr_dtor(&zdata); - } static void response_dtor(void *data) @@ -1251,7 +1256,8 @@ static PHP_METHOD(HttpClient, getAvailableConfiguration) } ZEND_BEGIN_ARG_INFO_EX(ai_HttpClient_setDebug, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 1) + /* using IS_CALLABLE type hint would create a forwards compatibility break */ + ZEND_ARG_INFO(0, callback) ZEND_END_ARG_INFO(); static PHP_METHOD(HttpClient, setDebug) {