Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.4

Bug #10790 false error : _decodeGzip(): data CRC check failed
Submitted: 2007-04-21 02:29 UTC Modified: 2007-05-18 05:42 UTC
From: remicollet Assigned: avb
Status: Closed Package: HTTP_Request (version 1.4.0)
PHP Version: 5.2.1 OS: Fedora Core 6 (x86_64)
Roadmaps: 1.4.1    

 [2007-04-21 02:29 UTC] remicollet (Remi Collet)
Description: ------------ In some case this error is return (while all is ok). In the example below, CRC is 2180175905 But unpack return -2114791391 Test : # php -r 'print_r(unpack("V",pack("V",2180175905)));' Array ( [1] => -2114791391 ) See Test script: --------------- require "HTTP/Request.php"; $request = &new HTTP_Request("".urlencode("Reims, France")); $status = $request->sendRequest(); if (PEAR::isError($status)) echo "ERROR: " . $status->getMessage() . "\n"; else echo "OK.\n"; Expected result: ---------------- OK. Actual result: -------------- ERROR: _decodeGzip(): data CRC check failed


 [2007-04-21 04:00 UTC] remicollet (Remi Collet)
This bug is 64 bits only. On 32 bits, crc32 return a < 0 value, so it's ok. So my patch is not working. Must investigate for another solution.
 [2007-04-21 04:27 UTC] remicollet (Remi Collet)
A working solution (test on i386 and x86_64) : Request.php, line 1382 if ($dataCrc<0 && PHP_INT_SIZE>4) $dataCrc += 4294967296; Hope that helps.
 [2007-04-27 13:57 UTC] remicollet (Remi Collet)
Also read : (crc32 32/64 bits issue)
 [2007-05-02 15:11 UTC] avb (Alexey Borzov)
Per report of Bill Moran (wmoran at collaborativefusion dot com) on pear-dev the following fix works: } elseif ((0xffffffff & $dataCrc) != (0xffffffff & crc32($unpacked))) { while the one proposed in doesn't.
 [2007-05-18 05:42 UTC] avb (Alexey Borzov)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.