make the logging.Tracer and logging.ConnectionTracer a struct (#4082)

This commit is contained in:
Marten Seemann 2023-09-16 18:58:51 +07:00 committed by GitHub
parent d8cc4cb3ef
commit 9b82196578
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 1388 additions and 1158 deletions

View file

@ -101,7 +101,8 @@ var _ = Describe("Connection", func() {
mconn.EXPECT().RemoteAddr().Return(remoteAddr).AnyTimes()
mconn.EXPECT().LocalAddr().Return(localAddr).AnyTimes()
tokenGenerator := handshake.NewTokenGenerator([32]byte{0xa, 0xb, 0xc})
tracer = mocklogging.NewMockConnectionTracer(mockCtrl)
var tr *logging.ConnectionTracer
tr, tracer = mocklogging.NewMockConnectionTracer(mockCtrl)
tracer.EXPECT().NegotiatedVersion(gomock.Any(), gomock.Any(), gomock.Any()).MaxTimes(1)
tracer.EXPECT().SentTransportParameters(gomock.Any())
tracer.EXPECT().UpdatedKeyFromTLS(gomock.Any(), gomock.Any()).AnyTimes()
@ -120,7 +121,7 @@ var _ = Describe("Connection", func() {
&tls.Config{},
tokenGenerator,
false,
tracer,
tr,
1234,
utils.DefaultLogger,
protocol.Version1,
@ -2540,7 +2541,8 @@ var _ = Describe("Client Connection", func() {
tlsConf = &tls.Config{}
}
connRunner = NewMockConnRunner(mockCtrl)
tracer = mocklogging.NewMockConnectionTracer(mockCtrl)
var tr *logging.ConnectionTracer
tr, tracer = mocklogging.NewMockConnectionTracer(mockCtrl)
tracer.EXPECT().NegotiatedVersion(gomock.Any(), gomock.Any(), gomock.Any()).MaxTimes(1)
tracer.EXPECT().SentTransportParameters(gomock.Any())
tracer.EXPECT().UpdatedKeyFromTLS(gomock.Any(), gomock.Any()).AnyTimes()
@ -2556,7 +2558,7 @@ var _ = Describe("Client Connection", func() {
42, // initial packet number
false,
false,
tracer,
tr,
1234,
utils.DefaultLogger,
protocol.Version1,