Skip to content

Commit

Permalink
rename the session to connection
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Mar 27, 2022
1 parent d7ad1b6 commit 891fe64
Show file tree
Hide file tree
Showing 15 changed files with 569 additions and 569 deletions.
2 changes: 1 addition & 1 deletion client.go
Expand Up @@ -280,7 +280,7 @@ func newClient(
func (c *client) dial(ctx context.Context) error {
c.logger.Infof("Starting new connection to %s (%s -> %s), source connection ID %s, destination connection ID %s, version %s", c.tlsConf.ServerName, c.sconn.LocalAddr(), c.sconn.RemoteAddr(), c.srcConnID, c.destConnID, c.version)

c.conn = newClientSession(
c.conn = newClientConnection(
c.sconn,
c.packetHandlers,
c.destConnID,
Expand Down
28 changes: 14 additions & 14 deletions client_test.go
Expand Up @@ -31,7 +31,7 @@ var _ = Describe("Client", func() {
tracer *mocklogging.MockConnectionTracer
config *Config

originalClientSessConstructor func(
originalClientConnConstructor func(
conn sendConn,
runner connRunner,
destConnID protocol.ConnectionID,
Expand All @@ -51,7 +51,7 @@ var _ = Describe("Client", func() {
BeforeEach(func() {
tlsConf = &tls.Config{NextProtos: []string{"proto1"}}
connID = protocol.ConnectionID{0, 0, 0, 0, 0, 0, 0x13, 0x37}
originalClientSessConstructor = newClientSession
originalClientConnConstructor = newClientConnection
tracer = mocklogging.NewMockConnectionTracer(mockCtrl)
tr := mocklogging.NewMockTracer(mockCtrl)
tr.EXPECT().TracerForConnection(gomock.Any(), protocol.PerspectiveClient, gomock.Any()).Return(tracer).MaxTimes(1)
Expand All @@ -77,11 +77,11 @@ var _ = Describe("Client", func() {

AfterEach(func() {
connMuxer = origMultiplexer
newClientSession = originalClientSessConstructor
newClientConnection = originalClientConnConstructor
})

AfterEach(func() {
if s, ok := cl.conn.(*session); ok {
if s, ok := cl.conn.(*connection); ok {
s.shutdown()
}
Eventually(areConnsRunning).Should(BeFalse())
Expand Down Expand Up @@ -118,7 +118,7 @@ var _ = Describe("Client", func() {
mockMultiplexer.EXPECT().AddConn(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(manager, nil)

remoteAddrChan := make(chan string, 1)
newClientSession = func(
newClientConnection = func(
sconn sendConn,
_ connRunner,
_ protocol.ConnectionID,
Expand Down Expand Up @@ -151,7 +151,7 @@ var _ = Describe("Client", func() {
mockMultiplexer.EXPECT().AddConn(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(manager, nil)

hostnameChan := make(chan string, 1)
newClientSession = func(
newClientConnection = func(
_ sendConn,
_ connRunner,
_ protocol.ConnectionID,
Expand Down Expand Up @@ -184,7 +184,7 @@ var _ = Describe("Client", func() {
mockMultiplexer.EXPECT().AddConn(packetConn, gomock.Any(), gomock.Any(), gomock.Any()).Return(manager, nil)

hostnameChan := make(chan string, 1)
newClientSession = func(
newClientConnection = func(
_ sendConn,
_ connRunner,
_ protocol.ConnectionID,
Expand Down Expand Up @@ -223,7 +223,7 @@ var _ = Describe("Client", func() {
mockMultiplexer.EXPECT().AddConn(packetConn, gomock.Any(), gomock.Any(), gomock.Any()).Return(manager, nil)

run := make(chan struct{})
newClientSession = func(
newClientConnection = func(
_ sendConn,
runner connRunner,
_ protocol.ConnectionID,
Expand Down Expand Up @@ -266,7 +266,7 @@ var _ = Describe("Client", func() {

readyChan := make(chan struct{})
done := make(chan struct{})
newClientSession = func(
newClientConnection = func(
_ sendConn,
runner connRunner,
_ protocol.ConnectionID,
Expand Down Expand Up @@ -314,7 +314,7 @@ var _ = Describe("Client", func() {
mockMultiplexer.EXPECT().AddConn(packetConn, gomock.Any(), gomock.Any(), gomock.Any()).Return(manager, nil)

testErr := errors.New("early handshake error")
newClientSession = func(
newClientConnection = func(
_ sendConn,
_ connRunner,
_ protocol.ConnectionID,
Expand Down Expand Up @@ -357,7 +357,7 @@ var _ = Describe("Client", func() {
<-connRunning
})
conn.EXPECT().HandshakeComplete().Return(context.Background())
newClientSession = func(
newClientConnection = func(
_ sendConn,
_ connRunner,
_ protocol.ConnectionID,
Expand Down Expand Up @@ -409,7 +409,7 @@ var _ = Describe("Client", func() {
run := make(chan struct{})
connCreated := make(chan struct{})
conn := NewMockQuicConn(mockCtrl)
newClientSession = func(
newClientConnection = func(
connP sendConn,
_ connRunner,
_ protocol.ConnectionID,
Expand Down Expand Up @@ -529,7 +529,7 @@ var _ = Describe("Client", func() {
var cconn sendConn
var version protocol.VersionNumber
var conf *Config
newClientSession = func(
newClientConnection = func(
connP sendConn,
_ connRunner,
_ protocol.ConnectionID,
Expand Down Expand Up @@ -569,7 +569,7 @@ var _ = Describe("Client", func() {
mockMultiplexer.EXPECT().AddConn(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(manager, nil)

var counter int
newClientSession = func(
newClientConnection = func(
_ sendConn,
_ connRunner,
_ protocol.ConnectionID,
Expand Down
2 changes: 1 addition & 1 deletion conn_id_generator_test.go
Expand Up @@ -171,7 +171,7 @@ var _ = Describe("Connection ID Generator", func() {
}
})

It("replaces with a closed session for all connection IDs", func() {
It("replaces with a closed connection for all connection IDs", func() {
Expect(g.SetMaxActiveConnIDs(5)).To(Succeed())
Expect(queuedFrames).To(HaveLen(4))
sess := NewMockPacketHandler(mockCtrl)
Expand Down

0 comments on commit 891fe64

Please sign in to comment.