Skip to content

Commit 143f4e3

Browse files
committed
Reduce overhead
1 parent 68485f8 commit 143f4e3

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

ext/soap/soap.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,7 +2101,7 @@ static ZEND_NORETURN void soap_server_fault(char* code, char* string, char *acto
21012101
}
21022102
/* }}} */
21032103

2104-
static void soap_error_handler(int error_num, const char *error_filename, const uint32_t error_lineno, const char *format, va_list args) /* {{{ */
2104+
static zend_never_inline ZEND_COLD void soap_real_error_handler(int error_num, const char *error_filename, const uint32_t error_lineno, const char *format, va_list args) /* {{{ */
21052105
{
21062106
zend_bool _old_in_compilation;
21072107
zend_execute_data *_old_current_execute_data;
@@ -2113,11 +2113,6 @@ static void soap_error_handler(int error_num, const char *error_filename, const
21132113
_old_http_response_code = SG(sapi_headers).http_response_code;
21142114
_old_http_status_line = SG(sapi_headers).http_status_line;
21152115

2116-
if (!PG(modules_activated) || !SOAP_GLOBAL(use_soap_error_handler) || !EG(objects_store).object_buckets) {
2117-
call_old_error_handler(error_num, error_filename, error_lineno, format, args);
2118-
return;
2119-
}
2120-
21212116
if (Z_OBJ(SOAP_GLOBAL(error_object)) &&
21222117
instanceof_function(Z_OBJCE(SOAP_GLOBAL(error_object)), soap_class_entry)) {
21232118
zval *tmp;
@@ -2238,6 +2233,16 @@ static void soap_error_handler(int error_num, const char *error_filename, const
22382233
}
22392234
/* }}} */
22402235

2236+
static void soap_error_handler(int error_num, const char *error_filename, const uint32_t error_lineno, const char *format, va_list args) /* {{{ */
2237+
{
2238+
if (EXPECTED(!SOAP_GLOBAL(use_soap_error_handler))) {
2239+
call_old_error_handler(error_num, error_filename, error_lineno, format, args);
2240+
} else {
2241+
soap_real_error_handler(error_num, error_filename, error_lineno, format, args);
2242+
}
2243+
}
2244+
/* }}} */
2245+
22412246
/* {{{ proto use_soap_error_handler([bool $handler = TRUE]) */
22422247
PHP_FUNCTION(use_soap_error_handler)
22432248
{

0 commit comments

Comments
 (0)