summaryrefslogtreecommitdiff
path: root/Presence/XMPPServer.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Presence/XMPPServer.hs')
-rw-r--r--Presence/XMPPServer.hs11
1 files changed, 8 insertions, 3 deletions
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
51import qualified Data.Conduit.Binary as CB 51import qualified Data.Conduit.Binary as CB
52import Data.Conduit.Blaze (builderToByteStringFlush) 52import Data.Conduit.Blaze (builderToByteStringFlush)
53 53
54import qualified Text.XML.Stream.Render as XML 54import qualified Text.XML.Stream.Render as XML hiding (content)
55import qualified Text.XML.Stream.Parse as XML 55import qualified Text.XML.Stream.Parse as XML
56import Data.XML.Types as XML 56import Data.XML.Types as XML
57import Data.Maybe 57import Data.Maybe
@@ -77,6 +77,7 @@ import EventUtil
77import ControlMaybe 77import ControlMaybe
78import LockedChan 78import LockedChan
79import PeerResolve 79import PeerResolve
80import Blaze.ByteString.Builder (Builder)
80 81
81peerport :: PortNumber 82peerport :: PortNumber
82peerport = 5269 83peerport = 5269
@@ -247,13 +248,17 @@ wlog s = putStrLn s >> hFlush stdout
247wlogb :: ByteString -> IO () 248wlogb :: ByteString -> IO ()
248wlogb s = Strict8.putStrLn s >> hFlush stdout 249wlogb s = Strict8.putStrLn s >> hFlush stdout
249 250
251renderBuilderFlush :: Monad m => XML.RenderSettings -> Conduit (Flush Event) m (Flush Builder)
252renderBuilderFlush = undefined
253
250xmlStream :: ReadCommand -> WriteCommand -> ( Source IO XML.Event 254xmlStream :: ReadCommand -> WriteCommand -> ( Source IO XML.Event
251 , Sink (Flush XML.Event) IO () ) 255 , Sink (Flush XML.Event) IO () )
252xmlStream conread conwrite = (xsrc,xsnk) 256xmlStream conread conwrite = (xsrc,xsnk)
253 where 257 where
254 xsrc = src $= XML.parseBytes XML.def 258 xsrc = src $= XML.parseBytes XML.def
259 xsnk :: Sink (Flush Event) IO ()
255 xsnk = -- XML.renderBytes XML.def =$ snk 260 xsnk = -- XML.renderBytes XML.def =$ snk
256 XML.renderBuilderFlush XML.def 261 renderBuilderFlush XML.def
257 =$= builderToByteStringFlush 262 =$= builderToByteStringFlush
258 =$= discardFlush 263 =$= discardFlush
259 =$ snk 264 =$ snk
@@ -271,7 +276,7 @@ xmlStream conread conwrite = (xsrc,xsnk)
271 (\v -> yield v >> src) 276 (\v -> yield v >> src)
272 v 277 v
273 snk = awaitForever $ liftIO . conwrite 278 snk = awaitForever $ liftIO . conwrite
274 279
275 280
276type FlagCommand = STM Bool 281type FlagCommand = STM Bool
277type ReadCommand = IO (Maybe ByteString) 282type ReadCommand = IO (Maybe ByteString)