packages feed

ngx-export 1.0 → 1.0.1

raw patch · 3 files changed

+15/−8 lines, 3 filesdep +deepseq

Dependencies added: deepseq

Files

Changelog.md view
@@ -1,3 +1,8 @@+### 1.0.1++- Using deepseq for really deep evaluation of resulting lazy bytestrings to+  prevent leaks of exceptions outside of protected code.+ ### 1.0  - Added an asynchronous content handler exported with *ngxExportAsyncHandler*.
NgxExport.hs view
@@ -52,6 +52,7 @@ import           System.Posix.Internals import           Control.Monad import           Control.Monad.Loops+import           Control.DeepSeq import qualified Control.Exception as E import           Control.Exception hiding (Handler) import           GHC.IO.Exception (ioe_errno)@@ -304,7 +305,7 @@        Ptr CString -> Ptr CSize -> Ptr CInt -> IO CUInt|]  -- | Exports a function of type--- /'B.ByteString' -> IO ('L.ByteString', 'B.ByteString', 'Int')/+-- /'B.ByteString' -> 'IO' ('L.ByteString', 'B.ByteString', 'Int')/ -- for using in directive /haskell_async_content/. -- -- The first element in the returned /3-tuple/ of the exported function is@@ -463,7 +464,7 @@ yY f x (I n) p pl spd = do     (s, (r, _)) <- safeYYHandler $ do         s <- f <$> B.unsafePackCStringLen (x, n)-        fmap (flip (,) (0, False)) $ return $! s+        fmap (flip (,) (0, False)) $ return $!! s     pokeLazyByteString s p pl spd     return r @@ -473,7 +474,7 @@ ioyY f x (I n) p pl spd = do     (s, (r, _)) <- safeYYHandler $ do         s <- B.unsafePackCStringLen (x, n) >>= flip f False-        fmap (flip (,) (0, False)) $ return $! s+        fmap (flip (,) (0, False)) $ return $!! s     pokeLazyByteString s p pl spd     return r @@ -491,7 +492,7 @@     (do         (s, (r, exiting)) <- safeYYHandler $ do             (s, exiting) <- a-            fmap (flip (,) (0, exiting)) $ return $! s+            fmap (flip (,) (0, exiting)) $ return $!! s         pokeLazyByteString s p pl spd         poke pr r         if exiting@@ -561,7 +562,7 @@     (do         x' <- B.unsafePackCStringLen (x, n)         (s, ct, I st) <- f x'-        (return $! s) >> pokeContentTypeAndStatus ct pct plct pst st+        (return $!! s) >> pokeContentTypeAndStatus ct pct plct pst st         newStablePtr ct >>= poke spct         return (s, False)     ) fd efd@@ -605,7 +606,7 @@ handler f x (I n) p pl pct plct spct pst spd =     safeHandler pct pst $ do         (s, ct, I st) <- f <$> B.unsafePackCStringLen (x, n)-        pokeContentTypeAndStatus ct pct plct pst st+        (return $!! s) >> pokeContentTypeAndStatus ct pct plct pst st         pokeLazyByteString s p pl spd         newStablePtr ct >>= poke spct         return 0@@ -624,7 +625,7 @@ unsafeHandler f x (I n) p pl pct plct pst =     safeHandler pct pst $ do         (s, ct, I st) <- f <$> B.unsafePackCStringLen (x, n)-        pokeContentTypeAndStatus ct pct plct pst st+        (return $!! s) >> pokeContentTypeAndStatus ct pct plct pst st         PtrLen t l <- B.unsafeUseAsCStringLen s return         pokeCStringLen t l p pl         return 0
ngx-export.cabal view
@@ -1,5 +1,5 @@ name:                       ngx-export-version:                    1.0+version:                    1.0.1 synopsis:                   Helper module for Nginx haskell module description:                Helper module for         <http://github.com/lyokha/nginx-haskell-module Nginx haskell module>@@ -20,6 +20,7 @@                           , template-haskell                           , bytestring >= 0.10.0.0                           , monad-loops >= 0.4.2+                          , deepseq >= 1.2.0.0                           , binary >= 0.8.1.0                           , async >= 2.0                           , unix