From 7f505a43b02dd98033a2e27dc040c3e7c1b20eaa Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Mon, 22 Feb 2016 12:09:56 -0500 Subject: Compiles with latest stackage lts However, it can't possibly work, because of this: XMPPServer.hs: > renderBuilderFlush = undefined The (real) definition of that function will have to be provided by a forked version of xml-conduit which is not included in this commit. --- Presence/XMPPServer.hs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Presence/XMPPServer.hs') diff --git a/Presence/XMPPServer.hs b/Presence/XMPPServer.hs index 1f88fb9c..6176bbe6 100644 --- a/Presence/XMPPServer.hs +++ b/Presence/XMPPServer.hs @@ -51,7 +51,7 @@ import qualified Data.Conduit.List as CL import qualified Data.Conduit.Binary as CB import Data.Conduit.Blaze (builderToByteStringFlush) -import qualified Text.XML.Stream.Render as XML +import qualified Text.XML.Stream.Render as XML hiding (content) import qualified Text.XML.Stream.Parse as XML import Data.XML.Types as XML import Data.Maybe @@ -77,6 +77,7 @@ import EventUtil import ControlMaybe import LockedChan import PeerResolve +import Blaze.ByteString.Builder (Builder) peerport :: PortNumber peerport = 5269 @@ -247,13 +248,17 @@ wlog s = putStrLn s >> hFlush stdout wlogb :: ByteString -> IO () wlogb s = Strict8.putStrLn s >> hFlush stdout +renderBuilderFlush :: Monad m => XML.RenderSettings -> Conduit (Flush Event) m (Flush Builder) +renderBuilderFlush = undefined + xmlStream :: ReadCommand -> WriteCommand -> ( Source IO XML.Event , Sink (Flush XML.Event) IO () ) xmlStream conread conwrite = (xsrc,xsnk) where xsrc = src $= XML.parseBytes XML.def + xsnk :: Sink (Flush Event) IO () xsnk = -- XML.renderBytes XML.def =$ snk - XML.renderBuilderFlush XML.def + renderBuilderFlush XML.def =$= builderToByteStringFlush =$= discardFlush =$ snk @@ -271,7 +276,7 @@ xmlStream conread conwrite = (xsrc,xsnk) (\v -> yield v >> src) v snk = awaitForever $ liftIO . conwrite - + type FlagCommand = STM Bool type ReadCommand = IO (Maybe ByteString) -- cgit v1.2.3