on master help sign in
Everything compiles with conduit 0.4
commit416cb5d4666f47f16147f9ba4960aaf13ea63eb0 authorMichael Snoyman <michael@snoyman.com> dateTue 27 Mar 2012, 14:07 (15 years ago) parente16466a
10 files changed+26−20
wai-eventsource/wai-eventsource.cabal+1−1 wai-extra/Network/Wai/Handler/CGI.hs+3−3 wai-extra/wai-extra.cabal+3−3 wai-frontend-monadcgi/wai-frontend-monadcgi.cabal+1−1 wai-handler-launch/wai-handler-launch.cabal+3−3 wai-test/Network/Wai/Test.hs+7−1 wai-test/wai-test.cabal+2−2 wai-websockets/Network/Wai/Handler/WebSockets.hs+3−3 wai-websockets/wai-websockets.cabal+1−1 warp-tls/warp-tls.cabal+2−2
wai-eventsource/wai-eventsource.cabal+1−1
@@ -17,7 +17,7 @@ Library
1717 base >= 4.3 && < 5
1818 , bytestring >= 0.9.1.4 && < 0.10
1919 , blaze-builder >= 0.3 && < 0.4
20− , conduit >= 0.3 && < 0.4
20+ , conduit >= 0.4 && < 0.5
2121 , http-types >= 0.6 && < 0.7
2222 , wai >= 1.2 && < 1.3
2323 , warp >= 1.2 && < 1.3
wai-extra/Network/Wai/Handler/CGI.hs+3−3
@@ -141,10 +141,10 @@ runGeneric vars inputH outputH xsendfile app = do
141141 , fromByteString sf
142142 , fromByteString " not supported"
143143 ]
144− bsSink = C.Processing push (return ())
145− push (C.Chunk bs) = C.SinkM $ do
144+ bsSink = C.NeedInput push (return ())
145+ push (C.Chunk bs) = C.PipeM (do
146146 liftIO $ outputH bs
147− return bsSink
147+ return bsSink) (return ())
148148 -- FIXME actually flush?
149149 push C.Flush = bsSink
150150 builderSink = builderToByteStringFlush C.=$ bsSink
wai-extra/wai-extra.cabal+3−3
@@ -34,9 +34,9 @@ Library
3434 , case-insensitive >= 0.2
3535 , data-default >= 0.3 && < 0.4
3636 , fast-logger >= 0.0.2
37− , conduit >= 0.3 && < 0.4
38− , zlib-conduit >= 0.3 && < 0.4
39− , blaze-builder-conduit >= 0.3 && < 0.4
37+ , conduit >= 0.4 && < 0.5
38+ , zlib-conduit >= 0.4 && < 0.5
39+ , blaze-builder-conduit >= 0.4 && < 0.5
4040 , ansi-terminal
4141
4242 Exposed-modules: Network.Wai.Handler.CGI
wai-frontend-monadcgi/wai-frontend-monadcgi.cabal+1−1
@@ -16,7 +16,7 @@ library
1616 , bytestring
1717 , containers >= 0.2
1818 , cgi
19− , conduit >= 0.2
19+ , conduit >= 0.4
2020 , http-types
2121 , transformers
2222 , case-insensitive
wai-handler-launch/wai-handler-launch.cabal+3−3
@@ -19,9 +19,9 @@ Library
1919 , transformers >= 0.2.2 && < 0.3
2020 , bytestring >= 0.9.1.4 && < 0.10
2121 , blaze-builder >= 0.2.1.4 && < 0.4
22− , conduit >= 0.3 && < 0.4
23− , blaze-builder-conduit >= 0.3 && < 0.4
24− , zlib-conduit >= 0.3 && < 0.4
22+ , conduit >= 0.4 && < 0.5
23+ , blaze-builder-conduit >= 0.4 && < 0.5
24+ , zlib-conduit >= 0.4 && < 0.5
2525
2626 if os(windows)
2727 c-sources: windows.c
wai-test/Network/Wai/Test.hs+7−1
@@ -99,13 +99,19 @@ srequest (SRequest req bod) = do
9999
100100runResponse :: Response -> C.ResourceT IO SResponse
101101runResponse res = do
102− bss <- fmap toBuilder body C.$= builderToByteString C.$$ CL.consume
102+ bss <- fmap2 toBuilder body C.$= builderToByteString C.$$ CL.consume
103103 return $ SResponse s h $ L.fromChunks bss
104104 where
105105 (s, h, body) = responseSource res
106106 toBuilder (C.Chunk builder) = builder
107107 toBuilder C.Flush = flush
108108
109+fmap2 :: Functor m => (a -> b) -> C.Source m a -> C.Source m b
110+fmap2 f (C.HaveOutput p c o) = C.HaveOutput (fmap2 f p) c (f o)
111+fmap2 f (C.NeedInput p c) = C.NeedInput (fmap2 f . p) (fmap2 f c)
112+fmap2 _ (C.Done i r) = C.Done i r
113+fmap2 f (C.PipeM mp c) = C.PipeM (fmap (fmap2 f) mp) c
114+
109115assertBool :: String -> Bool -> Session ()
110116assertBool s b = liftIO $ H.assertBool s b
111117
wai-test/wai-test.cabal+2−2
@@ -20,8 +20,8 @@ library
2020 , blaze-builder >= 0.2.1.4 && < 0.4
2121 , transformers >= 0.2.2 && < 0.3
2222 , containers >= 0.2 && < 0.5
23− , conduit >= 0.3 && < 0.4
24− , blaze-builder-conduit >= 0.3 && < 0.4
23+ , conduit >= 0.4 && < 0.5
24+ , blaze-builder-conduit >= 0.4 && < 0.5
2525 , cookie >= 0.2 && < 0.5
2626 , HUnit >= 1.2 && < 1.3
2727 , http-types >= 0.6 && < 0.7
wai-websockets/Network/Wai/Handler/WebSockets.hs+3−3
@@ -18,7 +18,7 @@ import qualified Network.WebSockets as WS
1818intercept :: WS.Protocol p
1919 => (WS.Request -> WS.WebSockets p ())
2020 -> Wai.Request
21− -> Maybe (C.BufferedSource (C.ResourceT IO) ByteString -> Warp.Connection -> C.ResourceT IO ())
21+ -> Maybe (C.Source (C.ResourceT IO) ByteString -> Warp.Connection -> C.ResourceT IO ())
2222intercept = interceptWith WS.defaultWebSocketsOptions
2323
2424-- | Variation of 'intercept' which allows custom options.
@@ -26,7 +26,7 @@ interceptWith :: WS.Protocol p
2626 => WS.WebSocketsOptions
2727 -> (WS.Request -> WS.WebSockets p ())
2828 -> Wai.Request
29− -> Maybe (C.BufferedSource (C.ResourceT IO) ByteString -> Warp.Connection -> C.ResourceT IO ())
29+ -> Maybe (C.Source (C.ResourceT IO) ByteString -> Warp.Connection -> C.ResourceT IO ())
3030interceptWith opts app req = case lookup "upgrade" $ Wai.requestHeaders req of
3131 Just s
3232 | S.map toLower s == "websocket" -> Just $ runWebSockets opts req' app
@@ -41,7 +41,7 @@ runWebSockets :: WS.Protocol p
4141 => WS.WebSocketsOptions
4242 -> WS.RequestHttpPart
4343 -> (WS.Request -> WS.WebSockets p ())
44− -> C.BufferedSource (C.ResourceT IO) ByteString
44+ -> C.Source (C.ResourceT IO) ByteString
4545 -> Warp.Connection
4646 -> C.ResourceT IO ()
4747runWebSockets opts req app source conn = do
wai-websockets/wai-websockets.cabal+1−1
@@ -19,7 +19,7 @@ flag example
1919Library
2020 Build-Depends: base >= 3 && < 5
2121 , bytestring >= 0.9.1.4 && < 0.10
22− , conduit >= 0.3 && < 0.4
22+ , conduit >= 0.4 && < 0.5
2323 , wai >= 1.2 && < 1.3
2424 , enumerator >= 0.4.8 && < 0.5
2525 , network-enumerator >= 0.1.2 && < 0.2
warp-tls/warp-tls.cabal+2−2
@@ -18,8 +18,8 @@ Library
1818 , wai >= 1.2 && < 1.3
1919 , warp >= 1.2 && < 1.3
2020 , transformers >= 0.2 && < 0.3
21− , conduit >= 0.3 && < 0.4
22− , network-conduit >= 0.3 && < 0.4
21+ , conduit >= 0.4 && < 0.5
22+ , network-conduit >= 0.4 && < 0.5
2323 , certificate >= 1.1 && < 1.2
2424 , cryptocipher >= 0.3 && < 0.4
2525 , tls-extra >= 0.4.3 && < 0.5