diff options
author | jim@bo <jim@bo> | 2018-06-20 20:47:59 -0400 |
---|---|---|
committer | jim@bo <jim@bo> | 2018-06-20 20:47:59 -0400 |
commit | f5f4934886a3a8aab4c8a8913346ca30bff80314 (patch) | |
tree | 0484691f3f8896218fbbd9d568c7c7a617c3529f /src/Network | |
parent | f0fa112544e6be6feb0fbb8e235e2c58d3e9c400 (diff) |
debug message in defaultUnRecHook
Diffstat (limited to 'src/Network')
-rw-r--r-- | src/Network/Tox/Crypto/Handlers.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs index dbfaede6..35681c4a 100644 --- a/src/Network/Tox/Crypto/Handlers.hs +++ b/src/Network/Tox/Crypto/Handlers.hs | |||
@@ -370,6 +370,8 @@ data NetCryptoSession = NCrypto | |||
370 | -- ^ user interfaces may "listen" by inserting themselves into this map | 370 | -- ^ user interfaces may "listen" by inserting themselves into this map |
371 | -- with a unique id and a new TChan, and then reading from the TChan | 371 | -- with a unique id and a new TChan, and then reading from the TChan |
372 | } | 372 | } |
373 | instance Eq NetCryptoSession where | ||
374 | x == y = ncSessionId x == ncSessionId y | ||
373 | 375 | ||
374 | data NetCryptoSessions = NCSessions | 376 | data NetCryptoSessions = NCSessions |
375 | { netCryptoSessions :: TVar (Map.Map SockAddr NetCryptoSession) | 377 | { netCryptoSessions :: TVar (Map.Map SockAddr NetCryptoSession) |
@@ -1320,7 +1322,9 @@ defaultStatusMsgHook session cm@(UpToN {msgID=STATUSMESSAGE, msgBytes=msg}) = do | |||
1320 | 1322 | ||
1321 | -- | updates ncLastNMsgs, and sends message to type-0 listeners | 1323 | -- | updates ncLastNMsgs, and sends message to type-0 listeners |
1322 | defaultUnRecHook :: MessageType -> NetCryptoHook | 1324 | defaultUnRecHook :: MessageType -> NetCryptoHook |
1323 | defaultUnRecHook = hookHelper False | 1325 | defaultUnRecHook typ session cm = do |
1326 | dput XNetCrypto $ "(NetCrypto) defaultUnRecHook: packet (sessionid: " ++ show (ncSessionId session) ++ ") " ++ show cm | ||
1327 | hookHelper False typ session cm | ||
1324 | 1328 | ||
1325 | hookHelper :: Bool -> MessageType -> NetCryptoHook | 1329 | hookHelper :: Bool -> MessageType -> NetCryptoHook |
1326 | hookHelper _ typ session cm | any ($ typ) [isKillPacket, isOFFLINE] = atomically $ do | 1330 | hookHelper _ typ session cm | any ($ typ) [isKillPacket, isOFFLINE] = atomically $ do |