Re: [hybi] frame length encoding

Scott Ferguson <ferg@caucho.com> Fri, 20 August 2010 19:48 UTC

Return-Path: <ferg@caucho.com>
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 C815D3A6ABD for <hybi@core3.amsl.com>; Fri, 20 Aug 2010 12:48:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.495
X-Spam-Level:
X-Spam-Status: No, score=-2.495 tagged_above=-999 required=5 tests=[AWL=0.104, 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 E7M4SOi43LOp for <hybi@core3.amsl.com>; Fri, 20 Aug 2010 12:48:00 -0700 (PDT)
Received: from smtp113.biz.mail.mud.yahoo.com (smtp113.biz.mail.mud.yahoo.com [209.191.68.78]) by core3.amsl.com (Postfix) with SMTP id CCD5E3A6ABC for <hybi@ietf.org>; Fri, 20 Aug 2010 12:48:00 -0700 (PDT)
Received: (qmail 42717 invoked from network); 20 Aug 2010 19:48:27 -0000
Received: from [192.168.1.11] (ferg@66.92.8.203 with plain) by smtp113.biz.mail.mud.yahoo.com with SMTP; 20 Aug 2010 12:48:27 -0700 PDT
X-Yahoo-SMTP: L1_TBRiswBB5.MuzAo8Yf89wczFo0A2C
X-YMail-OSG: UvL0tgAVM1npYIfPDlB72texHXu8Pg0VXCXFYUmYpSUMHSD 01lPFsjqJuP4okaC7CdzU019_kkpqLogoVZm7WfXJzzIkOK67t3pQImlt785 rICxMf0nLZJiGVkJ2PX.H.0rV19c73dPdTAP8HmfIM6l3.M4jdmb8a19Vk97 A5ee_kvcy3OgzsdWl8XZso6pUYASWugYc.9e4u0q3YXZ0l4o1gp9sUm63NPO xf93saAYcG4QL1O_FA_MejQyrMKIZHVcXPJtAAfgV1j_b5EpteWb_iXwwMES 5e.KHZBGLm1D0HCgddsmapc8q
X-Yahoo-Newman-Property: ymail-3
Message-ID: <4C6EDC05.7030501@caucho.com>
Date: Fri, 20 Aug 2010 12:48:21 -0700
From: Scott Ferguson <ferg@caucho.com>
User-Agent: Thunderbird 2.0.0.24 (X11/20100411)
MIME-Version: 1.0
To: Willy Tarreau <w@1wt.eu>
References: <AANLkTimKbmcpgx8k0uXUWvCO=8w9pPrtV=3y4qh6363k@mail.gmail.com> <20100820192927.GA32620@1wt.eu>
In-Reply-To: <20100820192927.GA32620@1wt.eu>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] frame length encoding
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: Fri, 20 Aug 2010 19:48:01 -0000

Willy Tarreau wrote:
> Hi John,
>
> On Fri, Aug 20, 2010 at 03:08:08PM -0400, John Tamplin wrote:
>   
>> Option 2
>> ========
>> Use 7 bits in the frame header, and if the value is 0-125, that is the
>> length.  If the value is 126, then the next 2 bytes are a 16-bit length.  If
>> the value is 127, the next 8 bytes are a 63-bit length (the high bit must be
>> zero).
>>
>> long long len = readByte();
>> switch (len) {
>>   case 126:
>>     len = readUnsignedShort();
>>     break;
>>   case 127:
>>     len = readLongLong();
>>     break;
>> }
>>     
>
> This looks really nice and optimal to me !
>
> +1 !
>   

+1

Looks good to me.

-- Scott

> Willy
>
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi
>
>
>
>