mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
make the logging.Tracer and logging.ConnectionTracer a struct (#4082)
This commit is contained in:
parent
d8cc4cb3ef
commit
9b82196578
46 changed files with 1388 additions and 1158 deletions
|
@ -38,18 +38,13 @@ func countKeyPhases() (sent, received int) {
|
|||
return
|
||||
}
|
||||
|
||||
type keyUpdateConnTracer struct {
|
||||
logging.NullConnectionTracer
|
||||
}
|
||||
|
||||
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, _ logging.ByteCount, _ logging.ECN, _ []logging.Frame) {
|
||||
receivedHeaders = append(receivedHeaders, hdr)
|
||||
var keyUpdateConnTracer = &logging.ConnectionTracer{
|
||||
SentShortHeaderPacket: func(hdr *logging.ShortHeader, _ logging.ByteCount, _ logging.ECN, _ *logging.AckFrame, _ []logging.Frame) {
|
||||
sentHeaders = append(sentHeaders, hdr)
|
||||
},
|
||||
ReceivedShortHeaderPacket: func(hdr *logging.ShortHeader, _ logging.ByteCount, _ logging.ECN, _ []logging.Frame) {
|
||||
receivedHeaders = append(receivedHeaders, hdr)
|
||||
},
|
||||
}
|
||||
|
||||
var _ = Describe("Key Update tests", func() {
|
||||
|
@ -77,8 +72,8 @@ var _ = Describe("Key Update tests", func() {
|
|||
context.Background(),
|
||||
fmt.Sprintf("localhost:%d", server.Addr().(*net.UDPAddr).Port),
|
||||
getTLSClientConfig(),
|
||||
getQuicConfig(&quic.Config{Tracer: func(context.Context, logging.Perspective, quic.ConnectionID) logging.ConnectionTracer {
|
||||
return &keyUpdateConnTracer{}
|
||||
getQuicConfig(&quic.Config{Tracer: func(context.Context, logging.Perspective, quic.ConnectionID) *logging.ConnectionTracer {
|
||||
return keyUpdateConnTracer
|
||||
}}),
|
||||
)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue