Bug #61423 [Opn->Csd]: gzip compression fails
| From: | iliaa@php.net | Date: | Sun, 18 Mar 2012 15:15:47 +0000 |
| Subject: | Bug #61423 [Opn->Csd]: gzip compression fails | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-168582@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61423&edit=1
ID: 61423
Updated by: iliaa@php.net
Reported by: borrible13th at gmx dot net
Summary: gzip compression fails
-Status: Open
+Status: Closed
Type: Bug
Package: SOAP related
Operating System: ALL
PHP Version: 5.4.0
-Assigned To:
+Assigned To: iliaa
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2012-03-17 02:01:29] borrible13th at gmx dot net
Description:
------------
SOAP fails to compress with gzip encoding (compression level greater 0): it warns
"encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or
ZLIB_ENCODING_DEFLATE" and throws SoapFault with "SoapClient::__doRequest()
returned non string value".
Cause: Zlib introduces new constants ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP,
ZLIB_ENCODING_DEFLATE and redefines FORCE_GZIP as ZLIB_ENCODING_GZIP and
FORCE_DEFLATE as ZLIB_ENCODING_DEFLATE.
In php_http.c, line 263ff. the call to gzencode is prepared with an hard coded
magic number (1) for the gzip encoding: gzencode(data, level, 1).
It should be gzencode(data, level, FORCE_GZIP) or gzencode(data, level,
ZLIB_ENCODING_GZIP), because the magic number is now defined as 0x1f (31).
Test script:
---------------
new SoapClient($wsdl, array('soap_version' => SOAP_1_2, 'compression' =>
SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 1 ));
Expected result:
----------------
Call gzencode(data, level, FORCE_GZIP) (or gzencode(data, level,
ZLIB_ENCODING_GZIP)), so it returns compressed data.
Actual result:
--------------
gzencode(data, level, 1) is called, so it returns always false and warns "encoding
mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or
ZLIB_ENCODING_DEFLATE".
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61423&edit=1