diff options
author | joe <joe@jerkface.net> | 2018-06-10 02:21:13 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2018-06-10 02:21:28 -0400 |
commit | e27ad4390a27011b9cec04769e92020089e8c302 (patch) | |
tree | b451b27fe89d390c2725064ec279dfb96c9bcd09 /src/Network/Tox/Crypto | |
parent | 2313073b3e85ed2479ac4246de29e8867f51603b (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.hs | 4 |
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 | |||
86 | encodeCrypto (x,saddr) = Just (B.cons 0x1b (runPut $ put x),saddr) | 86 | encodeCrypto (x,saddr) = Just (B.cons 0x1b (runPut $ put x),saddr) |
87 | 87 | ||
88 | parseHandshakes :: ByteString -> SockAddr -> Either String (Handshake Encrypted, SockAddr) | 88 | parseHandshakes :: ByteString -> SockAddr -> Either String (Handshake Encrypted, SockAddr) |
89 | parseHandshakes (B.uncons -> Just (0x1a,pkt)) saddr = left ("parseNetCrypto: "++) $ (,saddr) <$> runGet get pkt | 89 | parseHandshakes (B.uncons -> Just (0x1a,pkt)) saddr = left ("parseHandshakes: "++) $ (,saddr) <$> runGet get pkt |
90 | parseHandshakes _ _ = Left "parseHandshakes_: ?" | 90 | parseHandshakes bs _ = Left $ "parseHandshakes_: " ++ show (B.unpack $ B.take 1 bs) |
91 | 91 | ||
92 | encodeHandshakes :: Handshake Encrypted -> SockAddr -> (ByteString, SockAddr) | 92 | encodeHandshakes :: Handshake Encrypted -> SockAddr -> (ByteString, SockAddr) |
93 | encodeHandshakes x saddr = (B.cons 0x1a (runPut $ put x),saddr) | 93 | encodeHandshakes x saddr = (B.cons 0x1a (runPut $ put x),saddr) |