diff options
author | jim@bo <jim@bo> | 2018-06-26 03:41:35 -0400 |
---|---|---|
committer | jim@bo <jim@bo> | 2018-06-26 03:41:35 -0400 |
commit | b2e6800535affc9387339bc759dda28d54f38e39 (patch) | |
tree | 4a69f33683325cb555f4fb4336eb13e399f23aa3 | |
parent | 53b72dd253ce01a24430429cef400675401292dc (diff) |
handle packet requests immediately
-rw-r--r-- | src/Network/Tox/Crypto/Handlers.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs index 85e6192a..4d34701a 100644 --- a/src/Network/Tox/Crypto/Handlers.hs +++ b/src/Network/Tox/Crypto/Handlers.hs | |||
@@ -481,7 +481,7 @@ newSessionsState crypto destroyHook unrechook hooks = do | |||
481 | , transportCrypto = crypto | 481 | , transportCrypto = crypto |
482 | , defaultHooks = hooks | 482 | , defaultHooks = hooks |
483 | , defaultUnrecognizedHook = unrechook | 483 | , defaultUnrecognizedHook = unrechook |
484 | , defaultIdleEventHooks = [(0,handleRequestsOutOfOrder)] | 484 | , defaultIdleEventHooks = [] -- [(0,handleRequestsOutOfOrder)] |
485 | , defaultDestroyHook = [(0,destroyHook)] | 485 | , defaultDestroyHook = [(0,destroyHook)] |
486 | , sessionView = SessionView | 486 | , sessionView = SessionView |
487 | { svNick = nick | 487 | { svNick = nick |
@@ -1145,9 +1145,10 @@ sessionPacketH sessions addrRaw (CryptoPacket nonce16 encrypted) = do | |||
1145 | dput XNetCrypto $ "NetCrypto Recieved PING (session " ++ show ncSessionId ++")" | 1145 | dput XNetCrypto $ "NetCrypto Recieved PING (session " ++ show ncSessionId ++")" |
1146 | when (msgID cm == PacketRequest) $ do | 1146 | when (msgID cm == PacketRequest) $ do |
1147 | dput XNetCrypto $ "PACKETREquest: " ++ showCryptoMsg bufferEnd cm | 1147 | dput XNetCrypto $ "PACKETREquest: " ++ showCryptoMsg bufferEnd cm |
1148 | atomically $ do | 1148 | -- atomically $ do |
1149 | num <- CB.getNextSequenceNum ncStoredRequests | 1149 | -- num <- CB.getNextSequenceNum ncStoredRequests |
1150 | CB.enqueue ncStoredRequests num cd | 1150 | -- CB.enqueue ncStoredRequests num cd |
1151 | handlePacketRequest session cd | ||
1151 | atomically $ PQ.enqueue ncPacketQueue bufferEnd cd | 1152 | atomically $ PQ.enqueue ncPacketQueue bufferEnd cd |
1152 | return Nothing | 1153 | return Nothing |
1153 | where | 1154 | where |