Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55987 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16118 invoked from network); 28 Oct 2011 21:03:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Oct 2011 21:03:44 -0000 Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-ww0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:52738] helo=mail-ww0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3B/21-09454-FA81BAE4 for ; Fri, 28 Oct 2011 17:03:43 -0400 Received: by wwe5 with SMTP id 5so5818709wwe.11 for ; Fri, 28 Oct 2011 14:03:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=H+WC2abOOlxZOjv0Sj+LItUy55jIdLj5lvsgHOSw0/M=; b=dW5w2V4fAbwsG7iUhuzjjVPqqoiZMdIjOzafQi65W9uA2h+YOPrCcoPNy0fgyOlUGz /cvjSP5Vns3JYiyb/nK0c+L+uiP5wpvpakZ9aX5/aqSNrOJS2tOHzEXXwy0iqEYx+59K 9n3zyZ/452kS9sDETpm/rlM6e/sNK8Z0B0nF0= Received: by 10.227.58.17 with SMTP id e17mr5823868wbh.18.1319835820355; Fri, 28 Oct 2011 14:03:40 -0700 (PDT) Received: from [192.168.1.26] (150.Red-83-61-177.dynamicIP.rima-tde.net. [83.61.177.150]) by mx.google.com with ESMTPS id fy21sm260035wbb.5.2011.10.28.14.03.38 (version=SSLv3 cipher=OTHER); Fri, 28 Oct 2011 14:03:39 -0700 (PDT) Message-ID: <4EAB1984.6090503@gmail.com> Date: Fri, 28 Oct 2011 23:07:16 +0200 User-Agent: Thunderbird MIME-Version: 1.0 To: Reindl Harald CC: internals@lists.php.net References: <54.F3.59786.60F6AAE4@pb1.pair.com> <4EAACA52.8040904@thelounge.net> In-Reply-To: <4EAACA52.8040904@thelounge.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Changed behaviour of gzencode in PHP-5.4 From: keisial@gmail.com (=?UTF-8?B?w4FuZ2VsIEdvbnrDoWxleg==?=) Am 28.10.11 17:29, Reindl Harald schrieb: > Am 28.10.2011 10:59, schrieb Michael Wallner: >> gzencode in PHP-5.4 behaves differently than in previous versions. >> I outlined the reasoning in the comment from 2009-03-03 22:11 UTC >> at http://bugs.php.net/47178 > as long gzdecode() can decode stored data from previous versions > without destroy the binary this should not be a big deal WHAT? zlib format is not something php made up (more exactly, it's RFC 1950). There's compatibility with other software implementing the algorithm. The behavior change probably happened on r299980, when it was rewritten: http://svn.php.net/viewvc/php/php-src/branches/PHP_5_4/ext/zlib/zlib.c?r1=298625&r2=299980 The PHP 5.4 behavior seems more correct, as I can inflate it fine, while on 5.3.8 it fails with "incorrect header check". The old behavior seems explained in http://us.php.net/manual/en/function.gzencode.php#20411 It added a 10-byte gzip header. Given that there's code expecting that (doing a substr(gzencode(), 10)), I think it should be readded again, with maybe a new DEFLATE_NO_GZIP_HEADER option to keep what is now FORCE_DEFLATE (that could also be done through the new zlib_encode, depends how it turns out).