Skip to content

Minor soap compressed response cleanups #19015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
soap: Avoid redundant copying of http body string
  • Loading branch information
nielsdos committed Jul 2, 2025
commit c6114a1d382e09eb49450ff9c26331a6da8838fe
6 changes: 2 additions & 4 deletions ext/soap/php_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,10 +1303,10 @@ int make_http_soap_request(zval *this_ptr,
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);
Expand All @@ -1319,11 +1319,9 @@ int make_http_soap_request(zval *this_ptr,
}
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);
Expand Down