From:             
Operating system: ALL
PHP version:      5.4.0
Package:          SOAP related
Bug Type:         Bug
Bug description:gzip compression fails

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 bug report at https://bugs.php.net/bug.php?id=61423&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=61423&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=61423&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=61423&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=61423&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=61423&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=61423&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=61423&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=61423&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=61423&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=61423&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=61423&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=61423&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=61423&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=61423&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=61423&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=61423&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=61423&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=61423&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=61423&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=61423&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=61423&r=mysqlcfg

Reply via email to