summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2020-01-25 04:33:07 -0500
committerJoe Crayne <joe@jerkface.net>2020-01-25 19:18:12 -0500
commit41b1a490c7b516c0feb0251fdb7723f045773f23 (patch)
tree1f8befbcecb0bd49c9c117f59b1ac0122d767c7a
parentab97bbab7861355cc5e6384ea8c124ff5d1c41b0 (diff)
Establish TCP link when sending OOB packet.
-rw-r--r--dht/src/Network/Tox.hs1
-rw-r--r--dht/src/Network/Tox/TCP.hs2
2 files changed, 2 insertions, 1 deletions
diff --git a/dht/src/Network/Tox.hs b/dht/src/Network/Tox.hs
index e0704f6f..6adfb9a9 100644
--- a/dht/src/Network/Tox.hs
+++ b/dht/src/Network/Tox.hs
@@ -449,6 +449,7 @@ dnssdDiscover tox ni toxid = do
449 void $ DHT.pingUDP (toxDHT tox) ni 449 void $ DHT.pingUDP (toxDHT tox) ni
450 450
451-- | Log a dbus error 451-- | Log a dbus error
452putDBusError :: Bool -> String -> IO ()
452putDBusError bFatal msg = do 453putDBusError bFatal msg = do
453 let fatality = if bFatal then "Fatal" else "Non-Fatal" 454 let fatality = if bFatal then "Fatal" else "Non-Fatal"
454 prefix = fatality <> " DBus Exception: " 455 prefix = fatality <> " DBus Exception: "
diff --git a/dht/src/Network/Tox/TCP.hs b/dht/src/Network/Tox/TCP.hs
index 27a0f3d6..a89dbced 100644
--- a/dht/src/Network/Tox/TCP.hs
+++ b/dht/src/Network/Tox/TCP.hs
@@ -454,7 +454,7 @@ partitionRelay tr = partitionTransportM parse encode tr
454 454
455 encode :: (ByteString, ViaRelay) -> IO (Maybe ((Bool,RelayPacket), NodeInfo)) 455 encode :: (ByteString, ViaRelay) -> IO (Maybe ((Bool,RelayPacket), NodeInfo))
456 encode (bs, ViaRelay (Just conid) _ ni) = return $ Just ((False,RelayData bs conid), ni) 456 encode (bs, ViaRelay (Just conid) _ ni) = return $ Just ((False,RelayData bs conid), ni)
457 encode (bs, ViaRelay Nothing nid ni) = return $ Just ((False,OOBSend (UDP.id2key nid) bs), ni) 457 encode (bs, ViaRelay Nothing nid ni) = return $ Just ((True,OOBSend (UDP.id2key nid) bs), ni)
458 458
459 459
460partitionOnion :: TransportCrypto 460partitionOnion :: TransportCrypto