diff options
Diffstat (limited to 'dht/src/Network')
-rw-r--r-- | dht/src/Network/Lossless.hs | 6 | ||||
-rw-r--r-- | dht/src/Network/Tox.hs | 2 | ||||
-rw-r--r-- | dht/src/Network/Tox/ContactInfo.hs | 3 | ||||
-rw-r--r-- | dht/src/Network/Tox/Onion/Routes.hs | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/dht/src/Network/Lossless.hs b/dht/src/Network/Lossless.hs index 079f4d07..41203ca5 100644 --- a/dht/src/Network/Lossless.hs +++ b/dht/src/Network/Lossless.hs | |||
@@ -49,9 +49,9 @@ lossless :: Show addr => | |||
49 | -> addr -- ^ The remote address for this session. | 49 | -> addr -- ^ The remote address for this session. |
50 | -> TransportA String addr x y -- ^ An unreliable lossy transport. | 50 | -> TransportA String addr x y -- ^ An unreliable lossy transport. |
51 | 51 | ||
52 | -> IO ( Transport String addr' x' -- ^ A reliable lossless transport. | 52 | -> IO ( Transport String addr' x' -- A reliable lossless transport. |
53 | , [Word32] -> IO () -- ^ Use this to request lost packets be re-sent. | 53 | , [Word32] -> IO () -- Use this to request lost packets be re-sent. |
54 | , IO ([Word32],Word32) -- ^ Use this to discover missing packets to request. | 54 | , IO ([Word32],Word32) -- Use this to discover missing packets to request. |
55 | ) | 55 | ) |
56 | lossless lbl isLossless encode saddr udp = do | 56 | lossless lbl isLossless encode saddr udp = do |
57 | pb <- atomically newPacketBuffer | 57 | pb <- atomically newPacketBuffer |
diff --git a/dht/src/Network/Tox.hs b/dht/src/Network/Tox.hs index 23dbfe27..1628b435 100644 --- a/dht/src/Network/Tox.hs +++ b/dht/src/Network/Tox.hs | |||
@@ -392,7 +392,7 @@ newToxOverTransport keydb addr onNewSession (crypto,roster) udp tcp = do | |||
392 | return (msg, maybe (Multi.OnionUDP ==> addr) (const $ Multi.OnionTCP ==> addr) mtcp)) | 392 | return (msg, maybe (Multi.OnionUDP ==> addr) (const $ Multi.OnionTCP ==> addr) mtcp)) |
393 | <$> mergeTransports (DMap.fromList | 393 | <$> mergeTransports (DMap.fromList |
394 | [ Multi.OnionUDP :=> ByAddress onioncryptUDP | 394 | [ Multi.OnionUDP :=> ByAddress onioncryptUDP |
395 | , Multi.OnionTCP :=> ByAddress {- $ onInbound updateOnTCP -} onioncryptTCP ]) | 395 | , Multi.OnionTCP :=> ByAddress {- onInbound updateOnTCP -} onioncryptTCP ]) |
396 | 396 | ||
397 | -- dtacrypt :: Transport String AnnouncedRendezvous (PublicKey,OnionData) | 397 | -- dtacrypt :: Transport String AnnouncedRendezvous (PublicKey,OnionData) |
398 | (dtacrypt,onioncrypt) <- partitionTransportM (Onion.parseDataToRoute crypto) (Onion.encodeDataToRoute crypto) onioncrypt | 398 | (dtacrypt,onioncrypt) <- partitionTransportM (Onion.parseDataToRoute crypto) (Onion.encodeDataToRoute crypto) onioncrypt |
diff --git a/dht/src/Network/Tox/ContactInfo.hs b/dht/src/Network/Tox/ContactInfo.hs index e7cb48c1..d5640ce8 100644 --- a/dht/src/Network/Tox/ContactInfo.hs +++ b/dht/src/Network/Tox/ContactInfo.hs | |||
@@ -18,8 +18,9 @@ import DPut | |||
18 | import DebugTag | 18 | import DebugTag |
19 | 19 | ||
20 | newtype ContactInfo extra = ContactInfo | 20 | newtype ContactInfo extra = ContactInfo |
21 | { | ||
21 | -- | Map our toxid public key to an Account record. | 22 | -- | Map our toxid public key to an Account record. |
22 | { accounts :: TVar (HashMap NodeId{-my userkey-} (Account extra)) | 23 | accounts :: TVar (HashMap NodeId{-my userkey-} (Account extra)) |
23 | } | 24 | } |
24 | 25 | ||
25 | data Account extra = Account | 26 | data Account extra = Account |
diff --git a/dht/src/Network/Tox/Onion/Routes.hs b/dht/src/Network/Tox/Onion/Routes.hs index 2f13a513..374b9648 100644 --- a/dht/src/Network/Tox/Onion/Routes.hs +++ b/dht/src/Network/Tox/Onion/Routes.hs | |||
@@ -276,7 +276,7 @@ updateTCP or addr x = do | |||
276 | selectGateway :: TVar (R.BucketList TCP.NodeInfo) -> NodeInfo -> STM (Maybe TCP.NodeInfo) | 276 | selectGateway :: TVar (R.BucketList TCP.NodeInfo) -> NodeInfo -> STM (Maybe TCP.NodeInfo) |
277 | selectGateway tbl ni = do | 277 | selectGateway tbl ni = do |
278 | ns <- kclosest TCP.tcpSpace 2 (nodeId ni) <$> readTVar tbl | 278 | ns <- kclosest TCP.tcpSpace 2 (nodeId ni) <$> readTVar tbl |
279 | return $ listToMaybe ns -- $ dropWhile (\n -> TCP.nodeId n == nodeId ni) ns | 279 | return $ listToMaybe ns -- dropWhile (\n -> TCP.nodeId n == nodeId ni) ns |
280 | 280 | ||
281 | quitRouteBuilder :: OnionRouter -> IO () | 281 | quitRouteBuilder :: OnionRouter -> IO () |
282 | quitRouteBuilder or = do | 282 | quitRouteBuilder or = do |