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

Takashi Toyoshima <toyoshim@chromium.org> Thu, 24 May 2012 07:43 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 A95F121F8565 for <hybi@ietfa.amsl.com>; Thu, 24 May 2012 00:43:52 -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 AXZhKlF7a5S1 for <hybi@ietfa.amsl.com>; Thu, 24 May 2012 00:43:52 -0700 (PDT)
Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) by ietfa.amsl.com (Postfix) with ESMTP id CFBA421F8559 for <hybi@ietf.org>; Thu, 24 May 2012 00:43:51 -0700 (PDT)
Received: by lbbgo11 with SMTP id go11so6608133lbb.31 for <hybi@ietf.org>; Thu, 24 May 2012 00:43:50 -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 :content-transfer-encoding:x-system-of-record; bh=nDOsJIUew3L6H3Ge2XIV/QNAEY+rzzwhW5VTWE0gewU=; b=OCP8pz9+4Kae9nwHIsSxRgXSjK+7uw/LOghrQIYwWso1bSAXIKWP3RCx0xMGb6CggR Bh+SwYgmL/1cndy8SFBKyJIvi/LymMCxBTgoTO4myVHLtyiONiCLZ0cP9I/3xUBgt3Gp yUfB3tZAdre2cypnOX+0LSQKYe2OIkp+MM89MgJ9kkeAXHqz9PCsDdjUFBgzZfm69KvC NXDx7flJYI6g0MLbDmvf51asQOIEftuwgNEM/I1IGPWRzK27BNFcTq5ntgEB/rcS+AFv J7ub4Lob1M/wM4rMAWoAG+//VhHScgPRiGHTyQoAbac4oBuHkXw1P6QsnmSQin1xBgxU jCJA==
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 :content-transfer-encoding:x-system-of-record:x-gm-message-state; bh=nDOsJIUew3L6H3Ge2XIV/QNAEY+rzzwhW5VTWE0gewU=; b=L6pwLOGsU7RHG4J6rxToXIK3XZBDq6Fpi9itEKYCThRWX2y8iFmMysUDy17/xbHHx1 1UA4PpFFZLS8QoJBLh2hGuiJpkNT/srIov/y5V2SMDWJPMMX9USGNVrV049FQJ9UxkBc wNPtLmfy9wmttlQT4djLAmoQY+xmxtbRekihLWwmELws1RKcH7fa/2OptHqRs3t5J1Ig YntiFQCCCTzk3HRGQn5zxJ0ouRPz9UHdIHliZbKf2qdm8RsydHueZ1tQzVm+/cmTBiCf MeeNPL9OZ8ZzzFWXv2RiyE3gyol3pYKzw+zDIqdej9mWqa71Tqa+xxvLBNAo13r45u34 +taQ==
Received: by 10.152.125.116 with SMTP id mp20mr29559731lab.19.1337845430740; Thu, 24 May 2012 00:43:50 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.152.125.116 with SMTP id mp20mr29559717lab.19.1337845430489; Thu, 24 May 2012 00:43:50 -0700 (PDT)
Sender: toyoshim@google.com
Received: by 10.112.113.130 with HTTP; Thu, 24 May 2012 00:43:50 -0700 (PDT)
In-Reply-To: <CAH9hSJYUmPsMpjoo9f4SpK_0jW3XcbTGE-Bksi8x+62LD6NoeA@mail.gmail.com>
References: <CAH9hSJbQ7dcu4N=Yf7TyFzJ0FhfVRehEMtnFx3Qvv_W0T5Cs+A@mail.gmail.com> <4FAACC40.6040308@isode.com> <CAH9hSJY5RPiAfwgBkbK08sY09dDkOO6JtCWqM2dYUko2ZV5MZw@mail.gmail.com> <CAFWCB1kuuMNSEmcgcHdMyOHRJyp=VKSm-YNceCPDZat3+1=zJw@mail.gmail.com> <CAM6mnz+fy2D_91UL=nnOmrL=4LOqrQ97CQW8DfFkQhHDHwn6FQ@mail.gmail.com> <CAH9hSJYUmPsMpjoo9f4SpK_0jW3XcbTGE-Bksi8x+62LD6NoeA@mail.gmail.com>
Date: Thu, 24 May 2012 16:43:50 +0900
X-Google-Sender-Auth: 1CEK-Nw2fGgZZcW8lvhREBhLtSc
Message-ID: <CAFWCB1kmfn-wsnTptDjDsXUVGLdwMMG49eTNz7YutC9ZsE07yw@mail.gmail.com>
From: Takashi Toyoshima <toyoshim@chromium.org>
To: Takeshi Yoshino <tyoshino@google.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
X-System-Of-Record: true
X-Gm-Message-State: ALoCoQk/sk51t/hKL2HxJ9UPPR9q02bqaOovos/v1zzJY32GD+AaVpCO4eCUU2ORtaM+q2xfL78v1rLqkdALhAaO5BWbZbAYc18kp01kzUQjyzTAEz/17dMAGaQaF11H5amP+eLlEOX4
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: Thu, 24 May 2012 07:43:52 -0000

I'm planing to deliver 1006 and fall back to the _Fail the WebSocket
Connection_ process.
Currently it doesn't send an appropriate status code. But I also think
1002 is the best if I sent.

On Thu, May 24, 2012 at 1:12 PM, Takeshi Yoshino <tyoshino@google.com> wrote:
> On Wed, May 23, 2012 at 1:38 PM, Jason Duell <jduell.mcbugs@gmail.com>
> wrote:
>>
>> On Mon, May 21, 2012 at 11:18 PM, Takashi Toyoshima
>> <toyoshim@chromium.org> wrote:
>> > 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.
>>
>> What, if anything, do you plan to reply to the endpoint with, if the
>> 1005/1006/1015 is received before your client has sent its own close
>> frame?  Will you be replying with 1002, but delivering 1006 to
>> onclose?  I can see the logic there, though it's a little confusing.
>
>
> Yes. It's a bit confusing but well defined behavior. For any other protocol
> violation, the endpoint received a broken frame SHOULD send 1002 and MUST
> invoke onclose with 1006.
>
> http://tools.ietf.org/html/rfc6455#section-7.1.7
>
>>
>> The only other choice would seem to be to simply shut down the TCP
>> connection with no close frame, but that seems harsh.  Or we could
>> both send 1002 to the remote server and deliver it to onclose (though
>> I agree that 1006 seems closer in meaning).
>
>
> It's SHOULD. Shutting down TCP without sending 1002 is also fine as per
> spec. http://tools.ietf.org/html/rfc6455#section-7.1.7
>
> There has been discussion about the meaning of the code argument of the
> onclose handler. As 7.1.5 of the
> spec http://tools.ietf.org/html/rfc6455#section-7.1.5 explains, now it's
> meaning is finalized as "the status code contained in the first
> Close control frame received". That's my understanding. So, the code for
> onclose must be 1006.
>