diff options
author | joe <joe@jerkface.net> | 2017-10-29 01:28:17 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-10-29 01:28:17 -0400 |
commit | f6dc9b04416b36e6e0e3fc40a5ce05405937d0c9 (patch) | |
tree | 8c6602c1d6fcc6ff6fc2dc91b0cf68ddcc75c423 | |
parent | 8e442fb2a71ec85d47127d90319b1bf2c2767fda (diff) |
Fixed premature deletion of pending cookie key.
-rw-r--r-- | src/Network/Tox/DHT/Handlers.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Network/Tox/DHT/Handlers.hs b/src/Network/Tox/DHT/Handlers.hs index 60c0500c..6bbcfb43 100644 --- a/src/Network/Tox/DHT/Handlers.hs +++ b/src/Network/Tox/DHT/Handlers.hs | |||
@@ -264,9 +264,7 @@ cookieRequest crypto client localUserKey addr = do | |||
264 | return mp | 264 | return mp |
265 | let cookieSerializer | 265 | let cookieSerializer |
266 | = MethodSerializer | 266 | = MethodSerializer |
267 | { methodTimeout = \tid addr -> do | 267 | { methodTimeout = \tid addr -> return (addr, 5000000) |
268 | modifyTVar (pendingCookies crypto) decAddr | ||
269 | return (addr, 5000000) | ||
270 | , method = CookieRequestType | 268 | , method = CookieRequestType |
271 | , wrapQuery = \tid src dst cr -> DHTCookieRequest $ wrapAsymm tid src dst (, cr) | 269 | , wrapQuery = \tid src dst cr -> DHTCookieRequest $ wrapAsymm tid src dst (, cr) |
272 | , unwrapResponse = fmap snd . unCookie | 270 | , unwrapResponse = fmap snd . unCookie |
@@ -274,6 +272,7 @@ cookieRequest crypto client localUserKey addr = do | |||
274 | cookieRequest = CookieRequest localUserKey | 272 | cookieRequest = CookieRequest localUserKey |
275 | hPutStrLn stderr $ show addr ++ " <-- cookieRequest" | 273 | hPutStrLn stderr $ show addr ++ " <-- cookieRequest" |
276 | reply <- QR.sendQuery client cookieSerializer cookieRequest addr | 274 | reply <- QR.sendQuery client cookieSerializer cookieRequest addr |
275 | atomically $ modifyTVar (pendingCookies crypto) decAddr | ||
277 | hPutStrLn stderr $ show addr ++ " -cookieResponse-> " ++ show reply | 276 | hPutStrLn stderr $ show addr ++ " -cookieResponse-> " ++ show reply |
278 | return $ join reply | 277 | return $ join reply |
279 | 278 | ||