Re: [hybi] deflate-stream and masking

Dirkjan Ochtman <dirkjan@ochtman.nl> Mon, 20 June 2011 08:38 UTC

Return-Path: <djc.ochtman@gmail.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 5C30011E80FE for <hybi@ietfa.amsl.com>; Mon, 20 Jun 2011 01:38:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.927
X-Spam-Level:
X-Spam-Status: No, score=-2.927 tagged_above=-999 required=5 tests=[AWL=0.050, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pLIDFa1UASzY for <hybi@ietfa.amsl.com>; Mon, 20 Jun 2011 01:38:03 -0700 (PDT)
Received: from mail-qy0-f172.google.com (mail-qy0-f172.google.com [209.85.216.172]) by ietfa.amsl.com (Postfix) with ESMTP id C585511E80E9 for <hybi@ietf.org>; Mon, 20 Jun 2011 01:38:03 -0700 (PDT)
Received: by qyk9 with SMTP id 9so1616615qyk.10 for <hybi@ietf.org>; Mon, 20 Jun 2011 01:38:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:from :date:x-google-sender-auth:message-id:subject:to:cc:content-type; bh=BENbKXcQ70TeknU/9gitffcit7Bu7ImcyVp0nFKUwSk=; b=XuZOTwKniPRB9TYZ6GLUlqG3jLH+h4hLKao9nb0Vl0/X71TXGgxmwvXaTUpkQMtRTm 5abdzPu5cMSO9vWR5AI5lgW+aM43ZQ8wgS/poXtJ6qA0prcQY85q/LOXxmIFfT1gN0D1 2hn1WfZGBO0OsS8o0WXNeaIS38fRL7zeh83bU=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=NrOjInCQ0vhuEqOQR+qeBsIN11xOIcDaOBUBiJqlrFngXuQ8tDGFMP8Sl3mjMRHpP4 aWC7Uf4YkwDFl13jEF2sTx+Sz92yorzLvUsT79hrNvy6+MRb/3jpEs8tUGdrY+kfg5aU U8s3rZ6b18lUdpZ14C8jnce90MsflyvLVAx/0=
Received: by 10.229.91.15 with SMTP id k15mr3763538qcm.157.1308559083087; Mon, 20 Jun 2011 01:38:03 -0700 (PDT)
MIME-Version: 1.0
Sender: djc.ochtman@gmail.com
Received: by 10.229.89.67 with HTTP; Mon, 20 Jun 2011 01:37:43 -0700 (PDT)
In-Reply-To: <BANLkTi=UVMAd1nER6mRBe7zoD29CSbCkGA@mail.gmail.com>
References: <BANLkTi=UVMAd1nER6mRBe7zoD29CSbCkGA@mail.gmail.com>
From: Dirkjan Ochtman <dirkjan@ochtman.nl>
Date: Mon, 20 Jun 2011 10:37:43 +0200
X-Google-Sender-Auth: uJzCVNRLy83nKSxINgThmZjCFtI
Message-ID: <BANLkTikzTaUgtVQ2k9tnN5bKXwY0nt=ZKw@mail.gmail.com>
To: Greg Wilkins <gregw@intalio.com>
Content-Type: text/plain; charset="UTF-8"
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] deflate-stream and masking
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: Mon, 20 Jun 2011 08:38:04 -0000

On Mon, Jun 20, 2011 at 08:33, Greg Wilkins <gregw@intalio.com> wrote:
> As an unmasked WS stream, it was 50675 bytes, and as a masked stream
> is was 52623 bytes.
> I then compressed both these streams with gzip and got 13306 bytes for
> unmasked and 51704 bytes for the masked!!!!

Are you sure you got this right? From the RFC:

"The masking does not affect the length of the payload data."

Which means it's a little strange that your unmasked WS stream has a
different size from the masked stream.

(Still, it's fairly intuitive that masking would result in worse
compression, so I would tend to agree that compress-then-mask
makes more sense than mask-then-compress.)

Cheers,

Dirkjan