diff options
author | Joe Crayne <joe@jerkface.net> | 2020-01-25 04:33:07 -0500 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2020-01-25 19:18:12 -0500 |
commit | 41b1a490c7b516c0feb0251fdb7723f045773f23 (patch) | |
tree | 1f8befbcecb0bd49c9c117f59b1ac0122d767c7a /dht/src | |
parent | ab97bbab7861355cc5e6384ea8c124ff5d1c41b0 (diff) |
Establish TCP link when sending OOB packet.
Diffstat (limited to 'dht/src')
-rw-r--r-- | dht/src/Network/Tox.hs | 1 | ||||
-rw-r--r-- | dht/src/Network/Tox/TCP.hs | 2 |
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 |
452 | putDBusError :: Bool -> String -> IO () | ||
452 | putDBusError bFatal msg = do | 453 | putDBusError 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 | ||
460 | partitionOnion :: TransportCrypto | 460 | partitionOnion :: TransportCrypto |