]> granicus.if.org Git - php/commitdiff
Fixed bug #36283 (SOAPClient Compression Broken).
authorDmitry Stogov <dmitry@php.net>
Mon, 6 Feb 2006 10:16:03 +0000 (10:16 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 6 Feb 2006 10:16:03 +0000 (10:16 +0000)
NEWS
ext/soap/php_http.c

diff --git a/NEWS b/NEWS
index 496b59411905bcf6704249d3e6ffaf4c9687827a..bdabf8cdf76af39f72c6facbd7f461ba65c8a27c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ PHP                                                                        NEWS
   on error. (Pierre)
 - Fixed bug #36295 (typo in SplFileObject::flock() parameter name). (Tony)
 - Fixed bug #36287 (Segfault with SplFileInfo conversion). (Marcus)
+- Fixed bug #36283 (SOAPClient Compression Broken). (Dmitry)
 - Fixed bug #36268 (Object destructors called even after fatal errors). (Dmitry)
 - Fixed bug #36258 (SplFileObject::getPath() may lead to segfault). (Tony)
 - Fixed bug #36242 (Possible memory corruption in stream_select()). (Tony)
index 5ccb287e88706f7fe8fe309f2ab11355c039644d..2e5ea04fa66b73ffa2f5005691fc2db4c4f36f76 100644 (file)
@@ -223,6 +223,7 @@ int make_http_soap_request(zval  *this_ptr,
 {
        char *request;
        smart_str soap_headers = {0};
+       smart_str soap_headers_z = {0};
        int request_size, err;
        php_url *phpurl = NULL;
        php_stream *stream;
@@ -250,7 +251,7 @@ int make_http_soap_request(zval  *this_ptr,
                int kind  = Z_LVAL_PP(tmp) & SOAP_COMPRESSION_DEFLATE;
 
          if ((Z_LVAL_PP(tmp) & SOAP_COMPRESSION_ACCEPT) != 0) {
-                       smart_str_append_const(&soap_headers,"Accept-Encoding: gzip, deflate\r\n");
+                       smart_str_append_const(&soap_headers_z,"Accept-Encoding: gzip, deflate\r\n");
          }
          if (level > 0) {
                        zval func;
@@ -270,11 +271,11 @@ int make_http_soap_request(zval  *this_ptr,
            if (kind == SOAP_COMPRESSION_DEFLATE) {
                n = 2;
                                ZVAL_STRING(&func, "gzcompress", 0);
-                               smart_str_append_const(&soap_headers,"Content-Encoding: deflate\r\n");
+                               smart_str_append_const(&soap_headers_z,"Content-Encoding: deflate\r\n");
            } else {
              n = 3;
                                ZVAL_STRING(&func, "gzencode", 0);
-                               smart_str_append_const(&soap_headers,"Content-Encoding: gzip\r\n");
+                               smart_str_append_const(&soap_headers_z,"Content-Encoding: gzip\r\n");
                                ZVAL_LONG(params[2], 1);
            }
                        if (call_user_function(CG(function_table), (zval**)NULL, &func, &retval, n, params TSRMLS_CC) == SUCCESS &&
@@ -413,13 +414,17 @@ try_again:
                        smart_str_appendc(&soap_headers, ':');
                        smart_str_append_unsigned(&soap_headers, phpurl->port);
                }
-               smart_str_append_const(&soap_headers, "\r\n"
+                               smart_str_append_const(&soap_headers, "\r\n"
                        "Connection: Keep-Alive\r\n"
 /*
                        "Connection: close\r\n"
                        "Accept: text/html; text/xml; text/plain\r\n"
 */
                        "User-Agent: PHP SOAP 0.1\r\n");
+
+               smart_str_append(&soap_headers, &soap_headers_z);
+               smart_str_free(&soap_headers_z);
+
                if (soap_version == SOAP_1_2) {
                        smart_str_append_const(&soap_headers,"Content-Type: application/soap+xml; charset=utf-8");
                        if (soapaction) {