Re: [hybi] Changing meaning of 1007 status code ("frame" => "message")
"Richard L. Barnes" <rbarnes@bbn.com> Tue, 06 September 2011 16:57 UTC
Return-Path: <rbarnes@bbn.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 33F5121F8B7A for <hybi@ietfa.amsl.com>; Tue, 6 Sep 2011 09:57:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.405
X-Spam-Level:
X-Spam-Status: No, score=-106.405 tagged_above=-999 required=5 tests=[AWL=-0.106, BAYES_00=-2.599, MIME_8BIT_HEADER=0.3, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ytzDPoP3A-tZ for <hybi@ietfa.amsl.com>; Tue, 6 Sep 2011 09:57:52 -0700 (PDT)
Received: from smtp.bbn.com (smtp.bbn.com [128.33.1.81]) by ietfa.amsl.com (Postfix) with ESMTP id 62A9A21F8B50 for <hybi@ietf.org>; Tue, 6 Sep 2011 09:57:52 -0700 (PDT)
Received: from ros-dhcp192-1-51-76.bbn.com ([192.1.51.76]:61415) by smtp.bbn.com with esmtps (TLSv1:AES128-SHA:128) (Exim 4.74 (FreeBSD)) (envelope-from <rbarnes@bbn.com>) id 1R0yzr-000KsA-2y; Tue, 06 Sep 2011 12:59:39 -0400
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset="iso-8859-1"
From: "Richard L. Barnes" <rbarnes@bbn.com>
In-Reply-To: <CALiegf=D5K9H0uckc_zLVbaLieyu082g8kooAXa-3LkG+g_XGQ@mail.gmail.com>
Date: Tue, 06 Sep 2011 12:59:38 -0400
Content-Transfer-Encoding: quoted-printable
Message-Id: <1AC3D19D-9E20-45EF-AC3C-B11091AF9E98@bbn.com>
References: <CALiegf=D5K9H0uckc_zLVbaLieyu082g8kooAXa-3LkG+g_XGQ@mail.gmail.com>
To: Iñaki Baz Castillo <ibc@aliax.net>
X-Mailer: Apple Mail (2.1084)
Cc: hybi@ietf.org
Subject: Re: [hybi] Changing meaning of 1007 status code ("frame" => "message")
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: Tue, 06 Sep 2011 16:57:53 -0000
As suggested in the other thread: " 1007 indicates that an endpoint is terminating the connection because it has received a text message that was not valid UTF-8 [RFC3629]. " Text frames are the only UTF-8 things that are currently specified, and future UTF-8 things should have their own error codes. On Sep 6, 2011, at 11:37 AM, Iñaki Baz Castillo wrote: > As said in other mail I suggest changing the meaning of 1007 status code from: > > 1007 indicates that an endpoint is terminating the connection > because it has received data that was supposed to be UTF-8 (such > as in a text frame) that was in fact not valid UTF-8 [RFC3629]. > > to: > > 1007 indicates that an endpoint is terminating the connection > because it has received a message that was supposed to be UTF-8 > that was in fact not valid UTF-8 [RFC3629]. > > > WS message format/encoding/content MUST be validated when receiving > all the frames belonging to such message, as message inspection/usage > belongs to the WS application, rather than the WS "transport" layer > (framing stuf). > > Of couse, a WS endpoint COULD validate each text frame by inspecting > whether it contains valid UTF-8 bytes (completed or splitted bytes). > That's could be an optimization out of the scope of the protocol > specification (as many others). > > I insist: this specification SHOULD define logic layers, basically: > > * WS transport layer: framing stuff and control frames. > * WS application layer: sends and receives *full* WS messages (binary or text). > > - The WS transport layer receives control frames and send control > frames to the other endpoint. > - The WS transport layer gives received *messages* to the WS > application layer (it doesn't matter giving the full buffered message > or using straming). > - The WS application layer sends *messages* to the WS transport layer. > The transport layer decides whether to split, or not, the message into > N frames. > - The WS application layer notifies the WS transport layer to close > the connection with status 1007 upon receipt of an invalid UTF-8 text > message. > - The WS application layer notifies the WS transport layer to close > the connection due to other causes (normal termination and so). > - The WS transport layer notifies the WS application layer when the > connection has been closed (locally or remotely) and the exact cause. > > How the WS transport layer and the WS application layer sends messages > or notifies events to each other is out of the scope of this > specification (of course). > > > Validation of a WS message should be done by the WS application layer, > so 1007 code should refer to "message" rather than "frame". > > IMHO this is obvious, and it's also obvious that defining logic layers > when creating a protocol specification is *good* for the implementor. > If not, we end with these kinds of anarchic discussions (see other > threads) which have difficult answer due to the protocol specification > ambiguity. > > Please consider it. Any protocol in Internet is designed with logical > layers, all but WebSocket. > > Regards. > > -- > Iñaki Baz Castillo > <ibc@aliax.net> > _______________________________________________ > hybi mailing list > hybi@ietf.org > https://www.ietf.org/mailman/listinfo/hybi
- [hybi] Changing meaning of 1007 status code ("fra… Iñaki Baz Castillo
- Re: [hybi] Changing meaning of 1007 status code (… Richard L. Barnes
- Re: [hybi] Changing meaning of 1007 status code (… Tobias Oberstein
- Re: [hybi] Changing meaning of 1007 status code (… Philipp Serafin
- Re: [hybi] Changing meaning of 1007 status code (… Tobias Oberstein
- Re: [hybi] Changing meaning of 1007 status code (… Iñaki Baz Castillo
- Re: [hybi] Changing meaning of 1007 status code (… Iñaki Baz Castillo
- Re: [hybi] Changing meaning of 1007 status code (… Peter Saint-Andre
- Re: [hybi] Changing meaning of 1007 status code (… Richard L. Barnes
- Re: [hybi] Changing meaning of 1007 status code (… Richard L. Barnes
- Re: [hybi] Changing meaning of 1007 status code (… John Tamplin
- Re: [hybi] Changing meaning of 1007 status code (… Iñaki Baz Castillo
- Re: [hybi] Changing meaning of 1007 status code (… Alexey Melnikov