stompl 0.3.0 → 0.4.0
raw patch · 4 files changed
+20/−17 lines, 4 filesdep +word8
Dependencies added: word8
Files
- Network/Mom/Stompl/Frame.hs +10/−9
- Network/Mom/Stompl/Parser.hs +6/−7
- changelog.md +2/−0
- stompl.cabal +2/−1
Network/Mom/Stompl/Frame.hs view
@@ -73,9 +73,10 @@ -- Todo: -- - conformance to protocol - import qualified Data.ByteString.Char8 as B+ import qualified Data.ByteString as B import qualified Data.ByteString.UTF8 as U import Data.Char (toUpper, isDigit)+ import Data.Word8 (Word8) import Data.List (find, sortBy, foldl', nub) import Data.List.Split (splitWhen) import Data.Maybe (catMaybes, fromMaybe)@@ -1026,9 +1027,9 @@ -- | append (>|<) :: B.ByteString -> B.ByteString -> B.ByteString -- | snoc- (|>) :: B.ByteString -> Char -> B.ByteString+ (|>) :: B.ByteString -> Word8 -> B.ByteString -- | cons- (<|) :: Char -> B.ByteString -> B.ByteString+ (<|) :: Word8 -> B.ByteString -> B.ByteString x >|< y = x `B.append` y x <| y = x `B.cons` y x |> y = x `B.snoc` y@@ -1232,7 +1233,7 @@ Receipt -> "RECEIPT" Error -> "ERROR" HeartBeat -> ""- in B.pack (s ++ "\n")+ in U.fromString s |> 0x0a ------------------------------------------------------------------------ -- Convert headers to ByteString@@ -1241,7 +1242,7 @@ putHeaders f = let hs = toHeaders f s = B.concat $ map putHeader hs- in s |> '\n'+ in s |> 0x0a ------------------------------------------------------------------------ -- Convert header to ByteString@@ -1365,10 +1366,10 @@ putBody :: Frame -> Body putBody f = case f of - x@SndFrame {} -> frmBody x |> '\x00'- x@ErrFrame {} -> frmBody x |> '\x00'- x@MsgFrame {} -> frmBody x |> '\x00'- _ -> B.pack "\x00"+ x@SndFrame {} -> frmBody x |> 0x00+ x@ErrFrame {} -> frmBody x |> 0x00+ x@MsgFrame {} -> frmBody x |> 0x00+ _ -> B.singleton 0x00 ------------------------------------------------------------------------ -- find a header and return it as string value (with default)
Network/Mom/Stompl/Parser.hs view
@@ -10,8 +10,7 @@ ------------------------------------------------------------------------------- module Network.Mom.Stompl.Parser ( stompParser,- stompAtOnce- )+ stompAtOnce) where import Data.Attoparsec.ByteString hiding (take, takeWhile, takeTill)@@ -214,7 +213,7 @@ then failBodyLen l (B.length b) else do _ <- word8 nul- body' l (b |> '\x00') + body' l (b |> 0x00) ------------------------------------------------------------------------ -- escape header key and value;@@ -236,10 +235,10 @@ _ <- word8 esc x <- anyWord8 c <- case x of- 92 -> return '\\'- 99 -> return ':'- 110 -> return '\n'- 114 -> return '\r'+ 92 -> return esc+ 99 -> return col+ 110 -> return eol+ 114 -> return cr _ -> fail $ "Unknown escape sequence: " ++ show x go (t >|< n |> c)
changelog.md view
@@ -1,3 +1,5 @@+__0.4.0__ Bytestring instead of Bytestring.Char8+ __0.3.0__ State Linkage Exception in license __0.2.0__ The mime package (Codec.MIME) switched from String
stompl.cabal view
@@ -1,6 +1,6 @@ Name: stompl Category: Message-Oriented Middleware, Network, Stomp, Parser-Version: 0.3.0+Version: 0.4.0 Cabal-Version: >= 1.8 Copyright: Copyright (c) Tobias Schoofs, 2011 - 2015 License: LGPL@@ -38,6 +38,7 @@ Build-Depends: base >= 4.0 && < 5.0, bytestring >= 0.10, utf8-string >= 0.3.6,+ word8 >= 0.1.2, attoparsec >= 0.10, split >= 0.1.4.1, mime >= 0.4,