summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Data/PacketBuffer.hs3
-rw-r--r--src/Network/Tox/Crypto/Handlers.hs3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/Data/PacketBuffer.hs b/src/Data/PacketBuffer.hs
index f01abb28..d2e96d11 100644
--- a/src/Data/PacketBuffer.hs
+++ b/src/Data/PacketBuffer.hs
@@ -47,6 +47,7 @@ data PacketInboundEvent a
47 , peAcknowledgedNum :: Word32 -- ^ Earliest sequence number they've seen from us. 47 , peAcknowledgedNum :: Word32 -- ^ Earliest sequence number they've seen from us.
48 } 48 }
49 | PacketReceivedLossy { peSeqNum :: Word32 -- ^ Sequence number for lossy packet. 49 | PacketReceivedLossy { peSeqNum :: Word32 -- ^ Sequence number for lossy packet.
50 , peReceivedPayload :: a -- ^ Payload packet they sent to us (ignored).
50 , peAcknowledgedNum :: Word32 -- ^ Earliest sequence number they've seen from us. 51 , peAcknowledgedNum :: Word32 -- ^ Earliest sequence number they've seen from us.
51 } 52 }
52 deriving Functor 53 deriving Functor
@@ -66,7 +67,7 @@ grokInboundPacket :: PacketBuffer a b -> PacketInboundEvent a -> STM ()
66grokInboundPacket (PacketBuffer inb outb) (PacketReceived seqno a ack) 67grokInboundPacket (PacketBuffer inb outb) (PacketReceived seqno a ack)
67 = do Q.enqueue inb seqno a 68 = do Q.enqueue inb seqno a
68 Q.dropPacketsBefore outb ack 69 Q.dropPacketsBefore outb ack
69grokInboundPacket (PacketBuffer inb outb) (PacketReceivedLossy seqno ack) 70grokInboundPacket (PacketBuffer inb outb) (PacketReceivedLossy seqno _ ack)
70 = do Q.observeOutOfBand inb seqno 71 = do Q.observeOutOfBand inb seqno
71 Q.dropPacketsBefore outb ack 72 Q.dropPacketsBefore outb ack
72 73
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs
index 57df4734..07c033b6 100644
--- a/src/Network/Tox/Crypto/Handlers.hs
+++ b/src/Network/Tox/Crypto/Handlers.hs
@@ -7,6 +7,7 @@
7{-# LANGUAGE ViewPatterns #-} 7{-# LANGUAGE ViewPatterns #-}
8module Network.Tox.Crypto.Handlers where 8module Network.Tox.Crypto.Handlers where
9 9
10import Connection
10import Network.Tox.NodeId 11import Network.Tox.NodeId
11import Network.Tox.Crypto.Transport 12import Network.Tox.Crypto.Transport
12import Network.Tox.DHT.Transport (Cookie(..), NoSpam(..)) 13import Network.Tox.DHT.Transport (Cookie(..), NoSpam(..))
@@ -1182,7 +1183,7 @@ sessionPacketH sessions addrRaw (CryptoPacket nonce16 encrypted) = do
1182 if isLossy msgTypMapped 1183 if isLossy msgTypMapped
1183 then do dput XNetCrypto $ "enqueue ncPacketQueue Lossy " ++ show cm 1184 then do dput XNetCrypto $ "enqueue ncPacketQueue Lossy " ++ show cm
1184 atomically $ PB.grokInboundPacket ncPacketBuffer 1185 atomically $ PB.grokInboundPacket ncPacketBuffer
1185 (PacketReceivedLossy bufferEnd ack) 1186 (PacketReceivedLossy bufferEnd cd ack)
1186 runCryptoHook session (bufferData cd) 1187 runCryptoHook session (bufferData cd)
1187 else do dput XNetCrypto $ "enqueue ncPacketQueue Lossless " ++ show cm 1188 else do dput XNetCrypto $ "enqueue ncPacketQueue Lossless " ++ show cm
1188 when (msgID cm == PING) $ 1189 when (msgID cm == PING) $