From 14657ce8b7231f2163438111fc22ba2955b65ed4 Mon Sep 17 00:00:00 2001 From: joe Date: Mon, 23 Oct 2017 18:03:28 -0400 Subject: Incoming rendezvous-mediated messages should be associated with the anounce alias. Also some cosmetic changes. --- src/Network/Tox/Onion/Handlers.hs | 2 +- src/Network/Tox/Onion/Transport.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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 -- The reason for this 20 second timeout in toxcore is that it gives a reasonable -- time (20 to 40 seconds) for a peer to announce himself while taking in count -- all the possible delays with some extra seconds. --- dhtd: src/Network/Tox/Onion/Handlers.hs:(67,1)-(101,23): Non-exhaustive patterns in function announceH announceH :: Routing -> TVar SessionTokens -> TVar AnnouncedKeys -> OnionDestination r -> AnnounceRequest -> IO AnnounceResponse announceH routing toks keydb oaddr req = do case () of @@ -242,6 +241,7 @@ sendOnion getTimeout client req oaddr unwrap = (return . Just . unwrap (onionNodeInfo oaddr)) $ join mb +-- | Lookup the secret counterpart for a given alias key. selectAlias :: TransportCrypto -> NodeId -> STM AliasSelector selectAlias crypto pkey = do 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 -> Either (Asymm (Encrypted DataToRoute),Rendezvous) (OnionMessage Encrypted, OnionDestination r) parseDataToRoute crypto (OnionToRouteResponse dta, od) = Left ( dta - , Rendezvous (onionAliasPublic crypto) $ onionNodeInfo od ) + , Rendezvous (rendezvousAliasPublic crypto) $ onionNodeInfo od ) parseDataToRoute _ msg = Right msg encodeDataToRoute :: TransportCrypto -- cgit v1.2.3