From 69e057969bba8bac8eacb501ad8ba940bca3871c Mon Sep 17 00:00:00 2001 From: sta Date: Sat, 1 Mar 2014 15:24:03 +0900 Subject: [PATCH] Modified Rsv enum values to PascalCase values --- websocket-sharp/Rsv.cs | 14 +++++++------- websocket-sharp/WsFrame.cs | 18 +++++++++--------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/websocket-sharp/Rsv.cs b/websocket-sharp/Rsv.cs index 71ddf982..993ea91b 100644 --- a/websocket-sharp/Rsv.cs +++ b/websocket-sharp/Rsv.cs @@ -4,8 +4,8 @@ * * The MIT License * - * Copyright (c) 2012-2013 sta.blockhead - * + * Copyright (c) 2012-2014 sta.blockhead + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -15,7 +15,7 @@ * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -28,11 +28,11 @@ using System; -namespace WebSocketSharp { - +namespace WebSocketSharp +{ internal enum Rsv : byte { - OFF = 0x0, - ON = 0x1 + Off = 0x0, + On = 0x1 } } diff --git a/websocket-sharp/WsFrame.cs b/websocket-sharp/WsFrame.cs index c200b94e..94752d9c 100644 --- a/websocket-sharp/WsFrame.cs +++ b/websocket-sharp/WsFrame.cs @@ -80,9 +80,9 @@ namespace WebSocketSharp Fin fin, Opcode opcode, Mask mask, PayloadData payload, bool compressed) { Fin = fin; - Rsv1 = isData (opcode) && compressed ? Rsv.ON : Rsv.OFF; - Rsv2 = Rsv.OFF; - Rsv3 = Rsv.OFF; + Rsv1 = isData (opcode) && compressed ? Rsv.On : Rsv.Off; + Rsv2 = Rsv.Off; + Rsv3 = Rsv.Off; Opcode = opcode; Mask = mask; @@ -140,7 +140,7 @@ namespace WebSocketSharp internal bool IsCompressed { get { - return Rsv1 == Rsv.ON; + return Rsv1 == Rsv.On; } } @@ -185,7 +185,7 @@ namespace WebSocketSharp internal bool IsPerMessageCompressed { get { var opcode = Opcode; - return (opcode == Opcode.BINARY || opcode == Opcode.TEXT) && Rsv1 == Rsv.ON; + return (opcode == Opcode.BINARY || opcode == Opcode.TEXT) && Rsv1 == Rsv.On; } } @@ -377,11 +377,11 @@ namespace WebSocketSharp // FIN var fin = (header [0] & 0x80) == 0x80 ? Fin.Final : Fin.More; // RSV1 - var rsv1 = (header [0] & 0x40) == 0x40 ? Rsv.ON : Rsv.OFF; + var rsv1 = (header [0] & 0x40) == 0x40 ? Rsv.On : Rsv.Off; // RSV2 - var rsv2 = (header [0] & 0x20) == 0x20 ? Rsv.ON : Rsv.OFF; + var rsv2 = (header [0] & 0x20) == 0x20 ? Rsv.On : Rsv.Off; // RSV3 - var rsv3 = (header [0] & 0x10) == 0x10 ? Rsv.ON : Rsv.OFF; + var rsv3 = (header [0] & 0x10) == 0x10 ? Rsv.On : Rsv.Off; // Opcode var opcode = (Opcode) (header [0] & 0x0f); // MASK @@ -392,7 +392,7 @@ namespace WebSocketSharp // Check if correct frame. var incorrect = isControl (opcode) && fin == Fin.More ? "A control frame is fragmented." - : !isData (opcode) && rsv1 == Rsv.ON + : !isData (opcode) && rsv1 == Rsv.On ? "A non data frame is compressed." : null;