rename quicConn.earlySessionReady to quicConn.earlyConnReady

This commit is contained in:
Marten Seemann 2022-03-26 15:41:58 +01:00
parent 1ae835d1d8
commit a088ba4607
7 changed files with 21 additions and 21 deletions

View file

@ -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 {

View file

@ -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
}

View file

@ -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.

View file

@ -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
}

View file

@ -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

View file

@ -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)
}
}

View file

@ -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())
})
})