diff options
author | James Crayne <jim.crayne@gmail.com> | 2017-11-23 13:45:52 +0000 |
---|---|---|
committer | James Crayne <jim.crayne@gmail.com> | 2017-11-23 13:46:03 +0000 |
commit | 3e33a6204b5fc55475bc0bd03602fd8a4930ac7c (patch) | |
tree | 0ba7d0e39bb4978dc0dd4c2920bbe9e7008816d4 /src/Network/Tox/Crypto/Handlers.hs | |
parent | 2de737b059753ced54b21c60b4c4c41bac58e398 (diff) |
remove obsolete receiveCrypto function
Diffstat (limited to 'src/Network/Tox/Crypto/Handlers.hs')
-rw-r--r-- | src/Network/Tox/Crypto/Handlers.hs | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs index ef7afe98..59e78213 100644 --- a/src/Network/Tox/Crypto/Handlers.hs +++ b/src/Network/Tox/Crypto/Handlers.hs | |||
@@ -280,18 +280,6 @@ ncToWire getState seqno bufend pktno msg = do | |||
280 | pkt = CryptoPacket { pktNonce = nonce24ToWord16 n24, pktData = encrypted } | 280 | pkt = CryptoPacket { pktNonce = nonce24ToWord16 n24, pktData = encrypted } |
281 | in return (Just (pkt, pktno+1)) | 281 | in return (Just (pkt, pktno+1)) |
282 | 282 | ||
283 | -- | Blocks until a packet is available, or the session is terminated. | ||
284 | receiveCrypto :: NetCryptoSession -> IO (Maybe CryptoMessage) | ||
285 | receiveCrypto nc@NCrypto { ncState, ncPacketQueue } = do | ||
286 | cd <- atomically $ do | ||
287 | st <- readTVar ncState | ||
288 | case st of | ||
289 | Accepted -> Just <$> PQ.dequeue ncPacketQueue | ||
290 | Confirmed -> Just <$> PQ.dequeue ncPacketQueue | ||
291 | _ -> pure Nothing | ||
292 | forM_ cd $ runCryptoHook nc -- TODO: Is this useful? | ||
293 | return $ bufferData <$> cd | ||
294 | |||
295 | -- | called when we recieve a crypto handshake with valid cookie | 283 | -- | called when we recieve a crypto handshake with valid cookie |
296 | -- TODO set priority on contact addr to 0 if it is older than ForgetPeriod, | 284 | -- TODO set priority on contact addr to 0 if it is older than ForgetPeriod, |
297 | -- then increment it regardless. (Keep addr in MinMaxPSQ in Roster.Contact) | 285 | -- then increment it regardless. (Keep addr in MinMaxPSQ in Roster.Contact) |