summaryrefslogtreecommitdiff
path: root/dht/src/Network/Tox/Transport.hs
diff options
context:
space:
mode:
Diffstat (limited to 'dht/src/Network/Tox/Transport.hs')
-rw-r--r--dht/src/Network/Tox/Transport.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/dht/src/Network/Tox/Transport.hs b/dht/src/Network/Tox/Transport.hs
index 217d5b1d..4f97bfbf 100644
--- a/dht/src/Network/Tox/Transport.hs
+++ b/dht/src/Network/Tox/Transport.hs
@@ -22,6 +22,7 @@ toxTransport ::
22 TransportCrypto 22 TransportCrypto
23 -> OnionRouter 23 -> OnionRouter
24 -> (PublicKey -> IO (Maybe UDP.NodeInfo)) 24 -> (PublicKey -> IO (Maybe UDP.NodeInfo))
25 -> SockAddr -- ^ UDP bind-address
25 -> UDPTransport 26 -> UDPTransport
26 -> (TCP.NodeInfo -> RelayPacket -> IO ()) -- ^ TCP server-bound callback. 27 -> (TCP.NodeInfo -> RelayPacket -> IO ()) -- ^ TCP server-bound callback.
27 -> (Int -> OnionMessage Encrypted -> IO ()) -- ^ TCP client-bound callback. 28 -> (Int -> OnionMessage Encrypted -> IO ()) -- ^ TCP client-bound callback.
@@ -30,10 +31,10 @@ toxTransport ::
30 , Transport String (OnionDestination RouteId) (OnionMessage Encrypted) 31 , Transport String (OnionDestination RouteId) (OnionMessage Encrypted)
31 , Transport String AnnouncedRendezvous (PublicKey,OnionData) 32 , Transport String AnnouncedRendezvous (PublicKey,OnionData)
32 , Transport String SockAddr (Handshake Encrypted)) 33 , Transport String SockAddr (Handshake Encrypted))
33toxTransport crypto orouter closeLookup udp tcp2server tcp2client = do 34toxTransport crypto orouter closeLookup addr udp tcp2server tcp2client = do
34 (netcrypto, udp0) <- partitionTransport parseCrypto encodeCrypto udp 35 (netcrypto, udp0) <- partitionTransport parseCrypto encodeCrypto udp
35 (dht,udp1) <- partitionTransportM (parseDHTAddr crypto) (fmap Just . encodeDHTAddr) 36 (dht,udp1) <- partitionTransportM (parseDHTAddr crypto) (fmap Just . encodeDHTAddr)
36 $ forwardOnions crypto udp0 tcp2client 37 $ forwardOnions crypto addr udp0 tcp2client
37 (onion1,udp2) <- partitionAndForkTransport tcp2server 38 (onion1,udp2) <- partitionAndForkTransport tcp2server
38 (parseOnionAddr $ lookupSender orouter) 39 (parseOnionAddr $ lookupSender orouter)
39 (encodeOnionAddr crypto $ lookupRoute orouter) 40 (encodeOnionAddr crypto $ lookupRoute orouter)