forked from quic-go/quic-go
pass a context to logging.Tracer.NewConnectionTracer
This context has the same value attached to it as the context returned by Session.Context(). In the case of a dialed connection, this context is derived from the context used for dialing.
This commit is contained in:
@@ -3,6 +3,7 @@ package self_test
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"crypto/rsa"
|
||||
"crypto/tls"
|
||||
@@ -327,7 +328,7 @@ func newTracer(c func() logging.ConnectionTracer) logging.Tracer {
|
||||
return &tracer{createNewConnTracer: c}
|
||||
}
|
||||
|
||||
func (t *tracer) TracerForConnection(p logging.Perspective, odcid logging.ConnectionID) logging.ConnectionTracer {
|
||||
func (t *tracer) TracerForConnection(context.Context, logging.Perspective, logging.ConnectionID) logging.ConnectionTracer {
|
||||
return t.createNewConnTracer()
|
||||
}
|
||||
func (t *tracer) SentPacket(net.Addr, *logging.Header, logging.ByteCount, []logging.Frame) {}
|
||||
|
||||
@@ -25,7 +25,7 @@ type customTracer struct{}
|
||||
|
||||
var _ logging.Tracer = &customTracer{}
|
||||
|
||||
func (t *customTracer) TracerForConnection(p logging.Perspective, odcid logging.ConnectionID) logging.ConnectionTracer {
|
||||
func (t *customTracer) TracerForConnection(context.Context, logging.Perspective, logging.ConnectionID) logging.ConnectionTracer {
|
||||
return &customConnTracer{}
|
||||
}
|
||||
func (t *customTracer) SentPacket(net.Addr, *logging.Header, logging.ByteCount, []logging.Frame) {}
|
||||
|
||||
Reference in New Issue
Block a user