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:
@@ -1303,10 +1303,10 @@ try_again:
|
|||||||
if ((strcmp(content_encoding,"gzip") == 0 ||
|
if ((strcmp(content_encoding,"gzip") == 0 ||
|
||||||
strcmp(content_encoding,"x-gzip") == 0) &&
|
strcmp(content_encoding,"x-gzip") == 0) &&
|
||||||
(decompression_fn = zend_hash_str_find_ptr(EG(function_table), "gzdecode", sizeof("gzdecode")-1))) {
|
(decompression_fn = zend_hash_str_find_ptr(EG(function_table), "gzdecode", sizeof("gzdecode")-1))) {
|
||||||
ZVAL_STR_COPY(¶ms[0], http_body);
|
ZVAL_STR(¶ms[0], http_body);
|
||||||
} else if (strcmp(content_encoding,"deflate") == 0 &&
|
} else if (strcmp(content_encoding,"deflate") == 0 &&
|
||||||
(decompression_fn = zend_hash_str_find_ptr(EG(function_table), "gzuncompress", sizeof("gzuncompress")-1))) {
|
(decompression_fn = zend_hash_str_find_ptr(EG(function_table), "gzuncompress", sizeof("gzuncompress")-1))) {
|
||||||
ZVAL_STR_COPY(¶ms[0], http_body);
|
ZVAL_STR(¶ms[0], http_body);
|
||||||
} else {
|
} else {
|
||||||
efree(content_encoding);
|
efree(content_encoding);
|
||||||
zend_string_release_ex(http_headers, 0);
|
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);
|
zend_call_known_function(decompression_fn, NULL, NULL, &retval, 1, params, NULL);
|
||||||
if (Z_TYPE(retval) == IS_STRING) {
|
if (Z_TYPE(retval) == IS_STRING) {
|
||||||
zval_ptr_dtor(¶ms[0]);
|
|
||||||
zend_string_release_ex(http_body, 0);
|
zend_string_release_ex(http_body, 0);
|
||||||
ZVAL_COPY_VALUE(return_value, &retval);
|
ZVAL_COPY_VALUE(return_value, &retval);
|
||||||
} else {
|
} else {
|
||||||
zval_ptr_dtor(¶ms[0]);
|
|
||||||
zval_ptr_dtor(&retval);
|
zval_ptr_dtor(&retval);
|
||||||
efree(content_encoding);
|
efree(content_encoding);
|
||||||
zend_string_release_ex(http_headers, 0);
|
zend_string_release_ex(http_headers, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user