Re: [hybi] Restarting IESG review on permessage-deflate

Takeshi Yoshino <tyoshino@google.com> Sat, 05 October 2013 01:19 UTC

Return-Path: <tyoshino@google.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8365621F9CC0 for <hybi@ietfa.amsl.com>; Fri, 4 Oct 2013 18:19:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[AWL=-0.000, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, NO_RELAYS=-0.001]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n9naaFjLModM for <hybi@ietfa.amsl.com>; Fri, 4 Oct 2013 18:19:33 -0700 (PDT)
Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [IPv6:2a00:1450:400c:c05::22d]) by ietfa.amsl.com (Postfix) with ESMTP id A053521F9CAF for <hybi@ietf.org>; Fri, 4 Oct 2013 18:19:32 -0700 (PDT)
Received: by mail-wi0-f173.google.com with SMTP id hq15so2459601wib.12 for <hybi@ietf.org>; Fri, 04 Oct 2013 18:19:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=4vxfq3cBB2UaKWXpJfYKUiHOgNf0Y4+eabY9fkxe+SU=; b=Ux5GYecaOVcYfn8v14o9JqEbiXDicv76GUUpK3gwBPQJMM1kbWYm07e+33pY0gf+RA d/16iCZuMFGxC4ui1vAbaE1gr2RkfwPKu9oIXKGwJSDxOmek8djnACpgB3zgfaOaWf2S XuLpptbhZ7kn2W9PrRJ00zqf8p+ReXrsG6eaSKErnghmxR3pkQtVif3gr5q8u2j8OhR+ qoSRunuLHiyuCPtTHG2C6NpUFP/FYxbETvhI/JpUN5yawEsmSsz6VuYluLtMDr+PyttR e8OIVp328aZUHhB1Zdasmt6PQgPyS/Ah1UcNNbhiuOEYe6jH4WAdO2aj1/Oep3tryFOc 7aEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=4vxfq3cBB2UaKWXpJfYKUiHOgNf0Y4+eabY9fkxe+SU=; b=PIAnzYWAmNGsq/pffi3u2BOuk+Qw2Qp2ZCSzp/1q8rUc8AhAepveoTankSNT0HUSYK 4W4UDPPfv6F+TjaQXG83dRR0fVqy9Ckp/74qq3RErZ+Oq45NRfKh+z5qnIYSkTo01Ttf 6V+Bi+Ia5DiH4pKnbJ1G33Cy1q4OMMci9nzwUQ6rZiQezhCAFqa7f5LJY4V4Xif6YZVW +PNRvVI+0CZR6Gt0qohs6HTHAygsmHpGdphSHeoN6vRnrJ8JZBOvV1Ek5WfOUlhsQ6DG exHyBnvtvPhsuo+uBGSzPZY/ezPpbhx6vWlRctWGpfG1woa7MkskA93YJsdbT05XlDc3 0nKA==
X-Gm-Message-State: ALoCoQkiDUvJ9CjYDF/QQud5FFLowlx/RgudQLkbThswuylVhHnxG791tRzMbjAf9h0fPquk5B8wYYLJXEZELy4Goxey3gV7u5QWgU043/mezcOJusUMdbuTxSWIu22Icg+3xsQ2xAEh/kDtIYw3VgEJLF0SV1diGe+w4724thjt84OorzB7JkEFU46HnU/SKbZGgs7DVyzH
X-Received: by 10.180.99.99 with SMTP id ep3mr9736553wib.11.1380935971440; Fri, 04 Oct 2013 18:19:31 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.194.15.133 with HTTP; Fri, 4 Oct 2013 18:19:11 -0700 (PDT)
In-Reply-To: <CAH9hSJY84nbzv62-b3v-rnJf58qc4MWi8uNJSWFGw24kWYyrSw@mail.gmail.com>
References: <CAH9hSJbwd5qhMJw=3dwk3CDPua5ENRksd9=q2KDcyyma3uKzZg@mail.gmail.com> <CAG4zZZD8eq4w9kyQbX2AJcM1LA8=UyRO7txK7TvmYhSp=YU+9g@mail.gmail.com> <CAH9hSJY84nbzv62-b3v-rnJf58qc4MWi8uNJSWFGw24kWYyrSw@mail.gmail.com>
From: Takeshi Yoshino <tyoshino@google.com>
Date: Sat, 05 Oct 2013 10:19:11 +0900
Message-ID: <CAH9hSJYPfMXdcbLnnYn9+Mp4Du9SYMGnPdiXMczg8jEGFjh8-A@mail.gmail.com>
To: Joakim Erdfelt <joakim@intalio.com>
Content-Type: multipart/alternative; boundary="f46d044283c009315f04e7f43624"
Cc: "hybi@ietf.org" <hybi@ietf.org>, Gabriel Montenegro <Gabriel.Montenegro@microsoft.com>
Subject: Re: [hybi] Restarting IESG review on permessage-deflate
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 05 Oct 2013 01:19:33 -0000

On Sat, Oct 5, 2013 at 4:17 AM, Takeshi Yoshino <tyoshino@google.com> wrote:

>
>  This level of control of the deflate algorithm is just not possible in
>> Java, sorry.
>>
>>
> Again, please explain why you can't support no_context_takeover family
> parameter.
>
>

I tried using java.util.zip.Deflater and Inflater.

For compressing, used deflate() and finish() method. We need to strip a
ZLIB header (CMF and FLG) of 2 bytes at the head and an Adler 32 footer of
4 bytes at the tail from output.

For decompressing, we need to prepend a ZLIB header (CMF of 0x78 and FLG of
0x9c (some FLEVEL, FDICT=0, appropriate FCHECK)). Used inflate() method
until getRemaining() becomes 0. If we want to see Inflater.finished()
returning true to make sure all data is processed, append a block with
BFINAL e.g. 0x01 0x00 0x00 0xFF 0xFF (after appending 0x00 0x00 0xFF 0xFF
as specified in the I-D) and a valid Adler 32 footer (use
java.util.zip.Adler32).