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

Takeshi Yoshino <tyoshino@google.com> Thu, 10 May 2012 02:52 UTC

Return-Path: <tyoshino@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 95FFA9E800C for <hybi@ietfa.amsl.com>; Wed, 9 May 2012 19:52:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.941
X-Spam-Level:
X-Spam-Status: No, score=-102.941 tagged_above=-999 required=5 tests=[AWL=0.035, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, 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 0-cZrDazqL35 for <hybi@ietfa.amsl.com>; Wed, 9 May 2012 19:52:05 -0700 (PDT)
Received: from mail-yx0-f172.google.com (mail-yx0-f172.google.com [209.85.213.172]) by ietfa.amsl.com (Postfix) with ESMTP id 0A5799E800B for <hybi@ietf.org>; Wed, 9 May 2012 19:52:04 -0700 (PDT)
Received: by yenq13 with SMTP id q13so1209666yen.31 for <hybi@ietf.org>; Wed, 09 May 2012 19:52:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-system-of-record; bh=i6D3BbKCF8fgi+RO/9WNltcV9QfHRyMgyEuaewM/VUU=; b=odKw2FV6FPlP4RkML+PBC8oqrUANzGxGQN0NEbPRgF17XlX81SSPt0O3ycm72Hxc2f DLwi7NhOFJXeNXZwQvoKegs9Vtu1HIA5yacHOUqGhISWFX2HVU3wag7f4pv+SitwsIpw kGiO8l9riSXVZtukdMVZTT56HukSjZZ0vDdbwZ/Bqi3x0sCfLM1nP9pxA2etDuxHhQmk 3SIpaQx439Fyir95yhQZoOGu3EnrFoUJdFQrEh6sHVZz3t3vpQOPuxXxjKmAqf+umNTE bhegzk1sb87ECMdShVoHIsB5jYtGrP87tuQ9bwvTCYdaYAHReFvQ0gzlvbPatHFHRiT4 d4BQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-system-of-record:x-gm-message-state; bh=i6D3BbKCF8fgi+RO/9WNltcV9QfHRyMgyEuaewM/VUU=; b=JE9vl7+eKgrM8mXe0fPimSjHEh147MLOd1yZKE5cGaLTJ006Q0yeOZTpUIelQ51HeI e08vEQcTHa4JVSvzkXq9jLnqWPVYExXG5y++tCq4Um39kGwzQq03W3f6tQw2gzYWYeRT LCgnKkJwr7HwEHNpvzSQrHdDBOsn4xQYvOZkvGyepVRQZ8rhhXzVLkUuxQbyeu+U39ZC uzSMIUwW/X3fVp0+/kt5P4VPkLV/3/X4a0SgOB0WhlUkOyEUZEIEQwV4+EqMIxrSF0lZ jwWt6SzG/ps0HH5SR4JScTB50m9PhewZtPzL/yI6RSdI+R6LwyU2ga5Fj5k9odYSpfnV FsyQ==
Received: by 10.50.158.234 with SMTP id wx10mr2671430igb.71.1336618324367; Wed, 09 May 2012 19:52:04 -0700 (PDT)
Received: by 10.50.158.234 with SMTP id wx10mr2671425igb.71.1336618324231; Wed, 09 May 2012 19:52:04 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.231.112.130 with HTTP; Wed, 9 May 2012 19:51:43 -0700 (PDT)
In-Reply-To: <4FAACC40.6040308@isode.com>
References: <CAH9hSJbQ7dcu4N=Yf7TyFzJ0FhfVRehEMtnFx3Qvv_W0T5Cs+A@mail.gmail.com> <4FAACC40.6040308@isode.com>
From: Takeshi Yoshino <tyoshino@google.com>
Date: Thu, 10 May 2012 11:51:43 +0900
Message-ID: <CAH9hSJY5RPiAfwgBkbK08sY09dDkOO6JtCWqM2dYUko2ZV5MZw@mail.gmail.com>
To: Alexey Melnikov <alexey.melnikov@isode.com>
Content-Type: multipart/alternative; boundary="14dae93410a96a84fe04bfa5b4b4"
X-System-Of-Record: true
X-Gm-Message-State: ALoCoQmDOr7h6A5sIN0v+rEmI5a4YGma//oJFb9dTvwCTI3OJpMnEtuu5u+Y4IPNlMxeIi432h394u4QGajo8KKtOIdUiZWE6U7l8u8+gTdSy2ZY8wSpx5KaIecpVz0WlltzF8fhyHEj
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, 10 May 2012 02:52:05 -0000

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.