Marten Seemann
7d54aa41a3
remove unneeded Connection.GetVersion method ( #4792 )
...
Instead, use Connection.ConnectionState().Version.
2024-12-23 20:29:26 +08:00
Marten Seemann
40a768e77b
flowcontrol: avoid calling time.Now(), pass time as a function parameter ( #4731 )
2024-11-28 17:46:22 +08:00
Marten Seemann
955506aa3b
fix arming of keep-alive timer after sending PMTUD probe packets ( #4716 )
2024-11-04 04:09:10 -08:00
Marten Seemann
8fc04bf1e0
fix calculation of idle timeout when the peer sets max_idle_timeout to 0 ( #4666 )
2024-09-08 02:29:09 -07:00
Marten Seemann
ad8f3c0ff8
fix handling of corrupted coalesced 1-RTT packets ( #4663 )
2024-09-06 20:43:42 -07:00
Marten Seemann
0b033db188
fix logging of short header connection IDs ( #4626 )
2024-08-06 17:28:40 -07:00
Marten Seemann
af9fa7a555
queue stream-related control frames in the respective stream ( #4610 )
...
* use a separate method for queueing control frames from the streams map
* queue stream-related control frames in the respective stream
2024-08-04 15:42:56 -07:00
Marten Seemann
931166bb8e
remove unneeded cryptoStream interface ( #4617 )
2024-08-03 17:16:02 -07:00
Marten Seemann
a147bee190
simplify frame queuing logic on 0-RTT rejection ( #4607 )
...
Even though we currently don't do so, sending MAX_DATA, MAX_STREAM_DATA
and MAX_STREAMS is allowed in 0-RTT.
2024-08-03 17:00:41 -07:00
Marten Seemann
42f04d4e02
refactor frame packing to logic to not access the streams map ( #4596 )
...
* avoid accessing the streams map when packing stream data
* avoid accessing the streams map when packing flow control frames
* remove streamGetter interface
2024-07-28 12:32:54 -07:00
Marten Seemann
fc79a77ffe
remove unused framer interface ( #4599 )
...
No functional change expected.
2024-07-24 16:55:09 -07:00
Marten Seemann
8451b0afd7
utils: remove scarcely used time helper functions ( #4593 )
2024-07-23 14:16:12 -07:00
Marten Seemann
5f8d146836
wire: optimize parsing of long header packets ( #4589 )
2024-07-21 14:22:32 -07:00
Marten Seemann
bc642d872d
simplify handling of CRYPTO frames, remove cryptoDataHandler interface ( #4588 )
2024-07-21 11:59:08 -07:00
Marten Seemann
72092fbc29
move connection logging to a separate file, absorb logutils package ( #4586 )
...
No functional change expected.
2024-07-21 11:31:32 -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
07acaad2f7
add context to EarlyConnection.NextConnection, handle handshake failures ( #4551 )
2024-06-04 20:51:54 -07:00
Marten Seemann
73a5370f3c
use a chan instead of a context to track handshake completion ( #4547 )
...
No functional change expected.
2024-06-02 22:47:25 -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
Marten Seemann
e41d1f9dd7
logging / qlog: add support for DPLPMTUD ( #4517 )
...
* logging / qlog: add support for DPLPMTUD
* improve the MTU discovery integration test
2024-05-14 02:37:54 -07:00
Marten Seemann
2557fb98b2
initialize the MTU discoverer when processing the transport parameters ( #4514 )
...
On the client side, we always use the configured packet size. This comes
with the risk of failing the handshake if the path doesn't support this
MTU. If the server sends a max_udp_payload_size that's smaller than this
size, we can safely ignore this: Obviously, the server still processed
the (fully padded) Initial packet, despite claiming that it wouldn't do
so.
On the server side, there's no downside to using 1200 bytes until we
received the client's transport parameters:
* If the first packet didn't contain the entire ClientHello, all we can
do is ACK that packet. We don't need a lot of bytes for that.
* If it did, we will have processed the transport parameters and
initialized the MTU discoverer.
2024-05-13 22:50:26 -07:00
Marten Seemann
f3d76b39bf
make the initial packet size configurable ( #4503 )
2024-05-08 21:41:08 -07:00
Marten Seemann
e90a0d4e03
increase initial packet size to 1280 bytes (for both IPv4 and IPv6) ( #4500 )
2024-05-08 20:55:19 -07:00
Marten Seemann
d1c1f18e4c
wire: write configured value of max_udp_payload_size transport parameter ( #4501 )
2024-05-07 21:30:28 -07:00
Marten Seemann
66f968b9ff
reject sending of DATAGRAM frames that exceed the current MTU ( #4497 )
...
* reject sending of datagrams that exceed the current MTU
* check datagram size in PMTUD integration test
2024-05-07 00:06:00 -07:00
Marten Seemann
c0250ce824
include the maximum payload size in the DatagramTooLargeError ( #4470 )
...
This is more useful than the maximum frame size. The user of the library
shouldn't have to care about the QUIC framing layer.
---------
Co-authored-by: 世界 <i@sekai.icu >
2024-04-27 05:54:16 -07:00
Marten Seemann
e310b80cf3
expose the connection tracing ID on the stream context ( #4414 )
...
This is especially interesting for HTTP servers: They can now learn
which connection a request was received on.
2024-04-06 07:41:25 -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
4a99b816ae
close connection when an abnormally large number of frames are queued ( #4369 )
...
Under normal circumstances, we should be able to send out control frames
right away, so we don't expect any queue to build up. To defend against
resource exhaustion attacks, we limit the control frame queue to 16384
elements.
2024-03-17 17:29:00 -07:00
Marten Seemann
c786a46f42
remove unused perspective arg from packetHandlerMap.ReplaceWithClosed ( #4330 )
2024-02-10 19:27:51 -08:00
Marten Seemann
7b8ceaa264
remove unused getPerspective function from quicConn interface ( #4329 )
2024-02-10 19:05:27 -08:00
Marten Seemann
fbaa941ea1
protocol: rename VersionNumber to Version ( #4295 )
2024-01-31 21:57:33 -08:00
Marten Seemann
be4838bd64
wire: remove FrameParser interface, expose FrameParser struct ( #4284 )
...
Instead, expose the FrameParser struct. This allows us to embed it
directly into the connection struct, avoiding a pointer indirection.
2024-01-28 22:34:28 -08:00
Marten Seemann
940feef063
only log the discarding of Handshake keys once ( #4274 )
2024-01-28 20:51:22 -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
b3eb375bc1
remove shutdown method on the Connection ( #4249 )
...
There's no need to have a dedicated shutdown method, as the use case
(shutting down an outgoing connection attempt on context cancellation)
can be achieved by using Connection.destroy.
2024-01-18 22:06:04 -08:00
Marten Seemann
1fce81f8bb
queue up to 32 DATAGRAM frames to send ( #4222 )
2023-12-31 19:58:41 -08:00
Marten Seemann
22411e16d5
utils: switch to standard library min and max functions ( #4218 )
...
These functions were added in Go 1.21.
2023-12-27 21:19:13 -08:00
Benedikt Spies
31a677cacd
qlog: add support for alpn_information event ( #4216 )
...
* qlog chosen alpn
* qlog chosen alpn
* qlog: fix capitalization of ALPN
---------
Co-authored-by: Marten Seemann <martenseemann@gmail.com >
2023-12-25 21:02:47 -08:00
Benedikt Spies
45922f76d6
reduce calls to time.Now() calls in connection ( #4191 )
2023-12-06 06:00:58 -08:00
chungthuang
7b9d21fbe6
send large max_datagram_frame size, introduce a DatagramTooLargeError error ( #4143 )
...
The size can be overwritten to a lower value for testing.
2023-12-02 06:27:15 -08:00
Marten Seemann
3bf2e19d0d
logging: pass the packet number to ConnectionTracer.DroppedPacket ( #4171 )
...
In most cases the packet number is not known when a packet is dropped,
but it's useful to log the packet number when dropping a duplicate
packet.
2023-11-17 04:11:16 -08:00
Marten Seemann
1c631cf9cb
rename Connection.{Send,Receive}Message to {Send,Receive}Datagram ( #4116 )
...
This is more consistent with both the RFC and the rest of the API. For
example, the option in the Config is already name EnableDatagrams, and
the property in the ConnectionState is named SupportsDatagrams.
2023-10-24 21:18:09 -07:00
Marten Seemann
9b82196578
make the logging.Tracer and logging.ConnectionTracer a struct ( #4082 )
2023-09-16 04:58:51 -07:00
Benedikt Spies
37a3c417a7
expose GSO usage through ConnectionState ( #4083 )
2023-09-13 23:55:49 -07:00
Marten Seemann
b6ce91bfe7
stop appending to a GSO batch when the ECN marking changes
2023-09-11 21:14:53 +07:00
Marten Seemann
ad63e2a40a
trace and qlog the ECN marking on sent and received packets
2023-09-11 20:31:50 +07:00
Marten Seemann
bed8ebbd4c
distinguish coalesced and 1-RTT packets when determining ECN mode
2023-09-11 20:31:50 +07:00
Marten Seemann
b73a4de7ea
only add an ECN control message if ECN is supported
2023-09-11 20:31:50 +07:00
Marten Seemann
5dd6d91c11
send and track packets with ECN markings
2023-09-11 20:31:50 +07:00