diff options
author | joe <joe@jerkface.net> | 2018-06-20 23:30:47 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2018-06-20 23:30:47 -0400 |
commit | cd3095fe7e9a5a74a0fea7c8bfcd9e92ce20f8a0 (patch) | |
tree | 8589ede4fe96b757ec1d8d394f807dad278cea9a | |
parent | 825962518c6ad00279fc23e8e1dec746980e483f (diff) |
XRoutes debug tag, clearer "k secrets" output, missing signature.
-rw-r--r-- | examples/dhtd.hs | 8 | ||||
-rw-r--r-- | src/DPut.hs | 2 | ||||
-rw-r--r-- | src/Network/QueryResponse.hs | 1 | ||||
-rw-r--r-- | src/Network/Tox.hs | 3 |
4 files changed, 8 insertions, 6 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs index 83e8c24f..4b5a1fd7 100644 --- a/examples/dhtd.hs +++ b/examples/dhtd.hs | |||
@@ -571,9 +571,11 @@ clientSession s@Session{..} sock cnum h = do | |||
571 | ks <- atomically $ myKeyPairs roster | 571 | ks <- atomically $ myKeyPairs roster |
572 | skey <- maybe (return Nothing) (atomically . dhtSecretKey) | 572 | skey <- maybe (return Nothing) (atomically . dhtSecretKey) |
573 | $ Map.lookup netname dhts | 573 | $ Map.lookup netname dhts |
574 | hPutClient h . showReport $ map mkrow ks ++ case skey >>= encodeSecret of | 574 | hPutClient h . showReport $ (map mkrow ks ++) $ fromMaybe [] $ do |
575 | Just x -> [("",""),("dht-key:",B.unpack x)] | 575 | sk <- skey |
576 | Nothing -> [] | 576 | let pk = Tox.key2id $ toPublic sk |
577 | x <- encodeSecret sk | ||
578 | Just [("",""),("dht-key:",""),(B.unpack x, show pk)] | ||
577 | | ("sel",_:expr) <- break isSpace s -> do | 579 | | ("sel",_:expr) <- break isSpace s -> do |
578 | ks <- atomically $ map (show . Tox.key2id . snd) <$> myKeyPairs roster | 580 | ks <- atomically $ map (show . Tox.key2id . snd) <$> myKeyPairs roster |
579 | case find (isInfixOf expr) ks of | 581 | case find (isInfixOf expr) ks of |
diff --git a/src/DPut.hs b/src/DPut.hs index ff828112..121105fb 100644 --- a/src/DPut.hs +++ b/src/DPut.hs | |||
@@ -11,7 +11,7 @@ import qualified Data.Text as T | |||
11 | import qualified Data.Text.Encoding as T | 11 | import qualified Data.Text.Encoding as T |
12 | 12 | ||
13 | -- | Debug Tags, add more as needed, but ensure XAnnounce is always first, XMisc last | 13 | -- | Debug Tags, add more as needed, but ensure XAnnounce is always first, XMisc last |
14 | data DebugTag = XAnnounce | XBitTorrent | XDHT | XLan | XMan | XNetCrypto | XOnion | XPing | XRefresh | XWLog | XMisc | 14 | data DebugTag = XAnnounce | XBitTorrent | XDHT | XLan | XMan | XNetCrypto | XOnion | XRoutes | XPing | XRefresh | XWLog | XMisc |
15 | deriving (Eq,Ord,Show,Read,Enum,Bounded) | 15 | deriving (Eq,Ord,Show,Read,Enum,Bounded) |
16 | 16 | ||
17 | appName :: String | 17 | appName :: String |
diff --git a/src/Network/QueryResponse.hs b/src/Network/QueryResponse.hs index 3ee6d945..d612ac05 100644 --- a/src/Network/QueryResponse.hs +++ b/src/Network/QueryResponse.hs | |||
@@ -577,6 +577,7 @@ serializeClient c = do | |||
577 | , clientLeaveQuery = \tid didRespond -> putMVar mvar () | 577 | , clientLeaveQuery = \tid didRespond -> putMVar mvar () |
578 | } | 578 | } |
579 | 579 | ||
580 | retardSend :: Int -> Client err meth tid addr x -> IO (Client err meth tid addr x) | ||
580 | retardSend micros client = do | 581 | retardSend micros client = do |
581 | mvar <- newMVar () :: IO (MVar ()) | 582 | mvar <- newMVar () :: IO (MVar ()) |
582 | return client { clientEnterQuery = \tid -> do | 583 | return client { clientEnterQuery = \tid -> do |
diff --git a/src/Network/Tox.hs b/src/Network/Tox.hs index efddc2a0..fcfa872f 100644 --- a/src/Network/Tox.hs +++ b/src/Network/Tox.hs | |||
@@ -445,8 +445,7 @@ newTox keydb addr mbSessionsState suppliedDHTKey = do | |||
445 | let lookupClose _ = return Nothing | 445 | let lookupClose _ = return Nothing |
446 | 446 | ||
447 | mkrouting <- DHT.newRouting addr crypto updateIP updateIP | 447 | mkrouting <- DHT.newRouting addr crypto updateIP updateIP |
448 | let ignoreErrors _ = return () -- Set this to (dput XMisc) to debug onion route building. | 448 | orouter <- newOnionRouter $ dput XRoutes |
449 | orouter <- newOnionRouter ignoreErrors | ||
450 | (cryptonet,dhtcrypt,onioncrypt,dtacrypt,handshakes) <- toxTransport crypto orouter lookupClose udp | 449 | (cryptonet,dhtcrypt,onioncrypt,dtacrypt,handshakes) <- toxTransport crypto orouter lookupClose udp |
451 | 450 | ||
452 | let dhtnet0 = layerTransportM (DHT.decrypt crypto) (DHT.encrypt crypto) dhtcrypt | 451 | let dhtnet0 = layerTransportM (DHT.decrypt crypto) (DHT.encrypt crypto) dhtcrypt |