mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 04:07:35 +03:00
trace and qlog the ECN marking on sent and received packets
This commit is contained in:
parent
bed8ebbd4c
commit
ad63e2a40a
15 changed files with 212 additions and 120 deletions
|
@ -42,11 +42,13 @@ type keyUpdateConnTracer struct {
|
|||
logging.NullConnectionTracer
|
||||
}
|
||||
|
||||
func (t *keyUpdateConnTracer) SentShortHeaderPacket(hdr *logging.ShortHeader, _ logging.ByteCount, _ *logging.AckFrame, _ []logging.Frame) {
|
||||
var _ logging.ConnectionTracer = &keyUpdateConnTracer{}
|
||||
|
||||
func (t *keyUpdateConnTracer) SentShortHeaderPacket(hdr *logging.ShortHeader, _ logging.ByteCount, _ logging.ECN, _ *logging.AckFrame, _ []logging.Frame) {
|
||||
sentHeaders = append(sentHeaders, hdr)
|
||||
}
|
||||
|
||||
func (t *keyUpdateConnTracer) ReceivedShortHeaderPacket(hdr *logging.ShortHeader, size logging.ByteCount, frames []logging.Frame) {
|
||||
func (t *keyUpdateConnTracer) ReceivedShortHeaderPacket(hdr *logging.ShortHeader, _ logging.ByteCount, _ logging.ECN, _ []logging.Frame) {
|
||||
receivedHeaders = append(receivedHeaders, hdr)
|
||||
}
|
||||
|
||||
|
|
|
@ -265,19 +265,21 @@ type packetTracer struct {
|
|||
rcvdLongHdr []packet
|
||||
}
|
||||
|
||||
var _ logging.ConnectionTracer = &packetTracer{}
|
||||
|
||||
func newPacketTracer() *packetTracer {
|
||||
return &packetTracer{closed: make(chan struct{})}
|
||||
}
|
||||
|
||||
func (t *packetTracer) ReceivedLongHeaderPacket(hdr *logging.ExtendedHeader, _ logging.ByteCount, frames []logging.Frame) {
|
||||
func (t *packetTracer) ReceivedLongHeaderPacket(hdr *logging.ExtendedHeader, _ logging.ByteCount, _ logging.ECN, frames []logging.Frame) {
|
||||
t.rcvdLongHdr = append(t.rcvdLongHdr, packet{time: time.Now(), hdr: hdr, frames: frames})
|
||||
}
|
||||
|
||||
func (t *packetTracer) ReceivedShortHeaderPacket(hdr *logging.ShortHeader, _ logging.ByteCount, frames []logging.Frame) {
|
||||
func (t *packetTracer) ReceivedShortHeaderPacket(hdr *logging.ShortHeader, _ logging.ByteCount, _ logging.ECN, frames []logging.Frame) {
|
||||
t.rcvdShortHdr = append(t.rcvdShortHdr, shortHeaderPacket{time: time.Now(), hdr: hdr, frames: frames})
|
||||
}
|
||||
|
||||
func (t *packetTracer) SentShortHeaderPacket(hdr *logging.ShortHeader, _ logging.ByteCount, ack *wire.AckFrame, frames []logging.Frame) {
|
||||
func (t *packetTracer) SentShortHeaderPacket(hdr *logging.ShortHeader, _ logging.ByteCount, _ logging.ECN, ack *wire.AckFrame, frames []logging.Frame) {
|
||||
if ack != nil {
|
||||
frames = append(frames, ack)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue