diff options
author | James Crayne <jim.crayne@gmail.com> | 2018-11-03 09:35:14 -0400 |
---|---|---|
committer | James Crayne <jim.crayne@gmail.com> | 2018-11-03 09:35:14 -0400 |
commit | 41789213767b6422868011543cba1b71014ff166 (patch) | |
tree | f6aa2bbb92e1d171299f2da960b0fda1a3aeb83b /src | |
parent | b2caea0cbad781e3ee713229c33ccce23db8a2a3 (diff) |
PING missing from knownMsgs
* Also Padding (0) should be handled special
Diffstat (limited to 'src')
-rw-r--r-- | src/Network/Tox/Crypto/Handlers.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs index aa63efee..bf01e1b5 100644 --- a/src/Network/Tox/Crypto/Handlers.hs +++ b/src/Network/Tox/Crypto/Handlers.hs | |||
@@ -1120,8 +1120,8 @@ sessionPacketH sessions addrRaw (CryptoPacket nonce16 encrypted) = do | |||
1120 | isLossy (Msg mid) | lossyness mid == Lossy = True | 1120 | isLossy (Msg mid) | lossyness mid == Lossy = True |
1121 | isLossy _ = False | 1121 | isLossy _ = False |
1122 | ack = bufferStart -- Earliest sequence number they've seen from us. | 1122 | ack = bufferStart -- Earliest sequence number they've seen from us. |
1123 | if isLossy msgTypMapped | 1123 | if (msgTypMapped /= Msg Padding && isLossy msgTypMapped) || isLossy msgTyp |
1124 | then do dput XNetCrypto $ "enqueue ncPacketQueue Lossy " ++ show cm | 1124 | then do dput XNetCrypto $ "enqueue ncPacketQueue Lossy (msgTyp=" ++ show msgTyp ++ " msgTypMapped=" ++show msgTypMapped ++ ") " ++ show cm |
1125 | atomically $ PB.grokInboundPacket ncPacketBuffer | 1125 | atomically $ PB.grokInboundPacket ncPacketBuffer |
1126 | (PacketReceivedLossy bufferEnd cd ack) | 1126 | (PacketReceivedLossy bufferEnd cd ack) |
1127 | runCryptoHook session (bufferData cd) | 1127 | runCryptoHook session (bufferData cd) |
@@ -1231,7 +1231,8 @@ knownMsgs :: [Word64] | |||
1231 | knownMsgs = | 1231 | knownMsgs = |
1232 | concat [ map (fromIntegral . fromEnum) [ PacketRequest .. KillPacket ] | 1232 | concat [ map (fromIntegral . fromEnum) [ PacketRequest .. KillPacket ] |
1233 | , map (const 0) [ 3 .. 15 ] -- UnspecifiedPacket | 1233 | , map (const 0) [ 3 .. 15 ] -- UnspecifiedPacket |
1234 | , map (const 0) [ 16 .. 23 ] -- MessengerLoseless | 1234 | , map (fromIntegral . fromEnum) [ PING ] |
1235 | , map (const 0) [ 17 .. 23 ] -- MessengerLoseless | ||
1235 | , map (fromIntegral . fromEnum) [ ONLINE .. OFFLINE ] | 1236 | , map (fromIntegral . fromEnum) [ ONLINE .. OFFLINE ] |
1236 | , map (const 0) [ 26 .. 47 ] -- MessengerLoseless | 1237 | , map (const 0) [ 26 .. 47 ] -- MessengerLoseless |
1237 | , map (fromIntegral . fromEnum) [ NICKNAME .. TYPING ] | 1238 | , map (fromIntegral . fromEnum) [ NICKNAME .. TYPING ] |