[html5] r4399 - [e] (0) WSP: Clarify server-side encoding requirements.
whatwg at whatwg.org
whatwg at whatwg.org
Thu Dec 3 15:44:22 PST 2009
Author: ianh
Date: 2009-12-03 15:44:19 -0800 (Thu, 03 Dec 2009)
New Revision: 4399
Modified:
complete.html
index
source
Log:
[e] (0) WSP: Clarify server-side encoding requirements.
Modified: complete.html
===================================================================
--- complete.html 2009-12-03 11:49:46 UTC (rev 4398)
+++ complete.html 2009-12-03 23:44:19 UTC (rev 4399)
@@ -950,7 +950,8 @@
<ol>
<li><a href="#reading-the-client's-handshake"><span class=secno>10.3.4.4.1 </span>Reading the client's handshake</a></li>
<li><a href="#sending-the-server's-handshake"><span class=secno>10.3.4.4.2 </span>Sending the server's handshake</a></li>
- <li><a href=#ws-sd-framing><span class=secno>10.3.4.4.3 </span>Data framing</a></ol></li>
+ <li><a href=#ws-sd-framing><span class=secno>10.3.4.4.3 </span>Data framing</a></li>
+ <li><a href=#handling-errors-in-utf-8-0><span class=secno>10.3.4.4.4 </span>Handling errors in UTF-8</a></ol></li>
<li><a href=#closing-the-connection-0><span class=secno>10.3.4.5 </span>Closing the connection</a></li>
<li><a href=#security-considerations><span class=secno>10.3.4.6 </span>Security considerations</a></li>
<li><a href=#iana-considerations-0><span class=secno>10.3.4.7 </span>IANA considerations</a>
@@ -65870,7 +65871,7 @@
following steps. The <var title="">host</var> must be ASCII-only
(i.e. it must have been punycode-encoded already if necessary). The
<var title="">resource name</var> and <var title="">protocol</var>
- strings must be US-ASCII and must not contain U+000A LINE FEED (LF)
+ strings must be ASCII and must not contain U+000A LINE FEED (LF)
or U+000D CARRIAGE RETURN (CR) characters. The <var title="">resource name</var> string must start with a U+002F SOLIDUS
character (/) and must not contain a U+0020 SPACE character. <a href=#refsORIGIN>[ORIGIN]</a></p>
@@ -65959,7 +65960,7 @@
<pre>47 45 54 20</pre>
<p>Send the <var title="">resource name</var> value, encoded as
- US-ASCII.</p>
+ ASCII.</p>
<p>Send the following bytes:</p>
@@ -65981,12 +65982,12 @@
<pre>48 6F 73 74 3A 20</pre>
<p>Send the <var title="">host</var> value, <a href=#converted-to-ascii-lowercase>converted to
- ASCII lowercase</a>, and encoded as US-ASCII.</p>
+ ASCII lowercase</a>, and encoded as ASCII.</p>
<p>If <var title="">secure</var> is false, and <var title="">port</var> is not 80, or if <var title="">secure</var> is
true, and <var title="">port</var> is not 443, then send an 0x3A
byte (ASCII :) followed by the value of <var title="">port</var>,
- expressed as a base-ten integer, encoded as US-ASCII.</p>
+ expressed as a base-ten integer, encoded as ASCII.</p>
<p>Send the following bytes:</p>
@@ -66003,7 +66004,7 @@
<pre>4F 72 69 67 69 6E 3A 20</pre>
<p>Send the <var title="">origin</var> value, <a href=#converted-to-ascii-lowercase>converted to
- ASCII lowercase</a>, encoded as US-ASCII. <a href=#refsORIGIN>[ORIGIN]</a></p>
+ ASCII lowercase</a>, encoded as ASCII. <a href=#refsORIGIN>[ORIGIN]</a></p>
<p class=note>The <var title="">origin</var> value is a string
that was passed to this algorithm.</p>
@@ -66026,7 +66027,7 @@
6F 6C 3A 20</pre>
<p>Send the <var title="">protocol</var> value, encoded as
- US-ASCII.</p>
+ ASCII.</p>
<p>Send the following bytes:</p>
@@ -66771,7 +66772,7 @@
<p>These bytes must be the first bytes sent on the TCP connection by
the server. They must be followed by the <var title="">origin</var>
- string, encoded as US-ASCII, followed by the following bytes:</p>
+ string, encoded as ASCII, followed by the following bytes:</p>
<pre>0D 0A 57 65 62 53 6F 63 6B 65 74 2D 4C 6F 63 61
74 69 6F 6E 3A 20</pre>
@@ -66779,7 +66780,7 @@
<p>The server must then send the string that results from <a href=#construct-a-web-socket-url title="construct a Web Socket URL">constructing a Web Socket
URL</a> from <var title="">host</var>, <var title="">port</var>,
<var title="">resource name</var>, and <var title="">secure
- flag</var>, encoded as US-ASCII.</p>
+ flag</var>, encoded as ASCII.</p>
<p>If the <var title="">subprotocol</var> is not null, then the
server must then send the following bytes:</p>
@@ -66788,7 +66789,7 @@
6F 63 6F 6C 3A 20</pre>
<p>...followed by the <var title="">subprotocol</var> string,
- encoded as US-ASCII.</p>
+ encoded as ASCII.</p>
<p>Finally, the server must end its side of the handshake by sending
the four bytes 0x0D 0x0A 0x0D 0x0A to the client.</p>
@@ -66863,8 +66864,20 @@
<li><p>Send a 0xFF byte to the client to indicate the end of the
message.</li>
- </ol><h5 id=closing-the-connection-0><span class=secno>10.3.4.5 </span>Closing the connection</h5>
+ </ol><h6 id=handling-errors-in-utf-8-0><span class=secno>10.3.4.4.4 </span>Handling errors in UTF-8</h6>
+ <p>When a server is to interpret a byte stream as UTF-8 but finds
+ that the byte stream is not in fact a valid UTF-8 stream, behaviour
+ is undefined. A server could close the connection, convert invalid
+ byte sequences to U+FFFD REPLACEMENT CHARACTERs, store the data
+ verbatim, or perform application-specific processing. Subprotocols
+ layered on the Web Socket protocol might define specific behavior
+ for servers.</p>
+
+
+
+ <h5 id=closing-the-connection-0><span class=secno>10.3.4.5 </span>Closing the connection</h5>
+
<p>To <dfn id=close-the-web-socket-connection>close the Web Socket connection</dfn>, either the user
agent or the server closes the TCP/IP connection. There is no
closing handshake. Whether the user agent or the server closes the
@@ -86740,6 +86753,7 @@
Wolfram Kriesing,
Yi-An Huang,
Yngve Nysaeter Pettersen,
+ Yuzo Fujishima,
Zhenbin Xu,
Zoltan Herczeg,
and
Modified: index
===================================================================
--- index 2009-12-03 11:49:46 UTC (rev 4398)
+++ index 2009-12-03 23:44:19 UTC (rev 4399)
@@ -78604,6 +78604,7 @@
Wolfram Kriesing,
Yi-An Huang,
Yngve Nysaeter Pettersen,
+ Yuzo Fujishima,
Zhenbin Xu,
Zoltan Herczeg,
and
Modified: source
===================================================================
--- source 2009-12-03 11:49:46 UTC (rev 4398)
+++ source 2009-12-03 23:44:19 UTC (rev 4399)
@@ -75154,7 +75154,7 @@
following steps. The <var title="">host</var> must be ASCII-only
(i.e. it must have been punycode-encoded already if necessary). The
<var title="">resource name</var> and <var title="">protocol</var>
- strings must be US-ASCII and must not contain U+000A LINE FEED (LF)
+ strings must be ASCII and must not contain U+000A LINE FEED (LF)
or U+000D CARRIAGE RETURN (CR) characters. The <var
title="">resource name</var> string must start with a U+002F SOLIDUS
character (/) and must not contain a U+0020 SPACE character. <a
@@ -75254,7 +75254,7 @@
<pre>47 45 54 20</pre>
<p>Send the <var title="">resource name</var> value, encoded as
- US-ASCII.</p>
+ ASCII.</p>
<p>Send the following bytes:</p>
@@ -75276,13 +75276,13 @@
<pre>48 6F 73 74 3A 20</pre>
<p>Send the <var title="">host</var> value, <span>converted to
- ASCII lowercase</span>, and encoded as US-ASCII.</p>
+ ASCII lowercase</span>, and encoded as ASCII.</p>
<p>If <var title="">secure</var> is false, and <var
title="">port</var> is not 80, or if <var title="">secure</var> is
true, and <var title="">port</var> is not 443, then send an 0x3A
byte (ASCII :) followed by the value of <var title="">port</var>,
- expressed as a base-ten integer, encoded as US-ASCII.</p>
+ expressed as a base-ten integer, encoded as ASCII.</p>
<p>Send the following bytes:</p>
@@ -75299,7 +75299,7 @@
<pre>4F 72 69 67 69 6E 3A 20</pre>
<p>Send the <var title="">origin</var> value, <span>converted to
- ASCII lowercase</span>, encoded as US-ASCII. <a
+ ASCII lowercase</span>, encoded as ASCII. <a
href="#refsORIGIN">[ORIGIN]</a></p>
<p class="note">The <var title="">origin</var> value is a string
@@ -75323,7 +75323,7 @@
6F 6C 3A 20</pre>
<p>Send the <var title="">protocol</var> value, encoded as
- US-ASCII.</p>
+ ASCII.</p>
<p>Send the following bytes:</p>
@@ -76165,7 +76165,7 @@
<p>These bytes must be the first bytes sent on the TCP connection by
the server. They must be followed by the <var title="">origin</var>
- string, encoded as US-ASCII, followed by the following bytes:</p>
+ string, encoded as ASCII, followed by the following bytes:</p>
<pre>0D 0A 57 65 62 53 6F 63 6B 65 74 2D 4C 6F 63 61
74 69 6F 6E 3A 20</pre>
@@ -76174,7 +76174,7 @@
title="construct a Web Socket URL">constructing a Web Socket
URL</span> from <var title="">host</var>, <var title="">port</var>,
<var title="">resource name</var>, and <var title="">secure
- flag</var>, encoded as US-ASCII.</p>
+ flag</var>, encoded as ASCII.</p>
<p>If the <var title="">subprotocol</var> is not null, then the
server must then send the following bytes:</p>
@@ -76183,7 +76183,7 @@
6F 63 6F 6C 3A 20</pre>
<p>...followed by the <var title="">subprotocol</var> string,
- encoded as US-ASCII.</p>
+ encoded as ASCII.</p>
<p>Finally, the server must end its side of the handshake by sending
the four bytes 0x0D 0x0A 0x0D 0x0A to the client.</p>
@@ -76285,6 +76285,18 @@
</ol>
+ <h6>Handling errors in UTF-8</h6>
+
+ <p>When a server is to interpret a byte stream as UTF-8 but finds
+ that the byte stream is not in fact a valid UTF-8 stream, behaviour
+ is undefined. A server could close the connection, convert invalid
+ byte sequences to U+FFFD REPLACEMENT CHARACTERs, store the data
+ verbatim, or perform application-specific processing. Subprotocols
+ layered on the Web Socket protocol might define specific behavior
+ for servers.</p>
+
+
+
<h5>Closing the connection</h5>
<p>To <dfn>close the Web Socket connection</dfn>, either the user
@@ -97003,6 +97015,7 @@
Wolfram Kriesing,
Yi-An Huang,
Yngve Nysaeter Pettersen,
+ Yuzo Fujishima,
Zhenbin Xu,
Zoltan Herczeg,
and
More information about the Commit-Watchers
mailing list