summaryrefslogtreecommitdiff
path: root/src/Network/Tox/Transport.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/Tox/Transport.hs')
-rw-r--r--src/Network/Tox/Transport.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Network/Tox/Transport.hs b/src/Network/Tox/Transport.hs
index 0b03ed19..0b34e8f8 100644
--- a/src/Network/Tox/Transport.hs
+++ b/src/Network/Tox/Transport.hs
@@ -22,14 +22,15 @@ toxTransport ::
22 -> OnionRouter 22 -> OnionRouter
23 -> (PublicKey -> IO (Maybe NodeInfo)) 23 -> (PublicKey -> IO (Maybe NodeInfo))
24 -> UDPTransport 24 -> UDPTransport
25 -> (Int -> OnionResponse N1 -> IO ()) -- ^ TCP-bound callback.
25 -> IO ( Transport String SockAddr (CryptoPacket Encrypted) 26 -> IO ( Transport String SockAddr (CryptoPacket Encrypted)
26 , Transport String NodeInfo (DHTMessage Encrypted8) 27 , Transport String NodeInfo (DHTMessage Encrypted8)
27 , Transport String (OnionDestination RouteId) (OnionMessage Encrypted) 28 , Transport String (OnionDestination RouteId) (OnionMessage Encrypted)
28 , Transport String AnnouncedRendezvous (PublicKey,OnionData) 29 , Transport String AnnouncedRendezvous (PublicKey,OnionData)
29 , Transport String SockAddr (Handshake Encrypted)) 30 , Transport String SockAddr (Handshake Encrypted))
30toxTransport crypto orouter closeLookup udp = do 31toxTransport crypto orouter closeLookup udp tcp = do
31 (netcrypto, udp0) <- partitionTransport parseCrypto encodeCrypto udp 32 (netcrypto, udp0) <- partitionTransport parseCrypto encodeCrypto udp
32 (dht,udp1) <- partitionTransportM (parseDHTAddr crypto) (fmap Just . encodeDHTAddr) $ forwardOnions crypto udp0 33 (dht,udp1) <- partitionTransportM (parseDHTAddr crypto) (fmap Just . encodeDHTAddr) $ forwardOnions crypto udp0 tcp
33 (onion1,udp2) <- partitionTransportM (parseOnionAddr $ lookupSender orouter) 34 (onion1,udp2) <- partitionTransportM (parseOnionAddr $ lookupSender orouter)
34 (encodeOnionAddr crypto $ lookupRoute orouter) 35 (encodeOnionAddr crypto $ lookupRoute orouter)
35 udp1 36 udp1