summaryrefslogtreecommitdiff
path: root/src/Network/Tox/Crypto
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2018-06-10 02:21:13 -0400
committerjoe <joe@jerkface.net>2018-06-10 02:21:28 -0400
commite27ad4390a27011b9cec04769e92020089e8c302 (patch)
treeb451b27fe89d390c2725064ec279dfb96c9bcd09 /src/Network/Tox/Crypto
parent2313073b3e85ed2479ac4246de29e8867f51603b (diff)
Tox: improved data-to-route and onion debug prints.
Diffstat (limited to 'src/Network/Tox/Crypto')
-rw-r--r--src/Network/Tox/Crypto/Transport.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Network/Tox/Crypto/Transport.hs b/src/Network/Tox/Crypto/Transport.hs
index bc112078..73143e35 100644
--- a/src/Network/Tox/Crypto/Transport.hs
+++ b/src/Network/Tox/Crypto/Transport.hs
@@ -86,8 +86,8 @@ encodeCrypto :: (CryptoPacket Encrypted, SockAddr) -> Maybe (ByteString, SockAdd
86encodeCrypto (x,saddr) = Just (B.cons 0x1b (runPut $ put x),saddr) 86encodeCrypto (x,saddr) = Just (B.cons 0x1b (runPut $ put x),saddr)
87 87
88parseHandshakes :: ByteString -> SockAddr -> Either String (Handshake Encrypted, SockAddr) 88parseHandshakes :: ByteString -> SockAddr -> Either String (Handshake Encrypted, SockAddr)
89parseHandshakes (B.uncons -> Just (0x1a,pkt)) saddr = left ("parseNetCrypto: "++) $ (,saddr) <$> runGet get pkt 89parseHandshakes (B.uncons -> Just (0x1a,pkt)) saddr = left ("parseHandshakes: "++) $ (,saddr) <$> runGet get pkt
90parseHandshakes _ _ = Left "parseHandshakes_: ?" 90parseHandshakes bs _ = Left $ "parseHandshakes_: " ++ show (B.unpack $ B.take 1 bs)
91 91
92encodeHandshakes :: Handshake Encrypted -> SockAddr -> (ByteString, SockAddr) 92encodeHandshakes :: Handshake Encrypted -> SockAddr -> (ByteString, SockAddr)
93encodeHandshakes x saddr = (B.cons 0x1a (runPut $ put x),saddr) 93encodeHandshakes x saddr = (B.cons 0x1a (runPut $ put x),saddr)