wai-app-file-cgi 3.1.3 → 3.1.4
raw patch · 5 files changed
+32/−3 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Network/Wai/Application/Classic/CGI.hs +4/−0
- Network/Wai/Application/Classic/Conduit.hs +9/−1
- Network/Wai/Application/Classic/EventSource.hs +10/−1
- Network/Wai/Application/Classic/RevProxy.hs +8/−0
- wai-app-file-cgi.cabal +1/−1
Network/Wai/Application/Classic/CGI.hs view
@@ -66,7 +66,11 @@ type TRYPATH = Either E.IOException String toCGI :: Handle -> Request -> IO ()+#if MIN_VERSION_conduit(1,3,0)+toCGI whdl req = runConduit (sourceRequestBody req .| CB.sinkHandle whdl)+#else toCGI whdl req = sourceRequestBody req $$ CB.sinkHandle whdl+#endif fromCGI :: Handle -> IO Response fromCGI rhdl = do
Network/Wai/Application/Classic/Conduit.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE OverloadedStrings, CPP #-} module Network.Wai.Application.Classic.Conduit ( byteStringToBuilder@@ -25,11 +25,19 @@ ---------------------------------------------------------------- +#if MIN_VERSION_conduit(1,3,0)+toResponseSource :: SealedConduitT () ByteString IO ()+ -> IO (ConduitT () (Flush Builder) IO ())+toResponseSource rsrc = do+ let src = unsealConduitT rsrc+ return $ src .| CL.map (Chunk . byteStringToBuilder)+#else toResponseSource :: ResumableSource IO ByteString -> IO (Source IO (Flush Builder)) toResponseSource rsrc = do (src,_) <- unwrapResumable rsrc return $ src $= CL.map (Chunk . byteStringToBuilder)+#endif ----------------------------------------------------------------
Network/Wai/Application/Classic/EventSource.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE OverloadedStrings, CPP #-} module Network.Wai.Application.Classic.EventSource ( bodyToEventSource@@ -46,7 +46,11 @@ in xs:go ys 0 | otherwise = [bs] +#if MIN_VERSION_conduit(1,3,0)+eventSourceConduit :: ConduitT ByteString (Flush Builder) IO ()+#else eventSourceConduit :: Conduit ByteString IO (Flush Builder)+#endif eventSourceConduit = CL.concatMapAccum f "" where f input rest = (last xs, concatMap addFlush $ init xs)@@ -55,5 +59,10 @@ xs = splitDoubleLineBreak (rest `BS.append` input) -- insert Flush if exists a double line-break+#if MIN_VERSION_conduit(1,3,0)+bodyToEventSource :: H.BodyReader -> ConduitT () (Flush Builder) IO ()+bodyToEventSource br = HC.bodyReaderSource br .| eventSourceConduit+#else bodyToEventSource :: H.BodyReader -> Source IO (Flush Builder) bodyToEventSource br = HC.bodyReaderSource br $= eventSourceConduit+#endif
Network/Wai/Application/Classic/RevProxy.hs view
@@ -87,11 +87,19 @@ ---------------------------------------------------------------- +#if MIN_VERSION_conduit(1,3,0)+toSource :: Maybe ByteString -> H.BodyReader -> ConduitT () (Flush Builder) IO ()+#else toSource :: Maybe ByteString -> H.BodyReader -> Source IO (Flush Builder)+#endif toSource (Just "text/event-stream") = bodyToEventSource toSource _ = bodyToSource +#if MIN_VERSION_conduit(1,3,0)+bodyToSource :: H.BodyReader -> ConduitT () (Flush Builder) IO ()+#else bodyToSource :: H.BodyReader -> Source IO (Flush Builder)+#endif bodyToSource br = loop where loop = do
wai-app-file-cgi.cabal view
@@ -1,5 +1,5 @@ Name: wai-app-file-cgi-Version: 3.1.3+Version: 3.1.4 Author: Kazu Yamamoto <kazu@iij.ad.jp> Maintainer: Kazu Yamamoto <kazu@iij.ad.jp> License: BSD3