diff options
author | Joe Crayne <joe@jerkface.net> | 2020-01-03 17:12:14 -0500 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2020-01-03 17:26:06 -0500 |
commit | 5181c77ce7dd73d622ff3921b90bf2741bedb646 (patch) | |
tree | 16ba93b83ad0c137a013e47f593d7d40ace68ce6 /dht/src/Network/Tox/Onion | |
parent | 31b799222cb76cd0002d9a3cc5b340a7b6fed139 (diff) |
QueryResponse: Use three-way sum to distinguish Canceled and Timedout.
Diffstat (limited to 'dht/src/Network/Tox/Onion')
-rw-r--r-- | dht/src/Network/Tox/Onion/Handlers.hs | 2 | ||||
-rw-r--r-- | dht/src/Network/Tox/Onion/Routes.hs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/dht/src/Network/Tox/Onion/Handlers.hs b/dht/src/Network/Tox/Onion/Handlers.hs index 65ec846c..fa7bc83c 100644 --- a/dht/src/Network/Tox/Onion/Handlers.hs +++ b/dht/src/Network/Tox/Onion/Handlers.hs | |||
@@ -285,7 +285,7 @@ sendOnion getTimeout client req oaddr unwrap = | |||
285 | forM_ mb $ \r -> dput XAnnounce $ show (onionNodeInfo oaddr) ++ " sent response: " ++ show r | 285 | forM_ mb $ \r -> dput XAnnounce $ show (onionNodeInfo oaddr) ++ " sent response: " ++ show r |
286 | maybe (if n>0 then loop $! n - 1 else return Nothing) | 286 | maybe (if n>0 then loop $! n - 1 else return Nothing) |
287 | (return . Just . unwrap (onionNodeInfo oaddr)) | 287 | (return . Just . unwrap (onionNodeInfo oaddr)) |
288 | $ join mb | 288 | $ join $ resultToMaybe mb |
289 | 289 | ||
290 | 290 | ||
291 | -- | Lookup the secret counterpart for a given alias key. | 291 | -- | Lookup the secret counterpart for a given alias key. |
diff --git a/dht/src/Network/Tox/Onion/Routes.hs b/dht/src/Network/Tox/Onion/Routes.hs index b20ad7dd..7c11227a 100644 --- a/dht/src/Network/Tox/Onion/Routes.hs +++ b/dht/src/Network/Tox/Onion/Routes.hs | |||
@@ -171,7 +171,7 @@ newOnionRouter crypto perror tcp_enabled = do | |||
171 | ((tbl,(tcptbl,tcpcons,relaynet,onionnet)),tcp) <- do | 171 | ((tbl,(tcptbl,tcpcons,relaynet,onionnet)),tcp) <- do |
172 | (tcptbl, client) <- TCP.newClient crypto | 172 | (tcptbl, client) <- TCP.newClient crypto |
173 | id | 173 | id |
174 | (. (Just . (,) False)) | 174 | (. (Success . (,) False)) |
175 | (lookupSender' pq rlog) | 175 | (lookupSender' pq rlog) |
176 | (\_ (RouteId rid) -> atomically $ fmap storedRoute <$> readArray rm rid) | 176 | (\_ (RouteId rid) -> atomically $ fmap storedRoute <$> readArray rm rid) |
177 | 177 | ||