diff options
author | jim@bo <jim@bo> | 2018-06-21 17:02:47 -0400 |
---|---|---|
committer | jim@bo <jim@bo> | 2018-06-21 17:02:47 -0400 |
commit | 217823867e3874cb4d3d8d619bc192aaf6c78028 (patch) | |
tree | a4225fa927137961ccae4a0e824f5aaf5a361814 /src/Network/Tox/Crypto/Handlers.hs | |
parent | f0f2bd11e0fc53ee0442dd110ff0a297716f1eda (diff) |
DPut Trace Variations
tput - like dput, but works in any Applicative
dtrace - like trace, but takes DebugTag
Diffstat (limited to 'src/Network/Tox/Crypto/Handlers.hs')
-rw-r--r-- | src/Network/Tox/Crypto/Handlers.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs index 457171a9..44b2f26f 100644 --- a/src/Network/Tox/Crypto/Handlers.hs +++ b/src/Network/Tox/Crypto/Handlers.hs | |||
@@ -681,7 +681,7 @@ createNetCryptoOutQueue sessions newsession theirSessionKey pktq ncMyPacketNonce | |||
681 | addSessionToMap :: NetCryptoSessions -> SockAddr -> NetCryptoSession -> STM () | 681 | addSessionToMap :: NetCryptoSessions -> SockAddr -> NetCryptoSession -> STM () |
682 | addSessionToMap sessions addrRaw netCryptoSession = do | 682 | addSessionToMap sessions addrRaw netCryptoSession = do |
683 | let addr = either id id $ either4or6 addrRaw | 683 | let addr = either id id $ either4or6 addrRaw |
684 | let dmsg msg = trace msg (return ()) | 684 | let dmsg msg = tput XNetCrypto msg |
685 | dmsg $ "addSessionToMapIfNotThere sockaddr = " ++ show addr ++ ", sessionid = " ++ show (ncSessionId netCryptoSession) | 685 | dmsg $ "addSessionToMapIfNotThere sockaddr = " ++ show addr ++ ", sessionid = " ++ show (ncSessionId netCryptoSession) |
686 | let remotePublicKey = ncTheirPublicKey netCryptoSession | 686 | let remotePublicKey = ncTheirPublicKey netCryptoSession |
687 | allsessions = netCryptoSessions sessions | 687 | allsessions = netCryptoSessions sessions |
@@ -695,7 +695,7 @@ addSessionToMap sessions addrRaw netCryptoSession = do | |||
695 | addSessionToMapIfNotThere :: NetCryptoSessions -> SockAddr -> NetCryptoSession -> STM () | 695 | addSessionToMapIfNotThere :: NetCryptoSessions -> SockAddr -> NetCryptoSession -> STM () |
696 | addSessionToMapIfNotThere sessions addrRaw netCryptoSession = do | 696 | addSessionToMapIfNotThere sessions addrRaw netCryptoSession = do |
697 | let addr = either id id $ either4or6 addrRaw | 697 | let addr = either id id $ either4or6 addrRaw |
698 | let dmsg msg = trace msg (return ()) | 698 | let dmsg msg = tput XNetCrypto msg |
699 | dmsg $ "addSessionToMapIfNotThere sockaddr = " ++ show addr ++ ", sessionid = " ++ show (ncSessionId netCryptoSession) | 699 | dmsg $ "addSessionToMapIfNotThere sockaddr = " ++ show addr ++ ", sessionid = " ++ show (ncSessionId netCryptoSession) |
700 | let remotePublicKey = ncTheirPublicKey netCryptoSession | 700 | let remotePublicKey = ncTheirPublicKey netCryptoSession |
701 | allsessions = netCryptoSessions sessions | 701 | allsessions = netCryptoSessions sessions |
@@ -857,7 +857,7 @@ destroySession session = do | |||
857 | updateCryptoSession :: NetCryptoSessions -> SockAddr -> SecretKey -> POSIXTime -> HandshakeParams | 857 | updateCryptoSession :: NetCryptoSessions -> SockAddr -> SecretKey -> POSIXTime -> HandshakeParams |
858 | -> NetCryptoSession -> Handshake Encrypted -> STM (Maybe (Handshake Encrypted), IO ()) | 858 | -> NetCryptoSession -> Handshake Encrypted -> STM (Maybe (Handshake Encrypted), IO ()) |
859 | updateCryptoSession sessions addr newsession timestamp hp session handshake = do | 859 | updateCryptoSession sessions addr newsession timestamp hp session handshake = do |
860 | let dmsg msg = trace msg (return ()) | 860 | let dmsg msg = tput XNetCrypto msg |
861 | ncState0 <- readTVar (ncState session) | 861 | ncState0 <- readTVar (ncState session) |
862 | ncTheirBaseNonce0 <- readTVar (ncTheirBaseNonce session) | 862 | ncTheirBaseNonce0 <- readTVar (ncTheirBaseNonce session) |
863 | if (ncState0 >= {-Accepted-}InProgress AwaitingSessionPacket) | 863 | if (ncState0 >= {-Accepted-}InProgress AwaitingSessionPacket) |