- zval *zrequest, *zprogress, *retval = NULL, *zclient;
- TSRMLS_FETCH_FROM_CTX(client->ts);
-
- MAKE_STD_ZVAL(zclient);
- ZVAL_OBJVAL(zclient, ((php_http_client_object_t *) arg)->zv, 1);
- MAKE_STD_ZVAL(zrequest);
- ZVAL_OBJVAL(zrequest, ((php_http_message_object_t *) e->opaque)->zv, 1);
- MAKE_STD_ZVAL(zprogress);
- object_init(zprogress);
- add_property_bool(zprogress, "started", progress->started);
- add_property_bool(zprogress, "finished", progress->finished);
- add_property_string(zprogress, "info", STR_PTR(progress->info), 1);
- add_property_double(zprogress, "dltotal", progress->dl.total);
- add_property_double(zprogress, "dlnow", progress->dl.now);
- add_property_double(zprogress, "ultotal", progress->ul.total);
- add_property_double(zprogress, "ulnow", progress->ul.now);
- with_error_handling(EH_NORMAL, NULL) {
- zend_call_method_with_2_params(&zclient, NULL, NULL, "notify", &retval, zrequest, zprogress);
- } end_error_handling();
+ zval zrequest, zprogress, retval, zclient;
+ zend_error_handling zeh;
+
+ ZVAL_UNDEF(&retval);
+ ZVAL_OBJECT(&zclient, &((php_http_client_object_t *) arg)->zo, 1);
+ ZVAL_OBJECT(&zrequest, &((php_http_message_object_t *) e->opaque)->zo, 1);
+ object_init(&zprogress);
+ add_property_bool(&zprogress, "started", progress->started);
+ add_property_bool(&zprogress, "finished", progress->finished);
+ add_property_string(&zprogress, "info", STR_PTR(progress->info));
+ add_property_double(&zprogress, "dltotal", progress->dl.total);
+ add_property_double(&zprogress, "dlnow", progress->dl.now);
+ add_property_double(&zprogress, "ultotal", progress->ul.total);
+ add_property_double(&zprogress, "ulnow", progress->ul.now);
+ zend_replace_error_handling(EH_NORMAL, NULL, &zeh);
+ zend_call_method_with_2_params(&zclient, NULL, NULL, "notify", &retval, &zrequest, &zprogress);
+ zend_restore_error_handling(&zeh);