Commit graph

313 commits

Author SHA1 Message Date
Mingye Chen
209bff7cea sync: merge changes from quic-go v0.50.0 2025-04-01 11:48:45 -06:00
Marten Seemann
62947d97f5
simplify generation of stateless reset tokens (#4858) 2025-01-11 17:52:59 +08:00
Marten Seemann
5f8d146836
wire: optimize parsing of long header packets (#4589) 2024-07-21 14:22:32 -07:00
Marten Seemann
8f1110450b
use a net.ErrClosed when returning Accept from a closed server (#4569) 2024-06-24 03:33:34 -07:00
Marten Seemann
44e0147f2e
pass a context to Transport.ConnContext (#4536)
* pass a context to Transport.ConnContext

This context is cancelled when the QUIC connection is closed, or when
the QUIC handshake fails. This allows the application to easily build
and garbage collect a map of active connections.

* correctly handle fresh contexts returned from ConnContext
2024-06-04 21:37:18 -07:00
Marten Seemann
0d1e27d77c
introduce Transport.ConnContext, use client's context on the connection (#4507)
* introduce Transport.ConnContext, use client's context on the connection

* panic if ConnContext returns nil
2024-05-26 21:30:19 -07:00
Gaukas Wang
4973374ea5
sync: quic-go 0.42.0
Signed-off-by: Gaukas Wang <i@gaukas.wang>
2024-04-23 22:34:55 -06:00
Marten Seemann
eb1c16bd0e
fix flaky server accept queue test (#4453) 2024-04-21 07:33:41 -07:00
Marten Seemann
27a06f32ce
introduce a ConnectionTracingID type for the ConnectionTracingKey (#4400)
This is a breaking API change. Unfortunately, context values are not
strongly typed, so users will have have to take to change their type
assertions.
2024-04-01 21:10:12 -07:00
Marten Seemann
9971fedd42
use Transport.VerifySourceAddress to control the Retry Mechanism (#4362)
* use Transport.VerifySourceAddress to control the Retry Mechanism

This can be used to rate-limit handshakes originating from unverified
source addresses. Rate-limiting for handshakes can be implemented using
the GetConfigForClient callback on the Config.

* pass the remote address to Transport.VerifySourceAddress
2024-03-14 17:35:52 -07:00
Marten Seemann
7b8ceaa264
remove unused getPerspective function from quicConn interface (#4329) 2024-02-10 19:05:27 -08:00
Marten Seemann
69fe37885f
reenable previously disabled server unit test (#4328) 2024-02-10 18:44:43 -08:00
Marten Seemann
8e93770dd3
avoid lock contention when accepting new connections (#4313)
* avoid lock contention when accepting new connections

The server used to hold the packet handler map's lock while creating the
connection struct for a newly accepted connection. This was intended to
make sure that no two connections with the same Destination Connection
ID could be created.

This is a corner case: it can only happen if two Initial packets with
the same Destination Connection ID are received at the same time. If
the second one is received after the first one has already been
processed, it would be routed to the first connection. We don't need to
optimized for this corner case. It's ok to create a new connection in
that case, and immediately close it if this collision is detected.

* only pass 0-RTT to the connection if it was actually accepted
2024-02-08 19:34:42 -08:00
Marten Seemann
07ec3245bd
logging: add a Close function to the Tracer (#4298)
* logging: add a Close function to the Tracer

* close the Tracer when the Transport is closed
2024-02-02 21:12:15 -08:00
Marten Seemann
fbaa941ea1
protocol: rename VersionNumber to Version (#4295) 2024-01-31 21:57:33 -08:00
Marten Seemann
9b83ac230b
fix flaky handshake limiting test (#4281) 2024-01-28 20:26:03 -08:00
Marten Seemann
c82c37a31c
fix flaky accept queue test (#4280) 2024-01-28 20:14:02 -08:00
Marten Seemann
d3974e1674
fix flaky handshake limiting test (#4270) 2024-01-25 00:53:20 -08:00
Marten Seemann
a2cf43d75c
remove the RequireAddressValidation callback from the Config (#4253) 2024-01-22 21:24:07 -08:00
Marten Seemann
892851eb8c
add Transport config options to limit the number of handshakes (#4248)
* add Transport config options to limit the number of handshakes

* fix accounting for failed handshakes

* increase handshake limits, improve documentation
2024-01-22 21:04:25 -08:00
Marten Seemann
594440b04c
don't remove closed connections from the server's accept queue (#4245) 2024-01-18 22:45:38 -08:00
Marten Seemann
cb1775a08a
send out the CONNECTION_REFUSED error when refusing a connection (#4250)
So far, we used Connection.destroy, which destroys a connection without
sending out a CONNECTION_CLOSE frame. This is useful (for example) when
receiving a stateless reset, but it's not what we want when the server
refuses an incoming connection. In this case, we want to send out a
packet with a CONNECTION_CLOSE frame to inform the client that the
connection attempt is being rejected.
2024-01-18 22:29:22 -08:00
Marten Seemann
427f53328b
fix flaky server test (#4167) 2023-11-14 02:00:42 -08:00
Marten Seemann
dda63b90eb
don't close established connections on Listener.Close, when using a Transport (#4072)
* don't close established connections on Listener.Close

* only close once
2023-10-26 23:10:13 -07:00
Gaukas Wang
7c77243b04
upstream: sync to 0.39.1 2023-10-26 22:47:22 -06:00
Marten Seemann
a263164d9f
use new gomock feature to generate type-safe methods in mocks (#4057) 2023-10-20 22:55:33 -07:00
Marten Seemann
9a397abc17
update gomock to v0.3.0 (#4087) 2023-09-24 04:38:28 -07:00
Marten Seemann
1affe38703
move MaxTokenAge configuration option to the Transport (#4084) 2023-09-16 05:10:20 -07:00
Marten Seemann
9b82196578
make the logging.Tracer and logging.ConnectionTracer a struct (#4082) 2023-09-16 04:58:51 -07:00
Marten Seemann
abfe1ef548
remove Config.MaxRetryTokenAge, set it to the handshake timeout (#4064)
There is no good reason to manually set the validity period for Retry
tokens. Retry tokens are only valid on a single connection during the
handshake, so it makes sense to limit their validity to the configured
handshake timeout.
2023-09-10 13:53:12 +07:00
Marten Seemann
d7334c16e7
move the DisableVersionNegotiationPackets flag to the Transport (#4047)
* move the DisableVersionNegotiationPackets flag to the Transport

* add an integration test for DisableVersionNegotiationPackets
2023-08-30 23:33:40 -07:00
Gaukas Wang
856bc02b8f
Merge branch 'upstream' into sync-upstream 2023-08-28 14:12:03 -06:00
Marten Seemann
2797f85fc0
switch from unmaintained golang/mock to go.uber.org/mock (#4050) 2023-08-28 02:23:55 -07:00
Gaukas Wang
95575f5fe7
break: update repo url [ci skip]
uTLS is not yet bumped to the new version, so this commit breaks the dependencies relationship by getting rid of the local replace.
2023-08-03 18:58:52 -06:00
Gaukas Wang
fca46117e4
impl: uquic with utls 2023-07-29 23:45:16 -06:00
Marten Seemann
072a602cc1
pass around receivedPacket as struct instead of as pointer (#3823) 2023-06-03 00:08:58 -07:00
Marten Seemann
07ad2cbee2 remove Tracer from Config, put ConnectionTracer constructor there 2023-05-02 15:56:49 +02:00
Marten Seemann
bc7cb706c5 add a GetConfigForClient callback to the Config 2023-05-02 15:56:49 +02:00
Marten Seemann
ba942715db remove ConnectionIDLength and ConnectionIDGenerator from the Config 2023-05-02 15:56:49 +02:00
Marten Seemann
b79b532b04 remove StatelessResetKey from the Config, it's now on the Transport 2023-05-02 15:56:49 +02:00
Marten Seemann
8189e75be6 implement the Transport 2023-05-02 15:56:48 +02:00
Marten Seemann
ae5a8bd35c move the QUIC version check to the config validation 2023-05-02 09:44:58 +02:00
Marten Seemann
86a1234c87 make EarlyListener a struct, not an interface 2023-05-01 14:41:16 +02:00
Marten Seemann
1b64b13750 make Listener a struct, not an interface 2023-05-01 14:41:16 +02:00
Marten Seemann
6617f3d39a don't use timers to clean up 0-RTT queues 2023-05-01 14:24:28 +02:00
Marten Seemann
58487803d3 move 0-RTT queue handling from the packet handler map to the server 2023-05-01 14:24:28 +02:00
Marten Seemann
c9a2f79b1c
simplify mockgen usage for private interfaces (#3769) 2023-04-19 07:57:00 -07:00
Marten Seemann
1f57d4e789
protocol: remove VersionTLS, used during the gQUIC -> TLS 1.3 transition (#3764) 2023-04-19 07:24:34 -07:00
Marten Seemann
a4b0265628
use a chan instead of a context in Connection.HandshakeComplete (#3709) 2023-03-26 06:51:56 -07:00
Marten Seemann
58cedf7a4f
rename module, adjust import paths to quic-go/quic-go (#3680) 2023-01-21 19:53:57 -08:00