Re: [hybi] Frame size

Ian Hickson <ian@hixie.ch> Mon, 19 April 2010 04:04 UTC

Return-Path: <ian@hixie.ch>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id D8BC53A6817 for <hybi@core3.amsl.com>; Sun, 18 Apr 2010 21:04:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.983
X-Spam-Level:
X-Spam-Status: No, score=-1.983 tagged_above=-999 required=5 tests=[AWL=0.616, BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9l8HJZLys0I8 for <hybi@core3.amsl.com>; Sun, 18 Apr 2010 21:04:09 -0700 (PDT)
Received: from looneymail-a2.g.dreamhost.com (caibbdcaaaaf.dreamhost.com [208.113.200.5]) by core3.amsl.com (Postfix) with ESMTP id 081383A6808 for <hybi@ietf.org>; Sun, 18 Apr 2010 21:04:09 -0700 (PDT)
Received: from ps20323.dreamhostps.com (ps20323.dreamhost.com [69.163.222.251]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by looneymail-a2.g.dreamhost.com (Postfix) with ESMTP id A72E116D43A; Sun, 18 Apr 2010 21:04:00 -0700 (PDT)
Date: Mon, 19 Apr 2010 04:04:00 +0000
From: Ian Hickson <ian@hixie.ch>
To: "Thomson, Martin" <Martin.Thomson@andrew.com>
In-Reply-To: <8B0A9FCBB9832F43971E38010638454F03E7D06824@SISPE7MB1.commscope.com>
Message-ID: <Pine.LNX.4.64.1004190359410.751@ps20323.dreamhostps.com>
References: <8B0A9FCBB9832F43971E38010638454F03E3F313ED@SISPE7MB1.commscope.com> <Pine.LNX.4.64.1004161940180.751@ps20323.dreamhostps.com> <8B0A9FCBB9832F43971E38010638454F03E7D0678C@SISPE7MB1.commscope.com> <Pine.LNX.4.64.1004190009190.751@ps20323.dreamhostps.com> <8B0A9FCBB9832F43971E38010638454F03E7D067A9@SISPE7MB1.commscope.com> <Pine.LNX.4.64.1004190159340.751@ps20323.dreamhostps.com> <8B0A9FCBB9832F43971E38010638454F03E7D06824@SISPE7MB1.commscope.com>
Content-Language: en-GB-hixie
Content-Style-Type: text/css
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset="US-ASCII"
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] Frame size
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/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, 19 Apr 2010 04:04:10 -0000

On Mon, 19 Apr 2010, Thomson, Martin wrote:
> > >     this.buffer.send(prng.getNextBits(WS.FRAME_MARKER_LEN),
> > WS.FRAME_MARKER_LEN);
> >	
> > I don't understand how this solves the problem of people mismeasuring 
> > strings. (I don't really follow the pseudocode above, either.)
> 
> It does this (or significantly reduces the changes of this) by marking 
> the start of a frame with a known sequence.  This sequence could be 
> fixed, or it could be derived from a known sequence.  If this sequence 
> isn't found where it should be, there is an error.

Oh, I see. I think the behaviour of the protocol in the case of a length 
mistake today is pretty fatal already -- no need to add more catching 
code. (You get a bunch of invalid frames.) The best a client could do is 
abort anyway, and that doesn't seem especially graceful. (Ignoring the 
unknown frames is what the protocol does now.)

I thought your proposal was something that would reduce the chance of the 
error being made in the first place. That would be a good way of removing 
the need for sentinel-based framing.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'