summaryrefslogtreecommitdiff
path: root/src/Data
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2018-08-21 02:03:42 -0400
committerJoe Crayne <joe@jerkface.net>2018-08-21 02:04:13 -0400
commita11ea7f098aea0ea933d6f778f4b29a9949693d1 (patch)
tree57f45c955508a123db2a04c4a8bd547ebe237893 /src/Data
parentedbc10169d7cf363928bdcae2385b64cfdf54675 (diff)
Added packet data to lossy inbound event.
Diffstat (limited to 'src/Data')
-rw-r--r--src/Data/PacketBuffer.hs3
1 files changed, 2 insertions, 1 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