summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjim@bo <jim@bo>2018-06-21 17:34:25 -0400
committerjim@bo <jim@bo>2018-06-21 17:34:25 -0400
commit5a98b17cae0b612b303abcfe39618d580e9f925f (patch)
tree1281a340f4d46211c4bb0041e929e1d6efac2c84 /src
parent80a027b304b8f7601e377d44634311615c24de02 (diff)
TODO comments regarding ncStoredRequests
* In the case that the session seems to lock up, the packet requests could be (re-)handled without sorting. Just in case both sides are waiting on a missing packet.
Diffstat (limited to 'src')
-rw-r--r--src/Network/Tox/Crypto/Handlers.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs
index 2f22993f..c43542b1 100644
--- a/src/Network/Tox/Crypto/Handlers.hs
+++ b/src/Network/Tox/Crypto/Handlers.hs
@@ -344,6 +344,9 @@ data NetCryptoSession = NCrypto
344 -- helps ensure lossless packets are processed in order 344 -- helps ensure lossless packets are processed in order
345 , ncRequestInterval :: TVar Int 345 , ncRequestInterval :: TVar Int
346 -- ^ How long (in microseconds) to wait between packet requests 346 -- ^ How long (in microseconds) to wait between packet requests
347 -- , ncStoredRequests :: CyclicBuffer CryptoData
348 -- ^ Store the last 5 packet requests, try handling in any order
349 -- if the connection seems like it is locked (TODO)
347 , ncRequestThread :: TVar (Maybe ThreadId) 350 , ncRequestThread :: TVar (Maybe ThreadId)
348 -- ^ thread which sends packet requests 351 -- ^ thread which sends packet requests
349 , ncDequeueThread :: TVar (Maybe ThreadId) 352 , ncDequeueThread :: TVar (Maybe ThreadId)
@@ -602,6 +605,7 @@ freshCryptoSession sessions
602 Just theirSessionKey -> createNetCryptoOutQueue sessions newsession theirSessionKey pktq ncMyPacketNonce0 ncOutgoingIdMap0 605 Just theirSessionKey -> createNetCryptoOutQueue sessions newsession theirSessionKey pktq ncMyPacketNonce0 ncOutgoingIdMap0
603 mbpktoqVar <- newTVar mbpktoq 606 mbpktoqVar <- newTVar mbpktoq
604 lastNQ <- CB.new 10 0 :: STM (CyclicBuffer (Bool,(ViewSnapshot,InOrOut CryptoMessage))) 607 lastNQ <- CB.new 10 0 :: STM (CyclicBuffer (Bool,(ViewSnapshot,InOrOut CryptoMessage)))
608 -- ncStoredRequests0 <- CB.new 5 0 :: STM (CyclicBuffer CryptoData)
605 listeners <- newTVar IntMap.empty 609 listeners <- newTVar IntMap.empty
606 msgNum <- newTVar 0 610 msgNum <- newTVar 0
607 dropNum <- newTVar 0 611 dropNum <- newTVar 0
@@ -637,6 +641,7 @@ freshCryptoSession sessions
637 , ncOutgoingIdMapEscapedLossless = losslessEscapeIdMap 641 , ncOutgoingIdMapEscapedLossless = losslessEscapeIdMap
638 , ncView = ncView0 642 , ncView = ncView0
639 , ncPacketQueue = pktq 643 , ncPacketQueue = pktq
644 -- , ncStoredRequests = ncStoredRequests0 (TODO)
640 , ncRequestInterval = ncRequestInterval0 645 , ncRequestInterval = ncRequestInterval0
641 , ncRequestThread = ncRequestThread0 646 , ncRequestThread = ncRequestThread0
642 , ncDequeueThread = ncDequeueThread0 647 , ncDequeueThread = ncDequeueThread0