websockets-snap 0.9.0.0 → 0.9.1.0
raw patch · 3 files changed
+13/−7 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG +6/−0
- src/Network/WebSockets/Snap.hs +6/−6
- websockets-snap.cabal +1/−1
CHANGELOG view
@@ -1,2 +1,8 @@+- 0.9.1.0+ * Fixed interleaved messages issue++- 0.9.0.0+ * Bump websockets dependency+ - 0.8.2.2 * Bump mtl dependency
src/Network/WebSockets/Snap.hs view
@@ -10,7 +10,7 @@ -------------------------------------------------------------------------------- import Control.Concurrent (forkIO, myThreadId, threadDelay) import Control.Concurrent.MVar (MVar, newEmptyMVar, putMVar,- takeMVar)+ takeMVar, newMVar) import Control.Exception (Exception (..), SomeException (..), handle, throw, throwTo)@@ -90,19 +90,19 @@ :: E.Iteratee ByteString IO () -> IO (Maybe BL.ByteString -> IO ()) copyStreamToIteratee iteratee0 = do- ref <- newIORef =<< E.runIteratee iteratee0+ ref <- newMVar =<< E.runIteratee iteratee0 return (go ref) where go _ Nothing = return () go ref (Just bl) = do- step <- readIORef ref+ step <- takeMVar ref case step of E.Continue f -> do let chunks = BL.toChunks bl step' <- E.runIteratee $ f $ E.Chunks chunks- writeIORef ref step'- E.Yield () _ -> throw WS.ConnectionClosed- E.Error (SomeException e) -> throw e+ putMVar ref step'+ E.Yield () _ -> putMVar ref step >> throw WS.ConnectionClosed+ E.Error (SomeException e) -> putMVar ref step >> throw e --------------------------------------------------------------------------------
websockets-snap.cabal view
@@ -1,5 +1,5 @@ Name: websockets-snap-Version: 0.9.0.0+Version: 0.9.1.0 Synopsis: Snap integration for the websockets library Description: Snap integration for the websockets library License: BSD3