Re: [hybi] thewebsocketprotocol #40 (new): Clarify binary/utf-8 mixed handling

John Tamplin <jat@google.com> Thu, 10 February 2011 20:29 UTC

Return-Path: <jat@google.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 DEF963A6838 for <hybi@core3.amsl.com>; Thu, 10 Feb 2011 12:29:11 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.9
X-Spam-Level:
X-Spam-Status: No, score=-102.9 tagged_above=-999 required=5 tests=[AWL=-0.076, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1, SARE_SUB_ENC_UTF8=0.152, USER_IN_WHITELIST=-100]
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 yjZarGi7lo3P for <hybi@core3.amsl.com>; Thu, 10 Feb 2011 12:29:10 -0800 (PST)
Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.67]) by core3.amsl.com (Postfix) with ESMTP id D3C6D3A69BC for <hybi@ietf.org>; Thu, 10 Feb 2011 12:29:09 -0800 (PST)
Received: from hpaq6.eem.corp.google.com (hpaq6.eem.corp.google.com [172.25.149.6]) by smtp-out.google.com with ESMTP id p1AKTMx4029326 for <hybi@ietf.org>; Thu, 10 Feb 2011 12:29:22 -0800
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1297369762; bh=V7ELgaMad7eOBs9TfuQhZBRdwQE=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=rir20h5e8VZVOgevDHgiMsTHvhqLHkk29GeGXKRORuO/7pBeGGEdLdq4LEx1fZEW8 HlP1aai04FLiM/vr9YNsQ==
Received: from yxd30 (yxd30.prod.google.com [10.190.1.222]) by hpaq6.eem.corp.google.com with ESMTP id p1AKTKwP007940 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for <hybi@ietf.org>; Thu, 10 Feb 2011 12:29:21 -0800
Received: by yxd30 with SMTP id 30so811970yxd.11 for <hybi@ietf.org>; Thu, 10 Feb 2011 12:29:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=npV3rf5xJCU8Qhlpip3qh6fn2PD4rmKI/BLsQ3nv7Bs=; b=D9ilJaslNWPJnHVxMhcbgYcpl/mBl7zFtDSinrRgwFuA5TLKPNvALYDDk9jm+Dlnw+ Kfp67d04hA6Yov9iaJ5A==
DomainKey-Signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=Gd6PlWER99hHnhbWOX1agq3mfP1oBnYqoVlFH9bJT9v8xL+F3B4+rFKF7CR8YkrkW+ vy6AjkObn1cr5gJBCXXg==
Received: by 10.151.42.8 with SMTP id u8mr3981894ybj.320.1297369759958; Thu, 10 Feb 2011 12:29:19 -0800 (PST)
MIME-Version: 1.0
Received: by 10.150.206.19 with HTTP; Thu, 10 Feb 2011 12:28:59 -0800 (PST)
In-Reply-To: <CA566BAEAD6B3F4E8B5C5C4F61710C1126E0501B@TK5EX14MBXW605.wingroup.windeploy.ntdev.microsoft.com>
References: <063.e489b6d352cc1192d00acf7f96150ea7@tools.ietf.org> <buc6l61vlv7fh3s8nmu335g3d7897pcf0r@hive.bjoern.hoehrmann.de> <CA566BAEAD6B3F4E8B5C5C4F61710C1126E0501B@TK5EX14MBXW605.wingroup.windeploy.ntdev.microsoft.com>
From: John Tamplin <jat@google.com>
Date: Thu, 10 Feb 2011 15:28:59 -0500
Message-ID: <AANLkTinsXn=re_Ksr_wQdz4pyW2iXtUzBRz+nPYJtD-z@mail.gmail.com>
To: Gabriel Montenegro <Gabriel.Montenegro@microsoft.com>
Content-Type: multipart/alternative; boundary="001517510db0af45e5049bf36f5b"
X-System-Of-Record: true
Cc: "hybi@ietf.org" <hybi@ietf.org>, Bjoern Hoehrmann <derhoermi@gmx.net>
Subject: Re: [hybi] thewebsocketprotocol #40 (new): Clarify binary/utf-8 mixed handling
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: Thu, 10 Feb 2011 20:29:12 -0000

On Thu, Feb 10, 2011 at 4:47 AM, Gabriel Montenegro <
Gabriel.Montenegro@microsoft.com> wrote:

> Yes, if one accepts UTF-8, that must be validated, no question about it.
> The point is not to disallow UTF-8, but to be able to optimize on those
> websocket connections that use binary only, so this is not a fragmenting of
> the protocol any more than any other per-session negotiable feature is.
>
> From the comments, folks seem to be thinking about Javascript Websockets
> API, and how it does not allow binary nor support streaming. That's true,
> but as we've emphasized before: we're designing the websockets protocol to
> be usable with the JS Websockets API, but is not limited to it. Other APIs
> may offer both binary and streaming.


Ok, but what exactly is the benefit of having a binary-only negotiation?
 Your implementation is always free to make assumptions about the frames
that are sent by another of your implementations, so if you want to fail the
connection on any text frame that is ok.

If you mean that you would swap out a different state machine for
binary-only connections, then why is it not sufficient to choose that state
machine based on the opcode of the first frame?

-- 
John A. Tamplin
Software Engineer (GWT), Google