diff --git a/wai-eventsource/wai-eventsource.cabal b/wai-eventsource/wai-eventsource.cabal index b1761b18..37f0b160 100644 --- a/wai-eventsource/wai-eventsource.cabal +++ b/wai-eventsource/wai-eventsource.cabal @@ -17,7 +17,7 @@ Library base >= 4.3 && < 5 , bytestring >= 0.9.1.4 && < 0.10 , blaze-builder >= 0.3 && < 0.4 - , conduit >= 0.3 && < 0.4 + , conduit >= 0.4 && < 0.5 , http-types >= 0.6 && < 0.7 , wai >= 1.2 && < 1.3 , warp >= 1.2 && < 1.3 diff --git a/wai-extra/Network/Wai/Handler/CGI.hs b/wai-extra/Network/Wai/Handler/CGI.hs index dec6fefe..b9d440a3 100755 --- a/wai-extra/Network/Wai/Handler/CGI.hs +++ b/wai-extra/Network/Wai/Handler/CGI.hs @@ -141,10 +141,10 @@ runGeneric vars inputH outputH xsendfile app = do , fromByteString sf , fromByteString " not supported" ] - bsSink = C.Processing push (return ()) - push (C.Chunk bs) = C.SinkM $ do + bsSink = C.NeedInput push (return ()) + push (C.Chunk bs) = C.PipeM (do liftIO $ outputH bs - return bsSink + return bsSink) (return ()) -- FIXME actually flush? push C.Flush = bsSink builderSink = builderToByteStringFlush C.=$ bsSink diff --git a/wai-extra/wai-extra.cabal b/wai-extra/wai-extra.cabal index dbdb7835..23254b1d 100644 --- a/wai-extra/wai-extra.cabal +++ b/wai-extra/wai-extra.cabal @@ -34,9 +34,9 @@ Library , case-insensitive >= 0.2 , data-default >= 0.3 && < 0.4 , fast-logger >= 0.0.2 - , conduit >= 0.3 && < 0.4 - , zlib-conduit >= 0.3 && < 0.4 - , blaze-builder-conduit >= 0.3 && < 0.4 + , conduit >= 0.4 && < 0.5 + , zlib-conduit >= 0.4 && < 0.5 + , blaze-builder-conduit >= 0.4 && < 0.5 , ansi-terminal Exposed-modules: Network.Wai.Handler.CGI diff --git a/wai-frontend-monadcgi/wai-frontend-monadcgi.cabal b/wai-frontend-monadcgi/wai-frontend-monadcgi.cabal index 13166f21..42d1e077 100644 --- a/wai-frontend-monadcgi/wai-frontend-monadcgi.cabal +++ b/wai-frontend-monadcgi/wai-frontend-monadcgi.cabal @@ -16,7 +16,7 @@ library , bytestring , containers >= 0.2 , cgi - , conduit >= 0.2 + , conduit >= 0.4 , http-types , transformers , case-insensitive diff --git a/wai-handler-launch/wai-handler-launch.cabal b/wai-handler-launch/wai-handler-launch.cabal index 312dcfc7..5e075450 100644 --- a/wai-handler-launch/wai-handler-launch.cabal +++ b/wai-handler-launch/wai-handler-launch.cabal @@ -19,9 +19,9 @@ Library , transformers >= 0.2.2 && < 0.3 , bytestring >= 0.9.1.4 && < 0.10 , blaze-builder >= 0.2.1.4 && < 0.4 - , conduit >= 0.3 && < 0.4 - , blaze-builder-conduit >= 0.3 && < 0.4 - , zlib-conduit >= 0.3 && < 0.4 + , conduit >= 0.4 && < 0.5 + , blaze-builder-conduit >= 0.4 && < 0.5 + , zlib-conduit >= 0.4 && < 0.5 if os(windows) c-sources: windows.c diff --git a/wai-test/Network/Wai/Test.hs b/wai-test/Network/Wai/Test.hs index d26de436..314def60 100644 --- a/wai-test/Network/Wai/Test.hs +++ b/wai-test/Network/Wai/Test.hs @@ -99,13 +99,19 @@ srequest (SRequest req bod) = do runResponse :: Response -> C.ResourceT IO SResponse runResponse res = do - bss <- fmap toBuilder body C.$= builderToByteString C.$$ CL.consume + bss <- fmap2 toBuilder body C.$= builderToByteString C.$$ CL.consume return $ SResponse s h $ L.fromChunks bss where (s, h, body) = responseSource res toBuilder (C.Chunk builder) = builder toBuilder C.Flush = flush +fmap2 :: Functor m => (a -> b) -> C.Source m a -> C.Source m b +fmap2 f (C.HaveOutput p c o) = C.HaveOutput (fmap2 f p) c (f o) +fmap2 f (C.NeedInput p c) = C.NeedInput (fmap2 f . p) (fmap2 f c) +fmap2 _ (C.Done i r) = C.Done i r +fmap2 f (C.PipeM mp c) = C.PipeM (fmap (fmap2 f) mp) c + assertBool :: String -> Bool -> Session () assertBool s b = liftIO $ H.assertBool s b diff --git a/wai-test/wai-test.cabal b/wai-test/wai-test.cabal index a73dc6ca..b9878220 100644 --- a/wai-test/wai-test.cabal +++ b/wai-test/wai-test.cabal @@ -20,8 +20,8 @@ library , blaze-builder >= 0.2.1.4 && < 0.4 , transformers >= 0.2.2 && < 0.3 , containers >= 0.2 && < 0.5 - , conduit >= 0.3 && < 0.4 - , blaze-builder-conduit >= 0.3 && < 0.4 + , conduit >= 0.4 && < 0.5 + , blaze-builder-conduit >= 0.4 && < 0.5 , cookie >= 0.2 && < 0.5 , HUnit >= 1.2 && < 1.3 , http-types >= 0.6 && < 0.7 diff --git a/wai-websockets/Network/Wai/Handler/WebSockets.hs b/wai-websockets/Network/Wai/Handler/WebSockets.hs index 81f74fb7..96c15873 100644 --- a/wai-websockets/Network/Wai/Handler/WebSockets.hs +++ b/wai-websockets/Network/Wai/Handler/WebSockets.hs @@ -18,7 +18,7 @@ import qualified Network.WebSockets as WS intercept :: WS.Protocol p => (WS.Request -> WS.WebSockets p ()) -> Wai.Request - -> Maybe (C.BufferedSource (C.ResourceT IO) ByteString -> Warp.Connection -> C.ResourceT IO ()) + -> Maybe (C.Source (C.ResourceT IO) ByteString -> Warp.Connection -> C.ResourceT IO ()) intercept = interceptWith WS.defaultWebSocketsOptions -- | Variation of 'intercept' which allows custom options. @@ -26,7 +26,7 @@ interceptWith :: WS.Protocol p => WS.WebSocketsOptions -> (WS.Request -> WS.WebSockets p ()) -> Wai.Request - -> Maybe (C.BufferedSource (C.ResourceT IO) ByteString -> Warp.Connection -> C.ResourceT IO ()) + -> Maybe (C.Source (C.ResourceT IO) ByteString -> Warp.Connection -> C.ResourceT IO ()) interceptWith opts app req = case lookup "upgrade" $ Wai.requestHeaders req of Just s | S.map toLower s == "websocket" -> Just $ runWebSockets opts req' app @@ -41,7 +41,7 @@ runWebSockets :: WS.Protocol p => WS.WebSocketsOptions -> WS.RequestHttpPart -> (WS.Request -> WS.WebSockets p ()) - -> C.BufferedSource (C.ResourceT IO) ByteString + -> C.Source (C.ResourceT IO) ByteString -> Warp.Connection -> C.ResourceT IO () runWebSockets opts req app source conn = do diff --git a/wai-websockets/wai-websockets.cabal b/wai-websockets/wai-websockets.cabal index 546d5d6b..f40c44cc 100644 --- a/wai-websockets/wai-websockets.cabal +++ b/wai-websockets/wai-websockets.cabal @@ -19,7 +19,7 @@ flag example Library Build-Depends: base >= 3 && < 5 , bytestring >= 0.9.1.4 && < 0.10 - , conduit >= 0.3 && < 0.4 + , conduit >= 0.4 && < 0.5 , wai >= 1.2 && < 1.3 , enumerator >= 0.4.8 && < 0.5 , network-enumerator >= 0.1.2 && < 0.2 diff --git a/warp-tls/warp-tls.cabal b/warp-tls/warp-tls.cabal index 0d083568..55be8045 100644 --- a/warp-tls/warp-tls.cabal +++ b/warp-tls/warp-tls.cabal @@ -18,8 +18,8 @@ Library , wai >= 1.2 && < 1.3 , warp >= 1.2 && < 1.3 , transformers >= 0.2 && < 0.3 - , conduit >= 0.3 && < 0.4 - , network-conduit >= 0.3 && < 0.4 + , conduit >= 0.4 && < 0.5 + , network-conduit >= 0.4 && < 0.5 , certificate >= 1.1 && < 1.2 , cryptocipher >= 0.3 && < 0.4 , tls-extra >= 0.4.3 && < 0.5