summaryrefslogtreecommitdiff
path: root/Presence/SendMessage.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2013-11-18 17:55:02 -0500
committerjoe <joe@jerkface.net>2013-11-18 17:55:02 -0500
commit274f90dca1a12844c797c86f12754475b42a65d8 (patch)
tree6b9c31fb4c9120fcd0d1bb0094dd79649da2fc6e /Presence/SendMessage.hs
parente1185a619f8a08c2311dbc20648d6377b5b5fc7e (diff)
ping work
Diffstat (limited to 'Presence/SendMessage.hs')
-rw-r--r--Presence/SendMessage.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Presence/SendMessage.hs b/Presence/SendMessage.hs
index 71b6a3bd..e7b3db33 100644
--- a/Presence/SendMessage.hs
+++ b/Presence/SendMessage.hs
@@ -53,6 +53,7 @@ import ServerC (packetSink)
53import ControlMaybe 53import ControlMaybe
54import Data.Conduit (Sink,Source) 54import Data.Conduit (Sink,Source)
55import qualified Data.ByteString as S (ByteString) 55import qualified Data.ByteString as S (ByteString)
56import qualified Data.ByteString.Lazy.Char8 as L
56import XMLToByteStrings 57import XMLToByteStrings
57import Logging 58import Logging
58import ByteStringOperators 59import ByteStringOperators
@@ -125,7 +126,8 @@ sendMessage (OutgoingConnections cons interpretCommands) msg peer0 = do
125 ThreadFinished -> died 126 ThreadFinished -> died
126 ) 127 )
127 found 128 found
128 -- L.putStrLn $ "sendMessage ->"<++>showPeer peer<++>": "<++>bshow msg 129 if is_new then L.putStrLn $ "sendMessage NEW ->"<++>showPeer peer<++>": "<++>bshow msg
130 else L.putStrLn $ "sendMessage ->"<++>showPeer peer<++>": "<++>bshow msg
129 atomically $ writeTChan (fst entry) msg 131 atomically $ writeTChan (fst entry) msg
130 when is_new . atomically $ 132 when is_new . atomically $
131 readTVar cons >>= writeTVar cons . Map.insert peer entry 133 readTVar cons >>= writeTVar cons . Map.insert peer entry
@@ -163,7 +165,7 @@ connect_to_server chan peer toPeer = (>> return ()) . runMaybeT $ do
163 MaybeT $ handleOutgoingToPeer toPeer (restrictSocket sock) cache chan snk 165 MaybeT $ handleOutgoingToPeer toPeer (restrictSocket sock) cache chan snk
164 166
165 liftIO $ cacheCmd retry cached 167 liftIO $ cacheCmd retry cached
166 -- liftIO $ putStrLn $ "retrying " ++ show retry 168 liftIO $ putStrLn $ "retrying " ++ show retry
167 sendmsgs 169 sendmsgs
168 170
169connect' :: SockAddr -> Int -> IO (Maybe Socket) 171connect' :: SockAddr -> Int -> IO (Maybe Socket)