From bb190ea0bb2671214aad75f43f06a7c41c94f2bd Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Sun, 1 Dec 2019 20:22:30 -0500 Subject: Remove query-id dependency from timeout computation. --- dht/src/Network/Tox/Onion/Handlers.hs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'dht/src/Network/Tox/Onion/Handlers.hs') diff --git a/dht/src/Network/Tox/Onion/Handlers.hs b/dht/src/Network/Tox/Onion/Handlers.hs index 25713aa1..3ea7395f 100644 --- a/dht/src/Network/Tox/Onion/Handlers.hs +++ b/dht/src/Network/Tox/Onion/Handlers.hs @@ -212,7 +212,7 @@ handlers net routing toks keydb AnnounceType handlers net _ _ keydb _ = Just $ NoReply Right $ dataToRouteH keydb net -toxidSearch :: (TransactionId -> OnionDestination r -> STM (OnionDestination r, Int)) +toxidSearch :: (OnionDestination r -> STM (OnionDestination r, Int)) -> TransportCrypto -> Client r -> Search NodeId (IP, PortNumber) Nonce32 NodeInfo Rendezvous @@ -224,7 +224,7 @@ toxidSearch getTimeout crypto client = Search , searchK = 6 } -announceSerializer :: (TransactionId -> OnionDestination r -> STM (OnionDestination r, Int)) +announceSerializer :: (OnionDestination r -> STM (OnionDestination r, Int)) -> MethodSerializer TransactionId (OnionDestination r) @@ -276,7 +276,7 @@ unwrapAnnounceResponse alias ni (AnnounceResponse is_stored (SendNodes ns)) -- started. -sendOnion :: (TransactionId -> OnionDestination r -> STM (OnionDestination r, Int)) +sendOnion :: (OnionDestination r -> STM (OnionDestination r, Int)) -> Client r -> AnnounceRequest -> OnionDestination r @@ -291,8 +291,7 @@ sendOnion getTimeout client req oaddr unwrap = (return . Just . unwrap (onionNodeInfo oaddr)) $ join mb -asyncOnion :: (TransactionId - -> OnionDestination r -> STM (OnionDestination r, Int)) +asyncOnion :: (OnionDestination r -> STM (OnionDestination r, Int)) -> QR.Client err PacketKind @@ -316,7 +315,7 @@ asyncOnion getTimeout client req oaddr unwrap go = -- | Lookup the secret counterpart for a given alias key. -getRendezvous :: (TransactionId -> OnionDestination r -> STM (OnionDestination r, Int)) +getRendezvous :: (OnionDestination r -> STM (OnionDestination r, Int)) -> TransportCrypto -> Client r -> NodeId @@ -334,7 +333,7 @@ getRendezvous getTimeout crypto client nid ni = do (unwrapAnnounceResponse rkey) asyncGetRendezvous - :: (TransactionId -> OnionDestination r -> STM (OnionDestination r, Int)) + :: (OnionDestination r -> STM (OnionDestination r, Int)) -> TransportCrypto -> Client r -> NodeId @@ -353,7 +352,7 @@ asyncGetRendezvous getTimeout crypto client nid ni go = do (unwrapAnnounceResponse rkey) go -putRendezvous :: (TransactionId -> OnionDestination r -> STM (OnionDestination r, Int)) +putRendezvous :: (OnionDestination r -> STM (OnionDestination r, Int)) -> TransportCrypto -> Client r -> PublicKey -- cgit v1.2.3