Re: [hybi] RFC6455 clarification: when received close code of 1005, 1006, 1015

Takashi Toyoshima <toyoshim@chromium.org> Tue, 22 May 2012 06:18 UTC

Return-Path: <toyoshim@google.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 D50559E8013 for <hybi@ietfa.amsl.com>; Mon, 21 May 2012 23:18:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.977
X-Spam-Level:
X-Spam-Status: No, score=-102.977 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-1, 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 wa2a3RgHx1xj for <hybi@ietfa.amsl.com>; Mon, 21 May 2012 23:18:02 -0700 (PDT)
Received: from mail-lpp01m010-f44.google.com (mail-lpp01m010-f44.google.com [209.85.215.44]) by ietfa.amsl.com (Postfix) with ESMTP id 0D4DF9E800A for <hybi@ietf.org>; Mon, 21 May 2012 23:18:01 -0700 (PDT)
Received: by lagv3 with SMTP id v3so4640792lag.31 for <hybi@ietf.org>; Mon, 21 May 2012 23:18:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-system-of-record; bh=AS3yyEN4ocxap0pj3VmbPZpqd2T4/DijNNZfqh69A5s=; b=eTBt1UW6PDE4moDl4eibtb5zCALfvQu6DAc9duL2QI13+c81VPrp0mZagcJyjK7S3r CSOcYX80x+r2G6KwaE4WmwHbXF6dNtG8WUeYMTDTMWPDVg9FrwV5eTwz/Dp94T0FWFUk NkbG1DTkfutkUngONvO2q209ZIr/jxewKhLvsudSGK5K416Xs9OLaOP4ocDLBbK0Y0n5 U14OPAG31NqeoUXp+0gimWNfpcTLaU/ru4kVktZeVmTtR1tLXtvE53HZKni4ws3aOcxL ZGcLhSnUFD/8ZVLk5NCnfWm1a0lbbBjaPckIUACaWbI7IaRO02P58Y1pZ9DS3BkH27pu SpBA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-system-of-record:x-gm-message-state; bh=AS3yyEN4ocxap0pj3VmbPZpqd2T4/DijNNZfqh69A5s=; b=V4Zt5xX3bWECHP76CoCbZ18QY8IGl10JtJXB4PggFSfPRn3Q86ZD0I2Ijh+gmsOYZE fWpC/CEPWqVCI8jH87nB2D3KGN361F1zlgOJqd5QKi0xSGxKVm4I/yseFd94jywPIYzg xIidc26vTauQD9TmKif3iQyxni6ycl1d8D/qgPk7InPlQ8+3YAIF13VKxY1Ii/vs1iBX 1OOqTS4WvgIxzMqWO9j9ZWuC+Aav1cLZhupPb0EumAH21/ox6FcTX6tngdgpT48QlLOt jbJsRcSRmqlppY60GIC/G2CsS1F9RYOn1eHhU70n+L3lV4+wliFgPhhdnd0ghzG9WepD xgPg==
Received: by 10.152.132.40 with SMTP id or8mr11151209lab.24.1337667480822; Mon, 21 May 2012 23:18:00 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.152.132.40 with SMTP id or8mr11151194lab.24.1337667480685; Mon, 21 May 2012 23:18:00 -0700 (PDT)
Sender: toyoshim@google.com
Received: by 10.112.113.130 with HTTP; Mon, 21 May 2012 23:18:00 -0700 (PDT)
In-Reply-To: <CAH9hSJY5RPiAfwgBkbK08sY09dDkOO6JtCWqM2dYUko2ZV5MZw@mail.gmail.com>
References: <CAH9hSJbQ7dcu4N=Yf7TyFzJ0FhfVRehEMtnFx3Qvv_W0T5Cs+A@mail.gmail.com> <4FAACC40.6040308@isode.com> <CAH9hSJY5RPiAfwgBkbK08sY09dDkOO6JtCWqM2dYUko2ZV5MZw@mail.gmail.com>
Date: Tue, 22 May 2012 15:18:00 +0900
X-Google-Sender-Auth: nkvh7ah6hIxz5CX0ix0tZe2r_H8
Message-ID: <CAFWCB1kuuMNSEmcgcHdMyOHRJyp=VKSm-YNceCPDZat3+1=zJw@mail.gmail.com>
From: Takashi Toyoshima <toyoshim@chromium.org>
To: Takeshi Yoshino <tyoshino@google.com>
Content-Type: text/plain; charset="ISO-8859-1"
X-System-Of-Record: true
X-Gm-Message-State: ALoCoQn1KbHrGvUiBQ/+KV7BXG0Y91o5sD2OTtCwLKPEQJZpr1Mq75+rOgy0e4ST5wQvBtVg+MpdZoUgGnvWfoUpvWZ8TOdTxNhGWKrMRD/bs8iqK0d0R3srVmIVdMJEg+O5ZLVB0Xgy
Cc: hybi@ietf.org
Subject: Re: [hybi] RFC6455 clarification: when received close code of 1005, 1006, 1015
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, 22 May 2012 06:18:02 -0000

Hi Takeshi,

I agreed your suggestion and also think receiving close frames of
payload length=1 is the same as your cases.
If payload length was zero, it can be handled as 1005 safely. But
length=1 is clearly broken.

I'll fix WebKit implementation of receiving 1005, 1006, 1015, and
length=1 of close frames.
These frames will fire CloseEvent with code=1006 and wasClean=false.

Thanks,

On Thu, May 10, 2012 at 11:51 AM, Takeshi Yoshino <tyoshino@google.com> wrote:
> Hi Alexey,
>
> On Thu, May 10, 2012 at 4:57 AM, Alexey Melnikov <alexey.melnikov@isode.com>
> wrote:
>>>
>>> I think this should be taken as protocol error. The endpoint received
>>> such a bad close frame should _Fail the WebSocket Connection_ and invoke
>>> onclose() with code=1006 and wasClean=false.
>>
>> 1006 seems as good of a code for this as any. Does "wasClean=false" matter
>> in this case?
>
>
> As the received close frame is considered to be broken, we should not take
> this as successful completion of closing handshake. I think it should be
> taken as "_The WebSocket Connection is Closed_ but not _cleanly_" which
> results in wasClean=false for the WebSocket API's case.
>
>>
>> Alternatively, we can reserve a new "you lied to me about your reason"
>> close code.
>
>
> We can. But as Arman suggested, we can also just use the existing code 1002
> to tell the remote endpoint that it's broken when the closing handshake
> initiator is the remote endpoint.
>
>
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi
>