diff options
author | joe <joe@jerkface.net> | 2017-10-23 18:03:28 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-10-23 18:03:28 -0400 |
commit | 14657ce8b7231f2163438111fc22ba2955b65ed4 (patch) | |
tree | 6f6d57825e064a7dc3cdafd6955c37dbaa99da81 /src/Network/Tox | |
parent | 7ab09c43f0bb6f8f42c0156644869dfe78aa0b89 (diff) |
Incoming rendezvous-mediated messages should be associated
with the anounce alias. Also some cosmetic changes.
Diffstat (limited to 'src/Network/Tox')
-rw-r--r-- | src/Network/Tox/Onion/Handlers.hs | 2 | ||||
-rw-r--r-- | src/Network/Tox/Onion/Transport.hs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/Network/Tox/Onion/Handlers.hs b/src/Network/Tox/Onion/Handlers.hs index 23673273..0c137bf5 100644 --- a/src/Network/Tox/Onion/Handlers.hs +++ b/src/Network/Tox/Onion/Handlers.hs | |||
@@ -63,7 +63,6 @@ classify msg = go msg | |||
63 | -- The reason for this 20 second timeout in toxcore is that it gives a reasonable | 63 | -- The reason for this 20 second timeout in toxcore is that it gives a reasonable |
64 | -- time (20 to 40 seconds) for a peer to announce himself while taking in count | 64 | -- time (20 to 40 seconds) for a peer to announce himself while taking in count |
65 | -- all the possible delays with some extra seconds. | 65 | -- all the possible delays with some extra seconds. |
66 | -- dhtd: src/Network/Tox/Onion/Handlers.hs:(67,1)-(101,23): Non-exhaustive patterns in function announceH | ||
67 | announceH :: Routing -> TVar SessionTokens -> TVar AnnouncedKeys -> OnionDestination r -> AnnounceRequest -> IO AnnounceResponse | 66 | announceH :: Routing -> TVar SessionTokens -> TVar AnnouncedKeys -> OnionDestination r -> AnnounceRequest -> IO AnnounceResponse |
68 | announceH routing toks keydb oaddr req = do | 67 | announceH routing toks keydb oaddr req = do |
69 | case () of | 68 | case () of |
@@ -242,6 +241,7 @@ sendOnion getTimeout client req oaddr unwrap = | |||
242 | (return . Just . unwrap (onionNodeInfo oaddr)) | 241 | (return . Just . unwrap (onionNodeInfo oaddr)) |
243 | $ join mb | 242 | $ join mb |
244 | 243 | ||
244 | -- | Lookup the secret counterpart for a given alias key. | ||
245 | selectAlias :: TransportCrypto -> NodeId -> STM AliasSelector | 245 | selectAlias :: TransportCrypto -> NodeId -> STM AliasSelector |
246 | selectAlias crypto pkey = do | 246 | selectAlias crypto pkey = do |
247 | ks <- filter (\(sk,pk) -> pk == id2key pkey) | 247 | ks <- filter (\(sk,pk) -> pk == id2key pkey) |
diff --git a/src/Network/Tox/Onion/Transport.hs b/src/Network/Tox/Onion/Transport.hs index 203d7dc7..bdaef651 100644 --- a/src/Network/Tox/Onion/Transport.hs +++ b/src/Network/Tox/Onion/Transport.hs | |||
@@ -741,7 +741,7 @@ parseDataToRoute | |||
741 | -> Either (Asymm (Encrypted DataToRoute),Rendezvous) (OnionMessage Encrypted, OnionDestination r) | 741 | -> Either (Asymm (Encrypted DataToRoute),Rendezvous) (OnionMessage Encrypted, OnionDestination r) |
742 | parseDataToRoute crypto (OnionToRouteResponse dta, od) | 742 | parseDataToRoute crypto (OnionToRouteResponse dta, od) |
743 | = Left ( dta | 743 | = Left ( dta |
744 | , Rendezvous (onionAliasPublic crypto) $ onionNodeInfo od ) | 744 | , Rendezvous (rendezvousAliasPublic crypto) $ onionNodeInfo od ) |
745 | parseDataToRoute _ msg = Right msg | 745 | parseDataToRoute _ msg = Right msg |
746 | 746 | ||
747 | encodeDataToRoute :: TransportCrypto | 747 | encodeDataToRoute :: TransportCrypto |