diff options
author | Joe Crayne <joe@jerkface.net> | 2020-01-28 00:59:36 -0500 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2020-01-28 01:00:13 -0500 |
commit | 6339073a292cac1885f75b659b533ccb294a08bc (patch) | |
tree | aedbcf3403b54a3d13fb4bb626ffa27414c9c89f /dht/src | |
parent | 3581bb6d887728441d161765392a0d96ae8ccf19 (diff) |
Debug prints putRendezvous related debug prints.
Diffstat (limited to 'dht/src')
-rw-r--r-- | dht/src/DebugTag.hs | 1 | ||||
-rw-r--r-- | dht/src/Network/Tox/Crypto/Transport.hs | 2 | ||||
-rw-r--r-- | dht/src/Network/Tox/Onion/Handlers.hs | 1 |
3 files changed, 3 insertions, 1 deletions
diff --git a/dht/src/DebugTag.hs b/dht/src/DebugTag.hs index b5f862dc..8c1a7e3a 100644 --- a/dht/src/DebugTag.hs +++ b/dht/src/DebugTag.hs | |||
@@ -5,6 +5,7 @@ import Data.Typeable | |||
5 | -- | Debug Tags, add more as needed, but ensure XAnnounce is always first, XMisc last | 5 | -- | Debug Tags, add more as needed, but ensure XAnnounce is always first, XMisc last |
6 | data DebugTag | 6 | data DebugTag |
7 | = XAnnounce | 7 | = XAnnounce |
8 | | XPublish | ||
8 | | XAnnounceResponse | 9 | | XAnnounceResponse |
9 | | XBitTorrent | 10 | | XBitTorrent |
10 | | XDBus | 11 | | XDBus |
diff --git a/dht/src/Network/Tox/Crypto/Transport.hs b/dht/src/Network/Tox/Crypto/Transport.hs index 127b2dac..cff4fd88 100644 --- a/dht/src/Network/Tox/Crypto/Transport.hs +++ b/dht/src/Network/Tox/Crypto/Transport.hs | |||
@@ -103,7 +103,7 @@ encodeCrypto (x,saddr) = Just (B.cons 0x1b (runPut $ put x),saddr) | |||
103 | 103 | ||
104 | parseHandshakes :: ByteString -> addr -> Either String (Handshake Encrypted, addr) | 104 | parseHandshakes :: ByteString -> addr -> Either String (Handshake Encrypted, addr) |
105 | parseHandshakes (B.uncons -> Just (0x1a,pkt)) saddr = left ("parseHandshakes: "++) $ (,saddr) <$> runGet get pkt | 105 | parseHandshakes (B.uncons -> Just (0x1a,pkt)) saddr = left ("parseHandshakes: "++) $ (,saddr) <$> runGet get pkt |
106 | parseHandshakes bs _ = Left $ "parseHandshakes_: " ++ show (B.unpack $ B.take 1 bs) | 106 | parseHandshakes bs _ = Left $ "Unhandled packet: " ++ show (B.unpack $ B.take 1 bs) |
107 | 107 | ||
108 | encodeHandshakes :: Handshake Encrypted -> addr -> (ByteString, addr) | 108 | encodeHandshakes :: Handshake Encrypted -> addr -> (ByteString, addr) |
109 | encodeHandshakes x saddr = (B.cons 0x1a (runPut $ put x),saddr) | 109 | encodeHandshakes x saddr = (B.cons 0x1a (runPut $ put x),saddr) |
diff --git a/dht/src/Network/Tox/Onion/Handlers.hs b/dht/src/Network/Tox/Onion/Handlers.hs index ca7d47db..bd441f06 100644 --- a/dht/src/Network/Tox/Onion/Handlers.hs +++ b/dht/src/Network/Tox/Onion/Handlers.hs | |||
@@ -373,6 +373,7 @@ putRendezvous getTimeout crypto client pubkey nonce32 ni = do | |||
373 | rendezvousKey = key2id rkey | 373 | rendezvousKey = key2id rkey |
374 | asel <- atomically $ selectAlias crypto longTermKey | 374 | asel <- atomically $ selectAlias crypto longTermKey |
375 | let oaddr = OnionDestination asel ni Nothing | 375 | let oaddr = OnionDestination asel ni Nothing |
376 | dput XPublish $ "putRendezvous at " ++ show ni | ||
376 | fmap resultToMaybe | 377 | fmap resultToMaybe |
377 | $ sendOnion getTimeout client (AnnounceRequest nonce32 longTermKey rendezvousKey) oaddr | 378 | $ sendOnion getTimeout client (AnnounceRequest nonce32 longTermKey rendezvousKey) oaddr |
378 | $ \ni resp -> (Rendezvous rkey ni, resp) | 379 | $ \ni resp -> (Rendezvous rkey ni, resp) |