diff options
-rw-r--r-- | src/Data/Tox/Message.hs | 3 | ||||
-rw-r--r-- | src/Network/Tox/Crypto/Handlers.hs | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/Data/Tox/Message.hs b/src/Data/Tox/Message.hs index b77307a2..29b9f832 100644 --- a/src/Data/Tox/Message.hs +++ b/src/Data/Tox/Message.hs | |||
@@ -75,8 +75,9 @@ data LossyOrLossless = Lossless | Lossy | |||
75 | 75 | ||
76 | -- | Classify a packet as lossy or lossless. | 76 | -- | Classify a packet as lossy or lossless. |
77 | lossyness :: MessageID -> LossyOrLossless | 77 | lossyness :: MessageID -> LossyOrLossless |
78 | lossyness (fromEnum -> 1) = Lossless | ||
78 | lossyness (fromEnum -> x) | x < 3 = Lossy | 79 | lossyness (fromEnum -> x) | x < 3 = Lossy |
79 | lossyness (fromEnum -> x) | {-16 <= x,-} x < 192 = Lossless | 80 | lossyness (fromEnum -> x) | 16 <= x, x < 192 = Lossless |
80 | lossyness (fromEnum -> x) | 192 <= x, x < 255 = Lossy | 81 | lossyness (fromEnum -> x) | 192 <= x, x < 255 = Lossy |
81 | lossyness (fromEnum -> 255) = Lossless | 82 | lossyness (fromEnum -> 255) = Lossless |
82 | 83 | ||
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs index b72a07e3..aa63efee 100644 --- a/src/Network/Tox/Crypto/Handlers.hs +++ b/src/Network/Tox/Crypto/Handlers.hs | |||
@@ -815,8 +815,8 @@ runUponHandshake netCryptoSession0 addr pktoq = do | |||
815 | (nums,seqno) <- atomically $ PB.packetNumbersToRequest pktq | 815 | (nums,seqno) <- atomically $ PB.packetNumbersToRequest pktq |
816 | dput XNetCrypto $ "(Request Thread) Missing Packets detected:" ++ show nums | 816 | dput XNetCrypto $ "(Request Thread) Missing Packets detected:" ++ show nums |
817 | getOutGoingParam <- nqToWireIO pktoq | 817 | getOutGoingParam <- nqToWireIO pktoq |
818 | sendLossyResult <- sendLossy crypto netCryptoSession0 (createRequestPacket seqno nums) | 818 | sendPacketRequestResult <- sendLossless crypto netCryptoSession0 (createRequestPacket seqno nums) |
819 | case sendLossyResult of | 819 | case sendPacketRequestResult of |
820 | Left e -> dput XNetCrypto ("SEND PACKET REQUEST FAILED: " ++ e) | 820 | Left e -> dput XNetCrypto ("SEND PACKET REQUEST FAILED: " ++ e) |
821 | _ -> dput XNetCrypto ( "SENT PACKET REQUEST (seqno=" ++ show seqno ++") " ++ show nums) | 821 | _ -> dput XNetCrypto ( "SENT PACKET REQUEST (seqno=" ++ show seqno ++") " ++ show nums) |
822 | loop | 822 | loop |