From a088ba4607e921d61f466a44c5d675677e153699 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sat, 26 Mar 2022 15:41:58 +0100 Subject: [PATCH] rename quicConn.earlySessionReady to quicConn.earlyConnReady --- client.go | 2 +- client_test.go | 2 +- mock_quic_conn_test.go | 12 ++++++------ server.go | 4 ++-- server_test.go | 6 +++--- session.go | 12 ++++++------ session_test.go | 4 ++-- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/client.go b/client.go index fb5a6266..5e58eb44 100644 --- a/client.go +++ b/client.go @@ -311,7 +311,7 @@ func (c *client) dial(ctx context.Context) error { // Otherwise, earlyConnChan will be nil. Receiving from a nil chan blocks forever. var earlyConnChan <-chan struct{} if c.use0RTT { - earlyConnChan = c.conn.earlySessionReady() + earlyConnChan = c.conn.earlyConnReady() } select { diff --git a/client_test.go b/client_test.go index a6536bc2..24fff649 100644 --- a/client_test.go +++ b/client_test.go @@ -285,7 +285,7 @@ var _ = Describe("Client", func() { conn := NewMockQuicConn(mockCtrl) conn.EXPECT().run().Do(func() { <-done }) conn.EXPECT().HandshakeComplete().Return(context.Background()) - conn.EXPECT().earlySessionReady().Return(readyChan) + conn.EXPECT().earlyConnReady().Return(readyChan) return conn } diff --git a/mock_quic_conn_test.go b/mock_quic_conn_test.go index 94d80da4..880f1dd1 100644 --- a/mock_quic_conn_test.go +++ b/mock_quic_conn_test.go @@ -279,18 +279,18 @@ func (mr *MockQuicConnMockRecorder) destroy(arg0 interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "destroy", reflect.TypeOf((*MockQuicConn)(nil).destroy), arg0) } -// earlySessionReady mocks base method. -func (m *MockQuicConn) earlySessionReady() <-chan struct{} { +// earlyConnReady mocks base method. +func (m *MockQuicConn) earlyConnReady() <-chan struct{} { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "earlySessionReady") + ret := m.ctrl.Call(m, "earlyConnReady") ret0, _ := ret[0].(<-chan struct{}) return ret0 } -// earlySessionReady indicates an expected call of earlySessionReady. -func (mr *MockQuicConnMockRecorder) earlySessionReady() *gomock.Call { +// earlyConnReady indicates an expected call of earlyConnReady. +func (mr *MockQuicConnMockRecorder) earlyConnReady() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "earlySessionReady", reflect.TypeOf((*MockQuicConn)(nil).earlySessionReady)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "earlyConnReady", reflect.TypeOf((*MockQuicConn)(nil).earlyConnReady)) } // getPerspective mocks base method. diff --git a/server.go b/server.go index 81c4be34..7f21ee74 100644 --- a/server.go +++ b/server.go @@ -43,7 +43,7 @@ type packetHandlerManager interface { type quicConn interface { EarlyConnection - earlySessionReady() <-chan struct{} + earlyConnReady() <-chan struct{} handlePacket(*receivedPacket) GetVersion() protocol.VersionNumber getPerspective() protocol.Perspective @@ -505,7 +505,7 @@ func (s *baseServer) handleNewConn(conn quicConn) { if s.acceptEarlyConns { // wait until the early connection is ready (or the handshake fails) select { - case <-conn.earlySessionReady(): + case <-conn.earlyConnReady(): case <-sessCtx.Done(): return } diff --git a/server_test.go b/server_test.go index dfdfa7b5..3b33109d 100644 --- a/server_test.go +++ b/server_test.go @@ -1027,7 +1027,7 @@ var _ = Describe("Server", func() { Expect(enable0RTT).To(BeTrue()) conn.EXPECT().handlePacket(gomock.Any()) conn.EXPECT().run().Do(func() {}) - conn.EXPECT().earlySessionReady().Return(ready) + conn.EXPECT().earlyConnReady().Return(ready) conn.EXPECT().Context().Return(context.Background()) return conn } @@ -1072,7 +1072,7 @@ var _ = Describe("Server", func() { conn := NewMockQuicConn(mockCtrl) conn.EXPECT().handlePacket(gomock.Any()) conn.EXPECT().run() - conn.EXPECT().earlySessionReady().Return(ready) + conn.EXPECT().earlyConnReady().Return(ready) conn.EXPECT().Context().Return(context.Background()) return conn } @@ -1133,7 +1133,7 @@ var _ = Describe("Server", func() { ) quicConn { conn.EXPECT().handlePacket(p) conn.EXPECT().run() - conn.EXPECT().earlySessionReady() + conn.EXPECT().earlyConnReady() conn.EXPECT().Context().Return(ctx) close(connCreated) return conn diff --git a/session.go b/session.go index 1062edd4..e4fd66e3 100644 --- a/session.go +++ b/session.go @@ -188,7 +188,7 @@ type session struct { undecryptablePacketsToProcess []*receivedPacket clientHelloWritten <-chan *wire.TransportParameters - earlySessionReadyChan chan struct{} + earlyConnReadyChan chan struct{} handshakeCompleteChan chan struct{} // is closed when the handshake completes handshakeComplete bool handshakeConfirmed bool @@ -511,7 +511,7 @@ func (s *session) preSetup() { s.rttStats, s.logger, ) - s.earlySessionReadyChan = make(chan struct{}) + s.earlyConnReadyChan = make(chan struct{}) s.streamsMap = newStreamsMap( s, s.newFlowController, @@ -555,7 +555,7 @@ func (s *session) run() error { s.scheduleSending() if zeroRTTParams != nil { s.restoreTransportParameters(zeroRTTParams) - close(s.earlySessionReadyChan) + close(s.earlyConnReadyChan) } case closeErr := <-s.closeChan: // put the close error back into the channel, so that the run loop can receive it @@ -705,8 +705,8 @@ runLoop: } // blocks until the early session can be used -func (s *session) earlySessionReady() <-chan struct{} { - return s.earlySessionReadyChan +func (s *session) earlyConnReady() <-chan struct{} { + return s.earlyConnReadyChan } func (s *session) HandshakeComplete() context.Context { @@ -1575,7 +1575,7 @@ func (s *session) handleTransportParameters(params *wire.TransportParameters) { s.applyTransportParameters() // On the server side, the early session is ready as soon as we processed // the client's transport parameters. - close(s.earlySessionReadyChan) + close(s.earlyConnReadyChan) } } diff --git a/session_test.go b/session_test.go index 9bd8c07f..fa2ac77e 100644 --- a/session_test.go +++ b/session_test.go @@ -2077,12 +2077,12 @@ var _ = Describe("Connection", func() { streamManager.EXPECT().UpdateLimits(params) packer.EXPECT().HandleTransportParameters(params) packer.EXPECT().PackCoalescedPacket().MaxTimes(3) - Expect(sess.earlySessionReady()).ToNot(BeClosed()) + Expect(sess.earlyConnReady()).ToNot(BeClosed()) connRunner.EXPECT().GetStatelessResetToken(gomock.Any()).Times(2) connRunner.EXPECT().Add(gomock.Any(), sess).Times(2) tracer.EXPECT().ReceivedTransportParameters(params) sess.handleTransportParameters(params) - Expect(sess.earlySessionReady()).To(BeClosed()) + Expect(sess.earlyConnReady()).To(BeClosed()) }) })