Bug #61423 [Csd]: gzip compression fails
| From: | borrible13th at gmx dot net | Date: | Mon, 19 Mar 2012 12:36:54 +0000 |
| Subject: | Bug #61423 [Csd]: gzip compression fails | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-168612@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
User updated by: borrible13th at gmx dot net
Reported by: borrible13th at gmx dot net
Summary: gzip compression fails
Status: Closed
Type: Bug
Package: SOAP related
Operating System: ALL
PHP Version: 5.4.0
Assigned To: iliaa
Block user comment: N
Private report: N
New Comment:
Can't see a bugfix in the source code whether in the branch for 5.4 or in the
trunk! The magic number (1) is still hard coded.
Do I miss something?
Previous Comments:
------------------------------------------------------------------------
[2012-03-18 15:15:47] iliaa@php.net
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.
------------------------------------------------------------------------
[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