Skip to content

Commit

Permalink
panic if ConnContext returns nil
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed May 13, 2024
1 parent 6a3d075 commit 60d4e96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 6 additions & 4 deletions integrationtests/self/self_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,12 @@ func getQuicConfig(conf *quic.Config) *quic.Config {
}
origTracer := conf.Tracer
conf.Tracer = func(ctx context.Context, p logging.Perspective, connID quic.ConnectionID) *logging.ConnectionTracer {
return logging.NewMultiplexedConnectionTracer(
tools.NewQlogConnectionTracer(GinkgoWriter)(ctx, p, connID),
origTracer(ctx, p, connID),
)
tr := origTracer(ctx, p, connID)
qlogger := tools.NewQlogConnectionTracer(GinkgoWriter)(ctx, p, connID)
if tr == nil {
return qlogger
}
return logging.NewMultiplexedConnectionTracer(qlogger, tr)
}
return conf
}
Expand Down
3 changes: 3 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,9 @@ func (s *baseServer) handleInitialImpl(p receivedPacket, hdr *wire.Header) error
var ctx context.Context
if s.connContext != nil {
ctx = s.connContext()
if ctx == nil {
panic("quic: ConnContext returned nil")
}
} else {
ctx = context.Background()
}
Expand Down

0 comments on commit 60d4e96

Please sign in to comment.