summaryrefslogtreecommitdiff
path: root/src/Network/Tox/Crypto/Handlers.hs
diff options
context:
space:
mode:
authorjim@bo <jim@bo>2018-06-21 04:43:44 -0400
committerjim@bo <jim@bo>2018-06-21 04:43:44 -0400
commit32c87f6b6b632ac3a13bc504d80bedc7e6a52bdd (patch)
treedfee221e7d8ee376f52d66aa675df55ef3d57369 /src/Network/Tox/Crypto/Handlers.hs
parenta33fd34516e405d29654dff85df235b3c26ab565 (diff)
netCrypto packet-request thread wip (continued)
Diffstat (limited to 'src/Network/Tox/Crypto/Handlers.hs')
-rw-r--r--src/Network/Tox/Crypto/Handlers.hs12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs
index ea5c0f98..356ddf24 100644
--- a/src/Network/Tox/Crypto/Handlers.hs
+++ b/src/Network/Tox/Crypto/Handlers.hs
@@ -753,15 +753,9 @@ runUponHandshake netCryptoSession0 addr pktoq = do
753 labelThread tid ("NetCryptoRequest." ++ show (key2id remotePublicKey) ++ sidStr) 753 labelThread tid ("NetCryptoRequest." ++ show (key2id remotePublicKey) ++ sidStr)
754 fix $ \loop -> do 754 fix $ \loop -> do
755 atomically (readTVar (ncRequestInterval netCryptoSession0)) >>= threadDelay 755 atomically (readTVar (ncRequestInterval netCryptoSession0)) >>= threadDelay
756 result <- atomically $ PQ.dequeueOrGetMissing pktq 756 nums <- atomically $ PQ.getMissing pktq
757 case result of 757 dput XNetCrypto $ "(Request Thread) Missing Packets detected:" ++ show nums
758 Right cd -> do 758 dput XNetCrypto $ "TODO: compose PacketRequest message and send it."
759 dput XNetCrypto $ "Dequeued(Request Thread)::" ++ show (bufferData cd) ++ " now running hook..."
760 _ <- runCryptoHook netCryptoSession0 (bufferData cd)
761 return ()
762 Left nums -> do
763 dput XNetCrypto $ "(Request Thread) Missing Packets detected:" ++ show nums
764 dput XNetCrypto $ "TODO: compose PacketRequest message and send it."
765 loop 759 loop
766 dput XNetCrypto $ "runUponHandshake: " ++ show threadid ++ " = NetCryptoRequest." ++ show (key2id remotePublicKey) ++ sidStr 760 dput XNetCrypto $ "runUponHandshake: " ++ show threadid ++ " = NetCryptoRequest." ++ show (key2id remotePublicKey) ++ sidStr
767 -- launch dequeueOutgoing thread 761 -- launch dequeueOutgoing thread