diff options
author | James Crayne <jim.crayne@gmail.com> | 2018-06-18 03:33:41 +0000 |
---|---|---|
committer | James Crayne <jim.crayne@gmail.com> | 2018-06-18 03:33:41 +0000 |
commit | bd8a498604fd976fee159d5b9d4a3582e769a5d5 (patch) | |
tree | fd1d6448830c2b555c65dba182e7d9e8fb653b0d /src/Network/Tox | |
parent | 7810e9bcde99a4bc05268b343ae3c21ae6fe8d7d (diff) |
show message on ping recieved
Diffstat (limited to 'src/Network/Tox')
-rw-r--r-- | src/Network/Tox/Crypto/Handlers.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs index 75446608..658032df 100644 --- a/src/Network/Tox/Crypto/Handlers.hs +++ b/src/Network/Tox/Crypto/Handlers.hs | |||
@@ -996,7 +996,7 @@ sessionPacketH sessions addrRaw (CryptoPacket nonce16 encrypted) = do | |||
996 | return Nothing -- drop packet, we have no session | 996 | return Nothing -- drop packet, we have no session |
997 | Just session@(NCrypto { ncIncomingTypeArray, ncState, ncPacketQueue, ncHooks, | 997 | Just session@(NCrypto { ncIncomingTypeArray, ncState, ncPacketQueue, ncHooks, |
998 | ncSessionSecret, ncTheirSessionPublic, ncTheirBaseNonce, | 998 | ncSessionSecret, ncTheirSessionPublic, ncTheirBaseNonce, |
999 | ncPingMachine}) -> do | 999 | ncPingMachine, ncSessionId}) -> do |
1000 | mbTheirBaseNonce <- atomically $ readTVar ncTheirBaseNonce | 1000 | mbTheirBaseNonce <- atomically $ readTVar ncTheirBaseNonce |
1001 | case mbTheirBaseNonce of | 1001 | case mbTheirBaseNonce of |
1002 | NeedHandshake -> dput XNetCrypto "CryptoPacket recieved, but we still dont have their base nonce?" >> return Nothing | 1002 | NeedHandshake -> dput XNetCrypto "CryptoPacket recieved, but we still dont have their base nonce?" >> return Nothing |
@@ -1070,6 +1070,8 @@ sessionPacketH sessions addrRaw (CryptoPacket nonce16 encrypted) = do | |||
1070 | atomically $ PQ.observeOutOfBand ncPacketQueue bufferEnd | 1070 | atomically $ PQ.observeOutOfBand ncPacketQueue bufferEnd |
1071 | runCryptoHook session (bufferData cd) | 1071 | runCryptoHook session (bufferData cd) |
1072 | else do dput XNetCrypto "enqueue ncPacketQueue Lossless" | 1072 | else do dput XNetCrypto "enqueue ncPacketQueue Lossless" |
1073 | when (msgID cm == PING) $ | ||
1074 | dput XNetCrypto $ "NetCrypto Recieved PING (session " ++ show ncSessionId ++")" | ||
1073 | atomically $ PQ.enqueue ncPacketQueue bufferEnd cd | 1075 | atomically $ PQ.enqueue ncPacketQueue bufferEnd cd |
1074 | return Nothing | 1076 | return Nothing |
1075 | where | 1077 | where |