replace usages of session in variable names

This commit is contained in:
Marten Seemann 2022-03-26 15:05:35 +01:00
parent e71c236232
commit fda9f72161
23 changed files with 373 additions and 373 deletions

View file

@ -7,7 +7,7 @@ import (
"net"
"time"
quic "github.com/lucas-clemente/quic-go"
"github.com/lucas-clemente/quic-go"
quicproxy "github.com/lucas-clemente/quic-go/integrationtests/tools/proxy"
"github.com/lucas-clemente/quic-go/internal/protocol"
@ -32,16 +32,16 @@ var _ = Describe("early data", func() {
go func() {
defer GinkgoRecover()
defer close(done)
sess, err := ln.Accept(context.Background())
conn, err := ln.Accept(context.Background())
Expect(err).ToNot(HaveOccurred())
str, err := sess.OpenUniStream()
str, err := conn.OpenUniStream()
Expect(err).ToNot(HaveOccurred())
_, err = str.Write([]byte("early data"))
Expect(err).ToNot(HaveOccurred())
Expect(str.Close()).To(Succeed())
// make sure the Write finished before the handshake completed
Expect(sess.HandshakeComplete().Done()).ToNot(BeClosed())
Eventually(sess.Context().Done()).Should(BeClosed())
Expect(conn.HandshakeComplete().Done()).ToNot(BeClosed())
Eventually(conn.Context().Done()).Should(BeClosed())
}()
serverPort := ln.Addr().(*net.UDPAddr).Port
proxy, err := quicproxy.NewQuicProxy("localhost:0", &quicproxy.Opts{
@ -53,18 +53,18 @@ var _ = Describe("early data", func() {
Expect(err).ToNot(HaveOccurred())
defer proxy.Close()
sess, err := quic.DialAddr(
conn, err := quic.DialAddr(
fmt.Sprintf("localhost:%d", proxy.LocalPort()),
getTLSClientConfig(),
getQuicConfig(&quic.Config{Versions: []protocol.VersionNumber{version}}),
)
Expect(err).ToNot(HaveOccurred())
str, err := sess.AcceptUniStream(context.Background())
str, err := conn.AcceptUniStream(context.Background())
Expect(err).ToNot(HaveOccurred())
data, err := io.ReadAll(str)
Expect(err).ToNot(HaveOccurred())
Expect(data).To(Equal([]byte("early data")))
sess.CloseWithError(0, "")
conn.CloseWithError(0, "")
Eventually(done).Should(BeClosed())
})
})