summaryrefslogtreecommitdiff
path: root/src/Network/Tox/Crypto/Handlers.hs
diff options
context:
space:
mode:
authorJames Crayne <jim.crayne@gmail.com>2018-05-30 03:08:52 +0000
committerJames Crayne <jim.crayne@gmail.com>2018-05-30 03:08:52 +0000
commit0e81474a6f2cd6d714b81e2fb6e0653b7c1e1845 (patch)
tree8bcf6fa65731fa83217dc011f6f33d435ec79530 /src/Network/Tox/Crypto/Handlers.hs
parentdb664d24a7263ba1842a926246556430c03edd8b (diff)
fix backoff, and more debug prints
Diffstat (limited to 'src/Network/Tox/Crypto/Handlers.hs')
-rw-r--r--src/Network/Tox/Crypto/Handlers.hs4
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
18import Control.Monad 18import Control.Monad
19import Data.Time.Clock.POSIX 19import Data.Time.Clock.POSIX
20import qualified Data.ByteString as B 20import qualified Data.ByteString as B
21import System.IO
21import Data.ByteString (ByteString) 22import Data.ByteString (ByteString)
22import Control.Lens 23import Control.Lens
23import Data.Function 24import Data.Function
@@ -492,6 +493,7 @@ updateCryptoSession sessions addr hp session = do
492 493
493cryptoNetHandler :: NetCryptoSessions -> SockAddr -> NetCrypto -> IO (Maybe (NetCrypto -> NetCrypto)) 494cryptoNetHandler :: NetCryptoSessions -> SockAddr -> NetCrypto -> IO (Maybe (NetCrypto -> NetCrypto))
494cryptoNetHandler sessions addr (NetHandshake (Handshake (Cookie n24 ecookie) nonce24 encrypted)) = do 495cryptoNetHandler 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