introduce separate tracing calls for sent long and short header packets

This commit is contained in:
Marten Seemann 2022-08-30 15:59:55 +03:00
parent 9e5f92b561
commit 24be84cd00
14 changed files with 127 additions and 61 deletions

View file

@ -16,16 +16,13 @@ import (
)
var (
sentHeaders []*logging.ExtendedHeader
sentHeaders []*logging.ShortHeader
receivedHeaders []*logging.ShortHeader
)
func countKeyPhases() (sent, received int) {
lastKeyPhase := protocol.KeyPhaseOne
for _, hdr := range sentHeaders {
if hdr.IsLongHeader {
continue
}
if hdr.KeyPhase != lastKeyPhase {
sent++
lastKeyPhase = hdr.KeyPhase
@ -45,7 +42,7 @@ type keyUpdateConnTracer struct {
logging.NullConnectionTracer
}
func (t *keyUpdateConnTracer) SentPacket(hdr *logging.ExtendedHeader, size logging.ByteCount, ack *logging.AckFrame, frames []logging.Frame) {
func (t *keyUpdateConnTracer) SentShortHeaderPacket(hdr *logging.ShortHeader, _ logging.ByteCount, _ *logging.AckFrame, _ []logging.Frame) {
sentHeaders = append(sentHeaders, hdr)
}