Re: [hybi] hum #3: Message

Scott Ferguson <ferg@caucho.com> Fri, 06 August 2010 16:01 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 E9F0F28C10C for <hybi@core3.amsl.com>; Fri, 6 Aug 2010 09:01:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[AWL=0.000, 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 FnfU26A+3Ix2 for <hybi@core3.amsl.com>; Fri, 6 Aug 2010 09:01:14 -0700 (PDT)
Received: from smtp113.biz.mail.re2.yahoo.com (smtp113.biz.mail.re2.yahoo.com [66.196.116.98]) by core3.amsl.com (Postfix) with SMTP id 111D928C0F3 for <hybi@ietf.org>; Fri, 6 Aug 2010 09:01:13 -0700 (PDT)
Received: (qmail 82440 invoked from network); 6 Aug 2010 16:01:41 -0000
Received: from [192.168.1.11] (ferg@66.92.8.203 with plain) by smtp113.biz.mail.re2.yahoo.com with SMTP; 06 Aug 2010 09:01:41 -0700 PDT
X-Yahoo-SMTP: L1_TBRiswBB5.MuzAo8Yf89wczFo0A2C
X-YMail-OSG: l6.b8p4VM1mgsgf05QsoKEsM_TCdTKTiGyflwlGcW8Bxvsl _K96339.as6ohHZVi1QBdd5d0DF8JifaH28eTS7FerBBenRi14g2AfNXuI1t rC4ZRKcDsewt7jsDHE8w8LK5Lckc.6lMGb2jOBwpcj16IGNe6f3FEbwUEHog q1qMgf__VNeO0h_UO0ACytSUKlrWilrNXn0D4byIfE8w6wZv0Q0gMjiwvSZ3 _ErgbiavxcrzXvAcV9GYd_cn1tWELSlo2d_L7QZ88DRqSZhf1VsQmLxouO7M WB4ljf_SvPOFVAeGvFdadmsrJU35vQ2RFi.Bc8sZBmI4u_OsEzqGny_6ghnf 1oEZyIqIR7jQS8JVMLJCg89XbyypFZ562G7_L8.4LcSu.9aNTxekAcSB0fIB ZfiRVwkNMo_9R3QOFtA--
X-Yahoo-Newman-Property: ymail-3
Message-ID: <4C5C31DF.3030608@caucho.com>
Date: Fri, 06 Aug 2010 09:01:35 -0700
From: Scott Ferguson <ferg@caucho.com>
User-Agent: Thunderbird 2.0.0.24 (X11/20100411)
MIME-Version: 1.0
To: John Tamplin <jat@google.com>
References: <4C5AE93D.4040803@ericsson.com> <Pine.LNX.4.64.1008051758290.5947@ps20323.dreamhostps.com> <AANLkTik0kbh14s2JZARY2MFh0iNGV7H+B4Px4yG+wX44@mail.gmail.com> <71BCE4BF-D3F6-4F94-BE76-306BDF6A2E67@apple.com> <Pine.LNX.4.64.1008051930160.5947@ps20323.dreamhostps.com> <4C5B1695.6070704@gmx.de> <F8E2F702-9F74-4316-B3B2-D5A731409ABF@apple.com> <AANLkTin=gO9D8K5NVhqCRKki-jrDmTYqF-gBjp9X41GN@mail.gmail.com> <4C5BF15E.1090608@noemax.com> <AANLkTinXLPmBACd3ji0V9wkAWmxOR7qBMED19KKMvJrd@mail.gmail.com> <AANLkTi=RWdqDDgy24C6qtUSr+5R5p=P15B=+aUZuE16Q@mail.gmail.com> <4C5C07D6.1030208@noemax.com> <AANLkTimj9RvzL8E+FmH=vT_TeECVNmDPXY0ymPnvBHSZ@mail.gmail.com>
In-Reply-To: <AANLkTimj9RvzL8E+FmH=vT_TeECVNmDPXY0ymPnvBHSZ@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Cc: "hybi@ietf.org" <hybi@ietf.org>
Subject: Re: [hybi] hum #3: Message
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, 06 Aug 2010 16:01:15 -0000

John Tamplin wrote:
> What about the following:
>
>     * 8 bits - short length
>     * [if length = 255: 8 bytes - length]
>     * [if Initial = 1 and Final = 0: 8 bytes - overall message length,
>       with 0 meaning "unknown"]
>     * length bytes of payload
>

As a practical matter, a 16-bit short length would be better because 
buffer sizes are typically in the 1k to 64k range, and a 16-bit length 
lets the implementation pre-allocate the frame header for any message/chunk.

With an 8-bit length, the implementation either needs to shift bytes in 
the buffer when the message is 255 bytes long or it needs to preallocate 
the long frame header.

-- Scott