From 07b1494c9d5c692371c9689a8f78f4cf7ee58732 Mon Sep 17 00:00:00 2001 From: joe Date: Mon, 18 Jun 2018 00:49:38 -0400 Subject: Tox: Added timestamps to dhtkey and sockaddr information. --- Connection/Tox/Threads.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Connection/Tox/Threads.hs') diff --git a/Connection/Tox/Threads.hs b/Connection/Tox/Threads.hs index 5602fa40..a5a839f9 100644 --- a/Connection/Tox/Threads.hs +++ b/Connection/Tox/Threads.hs @@ -32,6 +32,7 @@ import Control.Concurrent.Lifted import GHC.Conc (labelThread) #endif +import Control.Arrow import Control.Concurrent.STM import Control.Monad import Data.Function @@ -124,15 +125,15 @@ persueContact getPolicy getStatus PersueContactMethods{..} statusVar = do $ \retryAfterTimeout -> orElse (do readTVar statusVar >>= check . (/= InProgress AcquiringIPAddress) - theirDhtKey <- DHT.dhtpk <$> retryUntilJust (contactKeyPacket contact) + (stamp_theirDhtKey,theirDhtKey) <- second DHT.dhtpk <$> retryUntilJust (contactKeyPacket contact) -- We don't have an IP address yet. maybe (return ()) (const retry) =<< readTVar (contactLastSeenAddr contact) return $ do -- AcquiringIPAddress atomically $ writeTVar statusVar (InProgress AcquiringIPAddress) retryAfterTimeout 0) (do - theirDhtKey <- DHT.dhtpk <$> retryUntilJust (contactKeyPacket contact) - saddr <- retryUntilJust (contactLastSeenAddr contact) + (stamp_theirDhtKey,theirDhtKey) <- second DHT.dhtpk <$> retryUntilJust (contactKeyPacket contact) + (stamp_saddr,saddr) <- retryUntilJust (contactLastSeenAddr contact) ni <- either (const retry) return $ nodeInfo (key2id theirDhtKey) saddr return $ do -- AcquiringCookie -- cgit v1.2.3