Commit graph

36 commits

Author SHA1 Message Date
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
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
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
2797f85fc0
switch from unmaintained golang/mock to go.uber.org/mock (#4050) 2023-08-28 02:23:55 -07:00
Marten Seemann
bc7cb706c5 add a GetConfigForClient callback to the Config 2023-05-02 15:56:49 +02:00
Marten Seemann
8189e75be6 implement the Transport 2023-05-02 15:56:48 +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
58cedf7a4f
rename module, adjust import paths to quic-go/quic-go (#3680) 2023-01-21 19:53:57 -08:00
Marten Seemann
b659414495 use a single Go routine to send copies of CONNECTION_CLOSE packets 2022-08-21 15:41:47 +03:00
Marten Seemann
c3ab9c4ea9 replace all connection IDs at the same time when connection is closed 2022-08-21 14:09:49 +03:00
Marten Seemann
efe6d02bef use mockgen source mode 2021-02-20 09:59:44 +08:00
Marten Seemann
383f1a6e89 update gomock to v1.5.0 2021-02-20 09:33:43 +08:00
Marten Seemann
05066ae877 immediately remove reset tokens when retiring a connection ID 2020-11-22 10:21:20 +07:00
Marten Seemann
a1bb39d6ab introduce a protocol.StatelessResetToken 2020-07-10 19:55:20 +07:00
Marten Seemann
dad30e7c33 only create a single session for duplicate Initials 2020-05-29 16:04:45 +07:00
Marten Seemann
93693349f3 collapse packetHandlerManager.Add and AddIfNotTaken into one function 2020-02-03 17:34:07 +01:00
Marten Seemann
634169b061 don't return a stateless reset token when adding a new connection ID
Both server and client didn't make use of the token. It was only used by
the connIDGenerator.
2020-02-03 17:31:47 +01:00
Marten Seemann
db396d8a78 rename packetHandlerMap.Close() to Destroy() 2020-01-22 17:59:22 +07:00
Marten Seemann
e65df402dd only create a single session when two Initials arrive at the same time 2019-11-30 20:01:51 +07:00
Marten Seemann
35ea8213c5 move initialization of the client's transport parameters to the session 2019-11-05 11:00:06 +07:00
Marten Seemann
ccb777b834 retire the stateless reset token when the session is closed 2019-11-05 10:59:21 +07:00
Marten Seemann
ffbb810fcc retire stateless reset tokens instead of deleting them immediately 2019-11-05 10:59:21 +07:00
Marten Seemann
c7334e3e66 replace closed sessions in the packet handler map 2019-11-02 20:32:59 +07:00
Marten Seemann
03483d5e71 refactor how sessions are deleted
Replacing sessions with different structs representing a closed session
doesn't work if a session is using multiple connection IDs.
2019-09-25 15:34:38 +07:00
Marten Seemann
22b12f199e replace locally closed sessions with a dedicated closed session 2019-09-01 13:59:44 +07:00
Marten Seemann
94046cdb4b implement sending of stateless resets 2019-03-08 18:10:15 +09:00
Marten Seemann
5e34cb1d71 run go generate ./... 2019-03-05 13:42:56 +09:00
Marten Seemann
bb185a3ad2 add a function to close the packet handler map
Close will close the underlying connection and wait until listen has
returned. While not strictly necessary in production use, this will fix
a few race conditions in our tests.
2019-01-24 18:09:46 +07:00
Marten Seemann
65cca7b726 immediately remove sessions that were closed remotely
We only need to keep sessions that were closed locally, in order to
retransmit the CONNECTION_CLOSE packet. For sessions that were closed by
the peer, we don't need to wait for any more packets, and there's also
no CONNECTION_CLOSE to retransmit. The same applies for sessions that
were destroyed when receiving a Version Negotiation or a Retry packet.
2018-11-16 21:22:32 +07:00
Marten Seemann
a3831b2134 rename removing of connection IDs to retiring 2018-11-16 21:22:32 +07:00
Marten Seemann
ad5a3e2fa0 also use the multiplexer for the server 2018-08-08 10:03:22 +07:00
Marten Seemann
8b2992a243 split the Session.Close(error) in Close() and CloseWithError(error) 2018-07-06 15:51:35 +07:00
Marten Seemann
2c05dbff07 multiplex multiple clients on one packet conn 2018-06-23 08:35:11 +07:00
Marten Seemann
dacc94ccba rename the sessionMap to packetHandlerMap 2018-06-23 08:20:29 +07:00