<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>13294</bug_id>
          
          <creation_ts>2011-07-19 05:06:20 +0000</creation_ts>
          <short_desc>The send() method should fail the WebSocket connection when data cannot be sent</short_desc>
          <delta_ts>2011-08-05 23:50:15 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebSocket API (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brian Raymor [MSFT]">brian.raymor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>art.barstow</cc>
    
    <cc>ian</cc>
    
    <cc>jonas</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>51254</commentid>
    <comment_count>0</comment_count>
    <who name="Brian Raymor [MSFT]">brian.raymor</who>
    <bug_when>2011-07-19 05:06:20 +0000</bug_when>
    <thetext>For this failure case:

if the data cannot be sent, e.g. because it would need to be buffered but the buffer is full, the user agent must close the WebSocket connection.

would it be more appropriate for the user agent to fail the WebSocket connection and trigger an error event?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51271</commentid>
    <comment_count>1</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2011-07-19 16:08:06 +0000</bug_when>
    <thetext>This seems ok to me. Though firing it asynchronously seems like a good idea since we&apos;re likely in a low memory situation if this happens.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54268</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-08-05 23:34:02 +0000</bug_when>
    <thetext>Failing the WebSocket connection involves sending more data. We can&apos;t send more data in this situation, by definition (that&apos;s why we&apos;re giving up, after all).

But we can still fire an &apos;error&apos; event, sure. Done.

Note that both &apos;error&apos; and &apos;close&apos; are fired asynchronously (well, they&apos;re fired synchronously, but on a task that is queued after the connection is closed).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54270</commentid>
    <comment_count>3</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-08-05 23:35:00 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6377.
Check-in comment: Make the client-side failure mode also fire &apos;error&apos;.
http://html5.org/tools/web-apps-tracker?from=6376&amp;to=6377</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54275</commentid>
    <comment_count>4</comment_count>
    <who name="Brian Raymor [MSFT]">brian.raymor</who>
    <bug_when>2011-08-05 23:50:15 +0000</bug_when>
    <thetext>
Failing the WebSocket connection does not always require more data to be sent based on the SHOULD/MAY language in the IETF draft:

http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10#section-7.1.7

   If _The WebSocket Connection is Established_ prior to the point where
   the endpoint is required to _Fail the WebSocket Connection_, the
   endpoint SHOULD send a Close frame with an appropriate status code
   Section 7.4 before proceeding to _Close the WebSocket Connection_.

   An endpoint MAY omit sending a Close frame if it believes the other
   side is unlikely to be able to receive and process the close frame,
   due to the nature of the error that led to the WebSocket connection
   being failed in the first place.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>