diff options
author | James Crayne <jim.crayne@gmail.com> | 2018-05-30 03:08:52 +0000 |
---|---|---|
committer | James Crayne <jim.crayne@gmail.com> | 2018-05-30 03:08:52 +0000 |
commit | 0e81474a6f2cd6d714b81e2fb6e0653b7c1e1845 (patch) | |
tree | 8bcf6fa65731fa83217dc011f6f33d435ec79530 /src/Network/Tox/Crypto/Handlers.hs | |
parent | db664d24a7263ba1842a926246556430c03edd8b (diff) |
fix backoff, and more debug prints
Diffstat (limited to 'src/Network/Tox/Crypto/Handlers.hs')
-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 486ee076..caf35a28 100644 --- a/src/Network/Tox/Crypto/Handlers.hs +++ b/src/Network/Tox/Crypto/Handlers.hs | |||
@@ -18,6 +18,7 @@ import Control.Applicative | |||
18 | import Control.Monad | 18 | import Control.Monad |
19 | import Data.Time.Clock.POSIX | 19 | import Data.Time.Clock.POSIX |
20 | import qualified Data.ByteString as B | 20 | import qualified Data.ByteString as B |
21 | import System.IO | ||
21 | import Data.ByteString (ByteString) | 22 | import Data.ByteString (ByteString) |
22 | import Control.Lens | 23 | import Control.Lens |
23 | import Data.Function | 24 | import Data.Function |
@@ -492,6 +493,7 @@ updateCryptoSession sessions addr hp session = do | |||
492 | 493 | ||
493 | cryptoNetHandler :: NetCryptoSessions -> SockAddr -> NetCrypto -> IO (Maybe (NetCrypto -> NetCrypto)) | 494 | cryptoNetHandler :: NetCryptoSessions -> SockAddr -> NetCrypto -> IO (Maybe (NetCrypto -> NetCrypto)) |
494 | cryptoNetHandler sessions addr (NetHandshake (Handshake (Cookie n24 ecookie) nonce24 encrypted)) = do | 495 | cryptoNetHandler sessions addr (NetHandshake (Handshake (Cookie n24 ecookie) nonce24 encrypted)) = do |
496 | hPutStrLn stderr ("RECIEVED HANDSHAKE from " ++ show addr) | ||
495 | -- Handle Handshake Message | 497 | -- Handle Handshake Message |
496 | let crypto = transportCrypto sessions | 498 | let crypto = transportCrypto sessions |
497 | allsessions = netCryptoSessions sessions | 499 | allsessions = netCryptoSessions sessions |
@@ -529,7 +531,7 @@ cryptoNetHandler sessions addr (NetHandshake (Handshake (Cookie n24 ecookie) non | |||
529 | , hpCookieRemoteDhtkey = remoteDhtkey | 531 | , hpCookieRemoteDhtkey = remoteDhtkey |
530 | } | 532 | } |
531 | case lr of | 533 | case lr of |
532 | Left _ -> return () | 534 | Left s -> hPutStrLn stderr ("cryptoNetHandler: " ++ s) |
533 | Right hp@(HParam | 535 | Right hp@(HParam |
534 | { hpTheirBaseNonce = Just theirBaseNonce | 536 | { hpTheirBaseNonce = Just theirBaseNonce |
535 | , hpOtherCookie = otherCookie | 537 | , hpOtherCookie = otherCookie |