Backed out changeset c567e28272d5: wrong bug #

This commit is contained in:
Jason Duell 2012-05-16 17:06:43 -07:00
parent 9e2b38b887
commit a4a8ae0b9a

View File

@ -390,14 +390,10 @@ nsWebSocket::OnServerClose(nsISupports *aContext, PRUint16 aCode,
CopyUTF8toUTF16(aReason, mCloseEventReason); CopyUTF8toUTF16(aReason, mCloseEventReason);
if (mReadyState == nsIWebSocket::OPEN) { if (mReadyState == nsIWebSocket::OPEN) {
// RFC 6455, 5.5.1: "When sending a Close frame in response, the endpoint // Send reciprocal Close frame.
// typically echos the status code it received". // 5.5.1: "When sending a Close frame in response, the endpoint typically
// But never send certain codes, per section 7.4.1 // echos the status code it received"
if (aCode == 1005 || aCode == 1006 || aCode == 1015) { CloseConnection(aCode, aReason);
CloseConnection(0, EmptyCString());
} else {
CloseConnection(aCode, aReason);
}
} else { } else {
// Nothing else to do: OnStop does the rest of the work. // Nothing else to do: OnStop does the rest of the work.
NS_ASSERTION (mReadyState == nsIWebSocket::CLOSING, "unknown state"); NS_ASSERTION (mReadyState == nsIWebSocket::CLOSING, "unknown state");