diff options
Diffstat (limited to 'dht/src/Network/Tox')
-rw-r--r-- | dht/src/Network/Tox/TCP.hs | 2 | ||||
-rw-r--r-- | dht/src/Network/Tox/Transport.hs | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/dht/src/Network/Tox/TCP.hs b/dht/src/Network/Tox/TCP.hs index ca4ca817..5dfb8382 100644 --- a/dht/src/Network/Tox/TCP.hs +++ b/dht/src/Network/Tox/TCP.hs | |||
@@ -233,7 +233,7 @@ getUDPNodes' tcp seeking dst0 = do | |||
233 | , method = OnionPacketID -- meth | 233 | , method = OnionPacketID -- meth |
234 | , wrapQuery = \n8 src gateway x -> (,) True $ | 234 | , wrapQuery = \n8 src gateway x -> (,) True $ |
235 | OnionPacket n24 $ Addressed (UDP.nodeAddr dst) | 235 | OnionPacket n24 $ Addressed (UDP.nodeAddr dst) |
236 | $ wrapOnionPure b (wrap2 n24) (nodeAddr gateway') | 236 | $ wrapOnionPure b (wrap2 n24) (UDP.nodeAddr $ udpNodeInfo gateway') |
237 | $ wrapOnionPure c (wrap1 n24) (UDP.nodeAddr dst) | 237 | $ wrapOnionPure c (wrap1 n24) (UDP.nodeAddr dst) |
238 | $ NotForwarded $ encryptPayload (wrap0 n24) | 238 | $ NotForwarded $ encryptPayload (wrap0 n24) |
239 | $ OnionAnnounce Asymm | 239 | $ OnionAnnounce Asymm |
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)) |
33 | toxTransport crypto orouter closeLookup udp tcp2server tcp2client = do | 34 | toxTransport 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) |