1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

soap: Avoid redundant copying of http body string

This commit is contained in:
Niels Dossche
2025-07-02 22:38:08 +02:00
parent 32f0d24e1f
commit e6e0887005

View File

@@ -1303,10 +1303,10 @@ try_again:
if ((strcmp(content_encoding,"gzip") == 0 ||
strcmp(content_encoding,"x-gzip") == 0) &&
(decompression_fn = zend_hash_str_find_ptr(EG(function_table), "gzdecode", sizeof("gzdecode")-1))) {
ZVAL_STR_COPY(&params[0], http_body);
ZVAL_STR(&params[0], http_body);
} else if (strcmp(content_encoding,"deflate") == 0 &&
(decompression_fn = zend_hash_str_find_ptr(EG(function_table), "gzuncompress", sizeof("gzuncompress")-1))) {
ZVAL_STR_COPY(&params[0], http_body);
ZVAL_STR(&params[0], http_body);
} else {
efree(content_encoding);
zend_string_release_ex(http_headers, 0);
@@ -1319,11 +1319,9 @@ try_again:
}
zend_call_known_function(decompression_fn, NULL, NULL, &retval, 1, params, NULL);
if (Z_TYPE(retval) == IS_STRING) {
zval_ptr_dtor(&params[0]);
zend_string_release_ex(http_body, 0);
ZVAL_COPY_VALUE(return_value, &retval);
} else {
zval_ptr_dtor(&params[0]);
zval_ptr_dtor(&retval);
efree(content_encoding);
zend_string_release_ex(http_headers, 0);