[hybi] Error handling in hybi-03 framing

Yuta Kitamura <yutak@google.com> Mon, 13 December 2010 09:13 UTC

Return-Path: <yutak@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 2E72828C0D0 for <hybi@core3.amsl.com>; Mon, 13 Dec 2010 01:13:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -109.976
X-Spam-Level:
X-Spam-Status: No, score=-109.976 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-8, 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 MdIX2g5p9nL1 for <hybi@core3.amsl.com>; Mon, 13 Dec 2010 01:13:00 -0800 (PST)
Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.35]) by core3.amsl.com (Postfix) with ESMTP id D93D828C0CE for <hybi@ietf.org>; Mon, 13 Dec 2010 01:12:59 -0800 (PST)
Received: from hpaq11.eem.corp.google.com (hpaq11.eem.corp.google.com [172.25.149.11]) by smtp-out.google.com with ESMTP id oBD9EatX020827 for <hybi@ietf.org>; Mon, 13 Dec 2010 01:14:36 -0800
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1292231676; bh=UssimsJcGp/w9PLuGXXvKxPiF8Q=; h=MIME-Version:Date:Message-ID:Subject:From:To:Content-Type; b=tuk+Jcuau7FosHMZmvvmjDUw9P6VWRakhxZcv+rBlynsZIlprBZ2w1GQ3R/xDIfye kyZ3XJHcngSGQeKF5OTlw==
Received: from gwb20 (gwb20.prod.google.com [10.200.2.20]) by hpaq11.eem.corp.google.com with ESMTP id oBD9E4Xs020514 for <hybi@ietf.org>; Mon, 13 Dec 2010 01:14:35 -0800
Received: by gwb20 with SMTP id 20so5532341gwb.15 for <hybi@ietf.org>; Mon, 13 Dec 2010 01:14:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=vlBdqQBy56zoWwA3akuQWyaPtcDLJgSFKrREIcRtrnc=; b=cNUJIlbyQV6btLXRwaUWkEGJVM3uB6b1UtclkSZU01nIXOVAz6ij4eQCd9l+Mef95H 0Xt4+3sWKTRW7282CbSA==
DomainKey-Signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:date:message-id:subject:from:to:content-type; b=E8ah/ijT23OJcjr2wILzpNyp2jdICboZ+yR6fSQ6MbHSUrB0zU/U8CyAleQkxWphc0 s+dvzxAHfzMROlXivEHw==
MIME-Version: 1.0
Received: by 10.90.111.20 with SMTP id j20mr4827434agc.117.1292231675242; Mon, 13 Dec 2010 01:14:35 -0800 (PST)
Received: by 10.91.220.19 with HTTP; Mon, 13 Dec 2010 01:14:35 -0800 (PST)
Date: Mon, 13 Dec 2010 18:14:35 +0900
Message-ID: <AANLkTimNZiHp0VA09eFfx64LYNh1uy86bd2XUwic9fH=@mail.gmail.com>
From: Yuta Kitamura <yutak@google.com>
To: hybi@ietf.org
Content-Type: multipart/alternative; boundary="00163630fd77f869f804974721a9"
X-System-Of-Record: true
Subject: [hybi] Error handling in hybi-03 framing
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, 13 Dec 2010 09:13:01 -0000

Hi,

We are now implementing the new WebSocket framing into WebKit. During that
effort, we have found that the new framing specification lacks statements
describing how to handle erroneous frames.

Specifically, for client-side, I think we have to describe what a client
MAY/SHOULD/MUST do in the following events (as far as I can imagine):
- When a client receives a frame whose opcode is reserved (0x6 - 0xF).
- When a client receives a frame whose opcode is not supported (for example,
if the client does not support binary frames, maybe due to lack of WebSocket
API)
- When a client receives a frame with some reserved bits (rsv[1234]) on.
- When a client receives a non-continuation frame (including a control
frame) in the middle of continuation frames.
- When a client receives a long (>125 bytes) or fragmented control frame.
- When a client receives an unexpected pong frame.
- When a client cannot receive a frame because its payload is too long.
- When a client detects disconnection before it receives/sends a close
frame.
- (When a client cannot decode UTF-8 sequence of a text frame -> this is
already covered in section 6 (Error Handling))

The possible options for a client will look like the following:
- The client MAY/SHOULD/MUST abort the connection/ignore the error.
AND/OR
- The client MUST fire the onerror handler (a.k.a. "a WebSocket error is
detected").

Defining criteria for the latter is especially important in order to keep
inter-browser compatibility.

Of course, criteria for servers will also be needed, but I would like to
leave them to server implementors, as I do not have a good sense about
servers.

So, I would like to ask if it does make sense to define there error handling
behaviors. If an agreement is reached, then we will need to create a full
list of error conditions and error handling behaviors for clients and
servers.

Regards,
Yuta