mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 04:37:36 +03:00
upstream: sync to 0.39.1
This commit is contained in:
commit
7c77243b04
147 changed files with 3740 additions and 2211 deletions
|
@ -178,8 +178,9 @@ var _ = Describe("Server", func() {
|
|||
)
|
||||
|
||||
BeforeEach(func() {
|
||||
tracer = mocklogging.NewMockTracer(mockCtrl)
|
||||
tr = &Transport{Conn: conn, Tracer: tracer}
|
||||
var t *logging.Tracer
|
||||
t, tracer = mocklogging.NewMockTracer(mockCtrl)
|
||||
tr = &Transport{Conn: conn, Tracer: t}
|
||||
ln, err := tr.Listen(tlsConf, nil)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
serv = ln.baseServer
|
||||
|
@ -292,7 +293,7 @@ var _ = Describe("Server", func() {
|
|||
_ *tls.Config,
|
||||
_ *handshake.TokenGenerator,
|
||||
_ bool,
|
||||
_ logging.ConnectionTracer,
|
||||
_ *logging.ConnectionTracer,
|
||||
_ uint64,
|
||||
_ utils.Logger,
|
||||
_ protocol.VersionNumber,
|
||||
|
@ -358,7 +359,7 @@ var _ = Describe("Server", func() {
|
|||
})
|
||||
|
||||
It("doesn't send a Version Negotiation packets if sending them is disabled", func() {
|
||||
serv.config.DisableVersionNegotiationPackets = true
|
||||
serv.disableVersionNegotiation = true
|
||||
srcConnID := protocol.ParseConnectionID([]byte{1, 2, 3, 4, 5})
|
||||
destConnID := protocol.ParseConnectionID([]byte{1, 2, 3, 4, 5, 6})
|
||||
packet := getPacket(&wire.Header{
|
||||
|
@ -494,7 +495,7 @@ var _ = Describe("Server", func() {
|
|||
_ *tls.Config,
|
||||
_ *handshake.TokenGenerator,
|
||||
_ bool,
|
||||
_ logging.ConnectionTracer,
|
||||
_ *logging.ConnectionTracer,
|
||||
_ uint64,
|
||||
_ utils.Logger,
|
||||
_ protocol.VersionNumber,
|
||||
|
@ -553,7 +554,7 @@ var _ = Describe("Server", func() {
|
|||
_ *tls.Config,
|
||||
_ *handshake.TokenGenerator,
|
||||
_ bool,
|
||||
_ logging.ConnectionTracer,
|
||||
_ *logging.ConnectionTracer,
|
||||
_ uint64,
|
||||
_ utils.Logger,
|
||||
_ protocol.VersionNumber,
|
||||
|
@ -606,7 +607,7 @@ var _ = Describe("Server", func() {
|
|||
_ *tls.Config,
|
||||
_ *handshake.TokenGenerator,
|
||||
_ bool,
|
||||
_ logging.ConnectionTracer,
|
||||
_ *logging.ConnectionTracer,
|
||||
_ uint64,
|
||||
_ utils.Logger,
|
||||
_ protocol.VersionNumber,
|
||||
|
@ -642,7 +643,7 @@ var _ = Describe("Server", func() {
|
|||
_ *tls.Config,
|
||||
_ *handshake.TokenGenerator,
|
||||
_ bool,
|
||||
_ logging.ConnectionTracer,
|
||||
_ *logging.ConnectionTracer,
|
||||
_ uint64,
|
||||
_ utils.Logger,
|
||||
_ protocol.VersionNumber,
|
||||
|
@ -713,7 +714,7 @@ var _ = Describe("Server", func() {
|
|||
_ *tls.Config,
|
||||
_ *handshake.TokenGenerator,
|
||||
_ bool,
|
||||
_ logging.ConnectionTracer,
|
||||
_ *logging.ConnectionTracer,
|
||||
_ uint64,
|
||||
_ utils.Logger,
|
||||
_ protocol.VersionNumber,
|
||||
|
@ -834,7 +835,8 @@ var _ = Describe("Server", func() {
|
|||
|
||||
It("sends an INVALID_TOKEN error, if an expired retry token is received", func() {
|
||||
serv.config.RequireAddressValidation = func(net.Addr) bool { return true }
|
||||
serv.config.MaxRetryTokenAge = time.Millisecond
|
||||
serv.config.HandshakeIdleTimeout = time.Millisecond / 2 // the maximum retry token age is equivalent to the handshake timeout
|
||||
Expect(serv.config.maxRetryTokenAge()).To(Equal(time.Millisecond))
|
||||
raddr := &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 1337}
|
||||
token, err := serv.tokenGenerator.NewRetryToken(raddr, protocol.ConnectionID{}, protocol.ConnectionID{})
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
@ -900,7 +902,7 @@ var _ = Describe("Server", func() {
|
|||
|
||||
It("sends an INVALID_TOKEN error, if an expired non-retry token is received", func() {
|
||||
serv.config.RequireAddressValidation = func(net.Addr) bool { return true }
|
||||
serv.config.MaxTokenAge = time.Millisecond
|
||||
serv.maxTokenAge = time.Millisecond
|
||||
raddr := &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 1337}
|
||||
token, err := serv.tokenGenerator.NewToken(raddr)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
@ -1022,7 +1024,7 @@ var _ = Describe("Server", func() {
|
|||
_ *tls.Config,
|
||||
_ *handshake.TokenGenerator,
|
||||
_ bool,
|
||||
_ logging.ConnectionTracer,
|
||||
_ *logging.ConnectionTracer,
|
||||
_ uint64,
|
||||
_ utils.Logger,
|
||||
_ protocol.VersionNumber,
|
||||
|
@ -1099,7 +1101,7 @@ var _ = Describe("Server", func() {
|
|||
_ *tls.Config,
|
||||
_ *handshake.TokenGenerator,
|
||||
_ bool,
|
||||
_ logging.ConnectionTracer,
|
||||
_ *logging.ConnectionTracer,
|
||||
_ uint64,
|
||||
_ utils.Logger,
|
||||
_ protocol.VersionNumber,
|
||||
|
@ -1172,7 +1174,7 @@ var _ = Describe("Server", func() {
|
|||
_ *tls.Config,
|
||||
_ *handshake.TokenGenerator,
|
||||
_ bool,
|
||||
_ logging.ConnectionTracer,
|
||||
_ *logging.ConnectionTracer,
|
||||
_ uint64,
|
||||
_ utils.Logger,
|
||||
_ protocol.VersionNumber,
|
||||
|
@ -1215,7 +1217,7 @@ var _ = Describe("Server", func() {
|
|||
_ *tls.Config,
|
||||
_ *handshake.TokenGenerator,
|
||||
_ bool,
|
||||
_ logging.ConnectionTracer,
|
||||
_ *logging.ConnectionTracer,
|
||||
_ uint64,
|
||||
_ utils.Logger,
|
||||
_ protocol.VersionNumber,
|
||||
|
@ -1279,7 +1281,7 @@ var _ = Describe("Server", func() {
|
|||
_ *tls.Config,
|
||||
_ *handshake.TokenGenerator,
|
||||
_ bool,
|
||||
_ logging.ConnectionTracer,
|
||||
_ *logging.ConnectionTracer,
|
||||
_ uint64,
|
||||
_ utils.Logger,
|
||||
_ protocol.VersionNumber,
|
||||
|
@ -1329,8 +1331,9 @@ var _ = Describe("Server", func() {
|
|||
)
|
||||
|
||||
BeforeEach(func() {
|
||||
tracer = mocklogging.NewMockTracer(mockCtrl)
|
||||
tr = &Transport{Conn: conn, Tracer: tracer}
|
||||
var t *logging.Tracer
|
||||
t, tracer = mocklogging.NewMockTracer(mockCtrl)
|
||||
tr = &Transport{Conn: conn, Tracer: t}
|
||||
ln, err := tr.ListenEarly(tlsConf, nil)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
phm = NewMockPacketHandlerManager(mockCtrl)
|
||||
|
@ -1404,13 +1407,13 @@ var _ = Describe("Server", func() {
|
|||
_ *tls.Config,
|
||||
_ *handshake.TokenGenerator,
|
||||
_ bool,
|
||||
_ logging.ConnectionTracer,
|
||||
_ *logging.ConnectionTracer,
|
||||
_ uint64,
|
||||
_ utils.Logger,
|
||||
_ protocol.VersionNumber,
|
||||
) quicConn {
|
||||
conn := NewMockQUICConn(mockCtrl)
|
||||
var calls []*gomock.Call
|
||||
var calls []any
|
||||
calls = append(calls, conn.EXPECT().handlePacket(initial))
|
||||
for _, p := range zeroRTTPackets {
|
||||
calls = append(calls, conn.EXPECT().handlePacket(p))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue