packages feed

websockets 0.6.0.3 → 0.6.0.4

raw patch · 4 files changed

+24/−13 lines, 4 filesdep ~case-insensitivedep ~containers

Dependency ranges changed: case-insensitive, containers

Files

src/Network/WebSockets/Protocol/Hybi00/Internal.hs view
@@ -8,6 +8,7 @@ import Data.Char (isDigit)  import Data.Binary (encode)+import Data.ByteString.Lazy.Char8 () import Data.Digest.Pure.MD5 (md5) import Data.Int (Int32) import qualified Blaze.ByteString.Builder as BB
src/Network/WebSockets/Protocol/Hybi10/Demultiplex.hs view
@@ -17,6 +17,9 @@ -- | A low-level representation of a WebSocket packet data Frame = Frame     { frameFin     :: !Bool+    , frameRsv1    :: !Bool+    , frameRsv2    :: !Bool+    , frameRsv3    :: !Bool     , frameType    :: !FrameType     , framePayload :: !BL.ByteString     } deriving (Eq, Show)@@ -42,7 +45,7 @@ demultiplex :: DemultiplexState             -> Frame             -> (Maybe (Message p), DemultiplexState)-demultiplex state (Frame fin tp pl) = case tp of+demultiplex state (Frame fin _ _ _ tp pl) = case tp of     -- Return control messages immediately, they have no influence on the state     CloseFrame  -> (Just (ControlMessage (Close pl)), state)     PingFrame   -> (Just (ControlMessage (Ping pl)), state)
src/Network/WebSockets/Protocol/Hybi10/Internal.hs view
@@ -48,12 +48,13 @@ encodeMessageHybi10 :: Message p -> B.Builder encodeMessageHybi10 msg = builder   where+    mkFrame = Frame True False False False     builder = encodeFrameHybi10 $ case msg of-        (ControlMessage (Close pl)) -> Frame True CloseFrame pl-        (ControlMessage (Ping pl))  -> Frame True PingFrame pl-        (ControlMessage (Pong pl))  -> Frame True PongFrame pl-        (DataMessage (Text pl))     -> Frame True TextFrame pl-        (DataMessage (Binary pl))   -> Frame True BinaryFrame pl+        (ControlMessage (Close pl)) -> mkFrame CloseFrame  pl+        (ControlMessage (Ping pl))  -> mkFrame PingFrame   pl+        (ControlMessage (Pong pl))  -> mkFrame PongFrame   pl+        (DataMessage (Text pl))     -> mkFrame TextFrame   pl+        (DataMessage (Binary pl))   -> mkFrame BinaryFrame pl  -- | Encode a frame encodeFrameHybi10 :: Frame -> B.Builder@@ -61,8 +62,11 @@     B.fromWord8 byte1 `mappend` len `mappend`     B.fromLazyByteString (framePayload f)   where-    byte0  = fin .|. opcode-    fin    = if frameFin f then 0x80 else 0x00+    byte0  = fin .|. rsv1 .|. rsv2 .|. rsv3 .|. opcode+    fin    = if frameFin f  then 0x80 else 0x00+    rsv1   = if frameRsv1 f then 0x40 else 0x00+    rsv2   = if frameRsv2 f then 0x20 else 0x00+    rsv3   = if frameRsv3 f then 0x10 else 0x00     opcode = case frameType f of         ContinuationFrame -> 0x00         TextFrame         -> 0x01@@ -91,7 +95,10 @@ parseFrame :: A.Parser Frame parseFrame = do     byte0 <- anyWord8-    let fin = byte0 .&. 0x80 == 0x80+    let fin    = byte0 .&. 0x80 == 0x80+        rsv1   = byte0 .&. 0x40 == 0x40+        rsv2   = byte0 .&. 0x20 == 0x20+        rsv3   = byte0 .&. 0x10 == 0x10         opcode = byte0 .&. 0x0f      let ft = case opcode of@@ -116,7 +123,7 @@      chunks <- take64 len -    return $ Frame fin ft (masker $ BL.fromChunks chunks)+    return $ Frame fin rsv1 rsv2 rsv3 ft (masker $ BL.fromChunks chunks)   where     runGet' g = runGet g . BL.fromChunks . return 
websockets.cabal view
@@ -1,5 +1,5 @@ Name:    websockets-Version: 0.6.0.3+Version: 0.6.0.4  Synopsis:   A sensible and clean way to write WebSocket-capable servers in Haskell.@@ -73,7 +73,7 @@     blaze-builder-enumerator >= 0.2    && < 0.3,     bytestring               >= 0.9    && < 0.10,     case-insensitive         >= 0.3    && < 0.5,-    containers               >= 0.3    && < 0.5,+    containers               >= 0.3    && < 0.6,     enumerator               >= 0.4.13 && < 0.5,     mtl                      >= 2.0    && < 2.2,     network                  >= 2.3    && < 2.4,@@ -105,7 +105,7 @@     blaze-builder-enumerator >= 0.2    && < 0.3,     bytestring               >= 0.9    && < 0.10,     case-insensitive         >= 0.3    && < 0.5,-    containers               >= 0.3    && < 0.5,+    containers               >= 0.3    && < 0.6,     enumerator               >= 0.4.13 && < 0.5,     mtl                      >= 2.0    && < 2.2,     network                  >= 2.3    && < 2.4,