[PATCH v2] Gzip: use zlib to write header and trailer

Maxim Dounin mdounin at mdounin.ru
Fri Jul 12 19:29:24 UTC 2019


Hello!

On Fri, Jul 12, 2019 at 01:04:51PM +0200, Ilya Leoshkevich wrote:

> # HG changeset patch
> # User Ilya Leoshkevich <iii at linux.ibm.com>
> # Date 1562928188 -7200
> #      Fri Jul 12 12:43:08 2019 +0200
> # Node ID 0a056523895149d727a703242f2e2b579cfec9da
> # Parent  97ce2512373d7278f765f587d4cf087065a55e7c
> Gzip: use zlib to write header and trailer
> 
> When nginx is used with zlib patched with [1], which provides
> integration with the future IBM Z hardware deflate acceleration, it ends
> up computing CRC32 twice: one time in hardware, which always does this,
> and one time in software by explicitly calling crc32().
> 
> crc32() calls were added in changesets 133:b27548f540ad ("nginx-0.0.1-
> 2003-09-24-23:51:12 import") and 134:d57c6835225c ("nginx-0.0.1-
> 2003-09-26-09:45:21 import") as part of gzip wrapping feature - back
> then zlib did not support it.
> 
> However, since then gzip wrapping was implemented in zlib v1.2.0.4,
> and it's already being used by nginx for log compression.
> 
> This patch replaces hand-written gzip wrapping with the one provided by
> zlib. It simplifies the code, and makes it avoid computing CRC32 twice
> when using hardware acceleration.
> 
> [1] https://github.com/madler/zlib/pull/410
> 
> v1->v2: Resent in hg format, replaced git mirror commit references to hg
>  changeset references in the commit message. The code is unchanged.

[...]

Committed (with minor changes), thanks.

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx-devel mailing list