summaryrefslogtreecommitdiff
path: root/src/Network/Tox/Onion/Handlers.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-10-25 05:09:55 -0400
committerjoe <joe@jerkface.net>2017-10-25 05:09:55 -0400
commit44573e84be43e4396f4508edb3c04760b6bf8efc (patch)
tree7568d8c1c2c367604ba9da4d91aca773ff4647b1 /src/Network/Tox/Onion/Handlers.hs
parentf0f355d6ff8a68b5240301f882f6d5a9a77fdba1 (diff)
Debugged encodeDataToRoute/parseDataToRoute.
Diffstat (limited to 'src/Network/Tox/Onion/Handlers.hs')
-rw-r--r--src/Network/Tox/Onion/Handlers.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Network/Tox/Onion/Handlers.hs b/src/Network/Tox/Onion/Handlers.hs
index 3eec0390..76908df8 100644
--- a/src/Network/Tox/Onion/Handlers.hs
+++ b/src/Network/Tox/Onion/Handlers.hs
@@ -117,13 +117,16 @@ dataToRouteH ::
117 -> IO () 117 -> IO ()
118dataToRouteH keydb udp _ (OnionToRoute pub asymm) = do 118dataToRouteH keydb udp _ (OnionToRoute pub asymm) = do
119 let k = key2id pub 119 let k = key2id pub
120 hPutStrLn stderr $ "dataToRouteH "++ show k
120 mb <- atomically $ do 121 mb <- atomically $ do
121 ks <- readTVar keydb 122 ks <- readTVar keydb
122 forM (MinMaxPSQ.lookup' k (keyAssoc ks)) $ \(p,(cnt,rpath)) -> do 123 forM (MinMaxPSQ.lookup' k (keyAssoc ks)) $ \(p,(cnt,rpath)) -> do
123 writeTVar keydb $ ks { keyAssoc = MinMaxPSQ.insert' k (cnt + 1, rpath) p (keyAssoc ks) } 124 writeTVar keydb $ ks { keyAssoc = MinMaxPSQ.insert' k (cnt + 1, rpath) p (keyAssoc ks) }
124 return rpath 125 return rpath
126 hPutStrLn stderr $ "dataToRouteH "++ show (fmap (const ()) mb)
125 forM_ mb $ \rpath -> do 127 forM_ mb $ \rpath -> do
126 -- forward 128 -- forward
129 hPutStrLn stderr $ "dataToRouteH sendMessage"
127 sendMessage udp (toOnionDestination rpath) $ OnionToRouteResponse asymm 130 sendMessage udp (toOnionDestination rpath) $ OnionToRouteResponse asymm
128 hPutStrLn stderr $ "Forwarding data-to-route -->"++show k 131 hPutStrLn stderr $ "Forwarding data-to-route -->"++show k
129 132