diff --git a/integrationtests/self/key_update_test.go b/integrationtests/self/key_update_test.go index 1fb5a815..806b99ce 100644 --- a/integrationtests/self/key_update_test.go +++ b/integrationtests/self/key_update_test.go @@ -65,6 +65,7 @@ func (t *connTracer) StartedConnection(local, remote net.Addr, version logging.V func (t *connTracer) ClosedConnection(logging.CloseReason) {} func (t *connTracer) SentTransportParameters(*logging.TransportParameters) {} func (t *connTracer) ReceivedTransportParameters(*logging.TransportParameters) {} +func (t *connTracer) RestoredTransportParameters(*logging.TransportParameters) {} func (t *connTracer) SentPacket(hdr *logging.ExtendedHeader, size logging.ByteCount, ack *logging.AckFrame, frames []logging.Frame) { sentHeaders = append(sentHeaders, hdr) } diff --git a/internal/mocks/logging/connection_tracer.go b/internal/mocks/logging/connection_tracer.go index 4236612c..ae9eca7f 100644 --- a/internal/mocks/logging/connection_tracer.go +++ b/internal/mocks/logging/connection_tracer.go @@ -207,6 +207,18 @@ func (mr *MockConnectionTracerMockRecorder) ReceivedVersionNegotiationPacket(arg return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReceivedVersionNegotiationPacket", reflect.TypeOf((*MockConnectionTracer)(nil).ReceivedVersionNegotiationPacket), arg0, arg1) } +// RestoredTransportParameters mocks base method +func (m *MockConnectionTracer) RestoredTransportParameters(arg0 *wire.TransportParameters) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RestoredTransportParameters", arg0) +} + +// RestoredTransportParameters indicates an expected call of RestoredTransportParameters +func (mr *MockConnectionTracerMockRecorder) RestoredTransportParameters(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RestoredTransportParameters", reflect.TypeOf((*MockConnectionTracer)(nil).RestoredTransportParameters), arg0) +} + // SentPacket mocks base method func (m *MockConnectionTracer) SentPacket(arg0 *wire.ExtendedHeader, arg1 protocol.ByteCount, arg2 *wire.AckFrame, arg3 []logging.Frame) { m.ctrl.T.Helper() diff --git a/logging/interface.go b/logging/interface.go index 90837571..cf52cc15 100644 --- a/logging/interface.go +++ b/logging/interface.go @@ -107,6 +107,7 @@ type ConnectionTracer interface { ClosedConnection(CloseReason) SentTransportParameters(*TransportParameters) ReceivedTransportParameters(*TransportParameters) + RestoredTransportParameters(parameters *TransportParameters) // for 0-RTT SentPacket(hdr *ExtendedHeader, size ByteCount, ack *AckFrame, frames []Frame) ReceivedVersionNegotiationPacket(*Header, []VersionNumber) ReceivedRetry(*Header) diff --git a/logging/mock_connection_tracer_test.go b/logging/mock_connection_tracer_test.go index 1a45a903..c290e0c7 100644 --- a/logging/mock_connection_tracer_test.go +++ b/logging/mock_connection_tracer_test.go @@ -206,6 +206,18 @@ func (mr *MockConnectionTracerMockRecorder) ReceivedVersionNegotiationPacket(arg return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReceivedVersionNegotiationPacket", reflect.TypeOf((*MockConnectionTracer)(nil).ReceivedVersionNegotiationPacket), arg0, arg1) } +// RestoredTransportParameters mocks base method +func (m *MockConnectionTracer) RestoredTransportParameters(arg0 *wire.TransportParameters) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RestoredTransportParameters", arg0) +} + +// RestoredTransportParameters indicates an expected call of RestoredTransportParameters +func (mr *MockConnectionTracerMockRecorder) RestoredTransportParameters(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RestoredTransportParameters", reflect.TypeOf((*MockConnectionTracer)(nil).RestoredTransportParameters), arg0) +} + // SentPacket mocks base method func (m *MockConnectionTracer) SentPacket(arg0 *wire.ExtendedHeader, arg1 protocol.ByteCount, arg2 *wire.AckFrame, arg3 []Frame) { m.ctrl.T.Helper() diff --git a/logging/multiplex.go b/logging/multiplex.go index f700d880..f219a43a 100644 --- a/logging/multiplex.go +++ b/logging/multiplex.go @@ -84,6 +84,12 @@ func (m *connTracerMultiplexer) ReceivedTransportParameters(tp *TransportParamet } } +func (m *connTracerMultiplexer) RestoredTransportParameters(tp *TransportParameters) { + for _, t := range m.tracers { + t.RestoredTransportParameters(tp) + } +} + func (m *connTracerMultiplexer) SentPacket(hdr *ExtendedHeader, size ByteCount, ack *AckFrame, frames []Frame) { for _, t := range m.tracers { t.SentPacket(hdr, size, ack, frames) diff --git a/logging/multiplex_test.go b/logging/multiplex_test.go index 56fc8b88..dbd068ac 100644 --- a/logging/multiplex_test.go +++ b/logging/multiplex_test.go @@ -126,6 +126,13 @@ var _ = Describe("Tracing", func() { tracer.ReceivedTransportParameters(tp) }) + It("traces the RestoredTransportParameters event", func() { + tp := &wire.TransportParameters{InitialMaxData: 1337} + tr1.EXPECT().RestoredTransportParameters(tp) + tr2.EXPECT().RestoredTransportParameters(tp) + tracer.RestoredTransportParameters(tp) + }) + It("traces the SentPacket event", func() { hdr := &ExtendedHeader{Header: Header{DestConnectionID: ConnectionID{1, 2, 3}}} ack := &AckFrame{AckRanges: []AckRange{{Smallest: 1, Largest: 10}}} diff --git a/metrics/metrics.go b/metrics/metrics.go index 8e79707e..df53e427 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -165,6 +165,7 @@ func (t *connTracer) ClosedConnection(r logging.CloseReason) { } func (t *connTracer) SentTransportParameters(*logging.TransportParameters) {} func (t *connTracer) ReceivedTransportParameters(*logging.TransportParameters) {} +func (t *connTracer) RestoredTransportParameters(*logging.TransportParameters) {} func (t *connTracer) SentPacket(hdr *logging.ExtendedHeader, _ logging.ByteCount, _ *logging.AckFrame, _ []logging.Frame) { typ := logging.PacketTypeFromHeader(&hdr.Header) if typ == logging.PacketType1RTT { diff --git a/qlog/qlog.go b/qlog/qlog.go index dd4848d2..96ccf2fd 100644 --- a/qlog/qlog.go +++ b/qlog/qlog.go @@ -168,6 +168,10 @@ func (t *connectionTracer) ReceivedTransportParameters(tp *wire.TransportParamet t.recordTransportParameters(t.perspective.Opposite(), tp) } +func (t *connectionTracer) RestoredTransportParameters(tp *wire.TransportParameters) { + // TODO: implement +} + func (t *connectionTracer) recordTransportParameters(sentBy protocol.Perspective, tp *wire.TransportParameters) { owner := ownerLocal if sentBy != t.perspective {