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);
if (mReadyState == nsIWebSocket::OPEN) {
// RFC 6455, 5.5.1: "When sending a Close frame in response, the endpoint
// typically echos the status code it received".
// But never send certain codes, per section 7.4.1
if (aCode == 1005 || aCode == 1006 || aCode == 1015) {
CloseConnection(0, EmptyCString());
} else {
// Send reciprocal Close frame.
// 5.5.1: "When sending a Close frame in response, the endpoint typically
// echos the status code it received"
CloseConnection(aCode, aReason);
}
} else {
// Nothing else to do: OnStop does the rest of the work.
NS_ASSERTION (mReadyState == nsIWebSocket::CLOSING, "unknown state");