diff options
author | joe <joe@jerkface.net> | 2013-11-18 17:55:02 -0500 |
---|---|---|
committer | joe <joe@jerkface.net> | 2013-11-18 17:55:02 -0500 |
commit | 274f90dca1a12844c797c86f12754475b42a65d8 (patch) | |
tree | 6b9c31fb4c9120fcd0d1bb0094dd79649da2fc6e /Presence/SendMessage.hs | |
parent | e1185a619f8a08c2311dbc20648d6377b5b5fc7e (diff) |
ping work
Diffstat (limited to 'Presence/SendMessage.hs')
-rw-r--r-- | Presence/SendMessage.hs | 6 |
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) | |||
53 | import ControlMaybe | 53 | import ControlMaybe |
54 | import Data.Conduit (Sink,Source) | 54 | import Data.Conduit (Sink,Source) |
55 | import qualified Data.ByteString as S (ByteString) | 55 | import qualified Data.ByteString as S (ByteString) |
56 | import qualified Data.ByteString.Lazy.Char8 as L | ||
56 | import XMLToByteStrings | 57 | import XMLToByteStrings |
57 | import Logging | 58 | import Logging |
58 | import ByteStringOperators | 59 | import 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 | ||
169 | connect' :: SockAddr -> Int -> IO (Maybe Socket) | 171 | connect' :: SockAddr -> Int -> IO (Maybe Socket) |