Commit Graph

456 Commits

Author SHA1 Message Date
Marten Seemann
ef2b87f5d5 detect stateless resets for zero-length connection IDs (#5027) 2025-04-11 15:23:53 +02:00
Marten Seemann
79d546379b rename ClientHelloInfo to ClientInfo (#5016)
There’s no ClientHello (which is a TLS concept) involved here.
2025-03-31 16:15:09 +02:00
Marten Seemann
1d8f3f281a ci: update golangci-lint to v2 (#5007) 2025-03-30 07:16:14 +02:00
Marten Seemann
6fe46d6253 send PATH_RESPONSEs on the same path (#4991)
* make it possible to pack path probes with multiple frames

* simplify function signature of pathManager.HandlePacket

* simplify connection short header packet handling logic

No functional change expected.

* make server send PATH_RESPONSEs on the same path

This makes sure that we’re actually testing for return routability.
2025-03-16 04:28:53 +01:00
Marten Seemann
24acc54ef1 add support for connection migration (#4960) 2025-03-12 06:11:11 +01:00
Marten Seemann
751ca8dfb6 fix typo in UDP connection helper function in tests (#4970) 2025-02-24 09:39:29 +01:00
Marten Seemann
6033030017 proxy: add source and destination address to delay and drop callbacks (#4964) 2025-02-22 12:21:40 +01:00
Marten Seemann
5a1a34df37 implement server-side path validation logic (#4944) 2025-02-12 13:50:11 +01:00
Marten Seemann
3e87ea3f50 proxy: add function to simulate NAT rebinding (#4922) 2025-01-26 05:03:08 +01:00
Marten Seemann
79bae396b4 proxy: rename to Proxy, refactor initialization (#4921)
* proxy: rename to Proxy, refactor initialization

* improve documentation
2025-01-25 11:13:33 +01:00
Marten Seemann
f5145eb627 proxy: remove QuicProxy.LocalPort method (#4920) 2025-01-25 04:18:22 +01:00
Marten Seemann
bea70c6489 fix flaky TestALPN integration test (#4909) 2025-01-21 20:04:26 +08:00
Marten Seemann
07bbe8c383 add ErrTransportClosed and use it for Listen/Dial after transport close (#4883)
* add ErrTransportClosed and use it for Listen/Dial after transport close

* include the original error in the ErrTransportClosed error string
2025-01-21 13:54:40 +08:00
Roccoon
96ce54e83f http3: add client trace support (#4749)
Since the QUIC connection establishment process includes TLS handshake logic,
Connect and TLS handshake are called in the following order:

ConnectStart -> TLSHandshakeStart -> TLSHandshakeDone -> ConnectDone.

Notice: Wait100Continue not implemented as quic-go doesn't support handling
Expect: 100-continue.
2025-01-14 12:50:16 +08:00
Marten Seemann
61adb85052 use testing.T.Tempdir and Setenv in QLOGDIR integration test (#4868) 2025-01-13 10:02:13 +08:00
Marten Seemann
420f852f86 drain server's accept queue before returning ErrClosed from Accept (#4846) 2025-01-08 21:59:05 +08:00
Marten Seemann
c42f8456ab optimize packetization of DATA_BLOCKED frames (#4845)
DATA_BLOCKED frames should be sent in the same as the STREAM frames that
resulted in the connection becoming blocked on connection flow control.
If there's not enough space left in that packet, the DATA_BLOCKED frame
is sent in the next packet.
2025-01-08 11:41:10 +08:00
Marten Seemann
3cb5f3e104 optimize packing of STREAM_DATA_BLOCKED frames (#4801)
* refactor the framer to pack both control and STREAM frames

* refactor framer STREAM frame packing logic

* pack STREAM_DATA_BLOCKED in the same packet as the STREAM frame

This makes debugging easier (and is slightly more efficient). In the
pathological case where there is not enough space remaning in the packet
to pack the STREAM_DATA_BLOCKED frame, it is queued for the next packet.

* add an integration test
2025-01-07 12:06:00 +08:00
Marten Seemann
eec74b14c6 fix errors.Is for StreamError and DatagramTooLargeError (#4825) 2024-12-29 17:56:38 +08:00
Marten Seemann
52757a97e9 fix flaky MITM packet corruption test (#4821) 2024-12-28 19:39:17 +08:00
Marten Seemann
9cf118fc82 fix flaky MITM packet injection test (#4810)
Instead of transferring data in one direction, we should echo the data
sent. This makes sure that a roughly equal number of packets is sent in
each direction.
2024-12-28 15:38:54 +08:00
Marten Seemann
a584e58099 flowcontrol: reset the connection send window when 0-RTT is rejected (#4764) 2024-12-22 11:36:14 +08:00
Marten Seemann
468cea250d fix flaky non-QUIC packet multiplexing test (#4766) 2024-12-19 11:32:50 +08:00
Marten Seemann
408ba9f053 use a 24h maximum token age if Transport.MaxTokenAge is unset (#4763) 2024-12-18 19:44:03 +08:00
Marten Seemann
32c9c81962 improve stream limit 0-RTT integration test (#4761) 2024-12-18 14:34:48 +08:00
Marten Seemann
0192a17a3d fix flaky multiplex integration test (#4760) 2024-12-18 14:07:03 +08:00
Marten Seemann
9083be4322 fix connection ID length integration test (#4757) 2024-12-18 12:25:09 +08:00
Marten Seemann
3886be4e95 introduce a test helper function to create a UDP socket on localhost (#4756) 2024-12-17 23:30:00 +08:00
Marten Seemann
8cb88ee145 fix timeout integration tests on Windows (#4758)
The Go timer resolution on Windows leaves a lot to be desired. By
bumping the timeout duration the test will take longer, but at least it
won't be flaky.
2024-12-17 21:22:42 +08:00
Marten Seemann
691086db7f migrate integration tests away from Ginkgo (#4736)
* use require in benchmark tests

* translate the QLOGDIR test

* translate handshake tests

* translate the handshake RTT tests

* translate the early data test

* translate the MTU tests

* translate the key update test

* translate the stateless reset tests

* translate the packetization test

* translate the close test

* translate the resumption test

* translate the tracer test

* translate the connection ID length test

* translate the RTT tests

* translate the multiplexing tests

* translate the drop tests

* translate the handshake drop tests

* translate the 0-RTT tests

* translate the hotswap test

* translate the stream test

* translate the unidirectional stream test

* translate the timeout tests

* translate the MITM test

* rewrite the datagram tests

* translate the cancellation tests

* translate the deadline tests

* translate the test helpers
2024-12-16 23:43:59 +08:00
Marten Seemann
2dca400b5c migrate HTTP/3 integration tests away from Ginkgo (#4746) 2024-12-05 14:58:29 +08:00
Marten Seemann
71a27d40c9 wait until handshaking connections have terminated when closing server (#4743) 2024-12-03 11:10:13 +08:00
Marten Seemann
a302d7ba4d enable DPLPMTUD on macOS dual-stack sockets (#4723)
* enable DPLPMTUD on macOS dual-stack sockets

https://datatracker.ietf.org/doc/draft-seemann-tsvwg-udp-fragmentation/
contains details on how IP fragmentation is handled on different
platforms.

* only enable DF on macOS Sequoia (and newer) dual-stack sockets

* fix macOS version numbers

* fix comment in MTU integration test

* skip dual-stack test on old macOS versions
2024-12-01 14:50:49 +08:00
Marten Seemann
6af2b1a478 http3: rename Server.CloseGracefully to Shutdown (#4701)
This is more consistent with standard library naming for graceful
shutdown methods for HTTP/1 and HTTP/2.
2024-10-15 02:14:47 -07:00
Marten Seemann
1db805ce4f http3: improve the client API (#4693)
* http3: rename RoundTripper to Transport

* http3: rename SingleDestinationRoundTripper to ClientConn

* http3: construct the ClientConn via Transport.NewClientConn
2024-10-13 22:17:50 -07:00
Marten Seemann
eaa879f32f http3: send GOAWAY when server is shutting down (#4691)
* send goaway when server is shutting down

* http3: track next stream ID instead of last stream ID for GOAWAYs

* refactor the graceful shutdown integration tests

* http3: improve GOAWAY frame parsing tests

* http3: simplify server graceful shutdown logic

* http3: simplify parsing of GOAWAY frames

* http3: clean up initialization of server contexts

* http3: fix race condition in graceful shutdown logic

---------

Co-authored-by: WeidiDeng <weidi_deng@icloud.com>
2024-10-11 21:47:17 -07:00
Marten Seemann
e5693d0ad7 http3: immediately close all connections on Server.Close (#4689)
* http3: immediately close all connections on Server.Close

* http3: document connection closing when using ServeQUICConn
2024-10-09 13:24:13 -07:00
Kevin McDonald
b92bf0c80d http3: initialize trailer map with empty trailer entries when parsing the header (#4656)
* feat: pre-populate trailers on response with empty values

* fix: improve comment/func name
2024-09-06 23:59:07 -07:00
Kevin McDonald
09c2ac8aab http3: add HTTP Trailer support for servers (#4630) 2024-09-06 21:51:54 -07:00
Marten Seemann
26a3525337 http3: reject connection-specific header fields, check value of TE (#4655) 2024-09-01 02:20:35 -07:00
Marten Seemann
7c3544ca34 http3: set ContentLength to -1 if no Content-Length header is set (#4645)
This applies to both the http.Response and the http.Request.
2024-08-30 05:28:06 -07:00
Olivier Poitrey
7c471aac74 http3: implement server idle timeout support (#4587)
* http3: implement server idle timeout support

This update introduces the ability for an HTTP/3 server to enforce an idle
timeout on connections. This timeout will trigger when no new requests are
received on a connection, irrespective of any PING frames received at the
QUIC level.

* fix deadlock when http3 idle timeout is not enabled

* fix typo

* Switch to a more efficient implementation

* Avoid a goroutine
* Avoid constent re-adjusting of a timer
* Works with hijacked streams

* Generalize the idle timeout description

* Add an integration test for http server idle timeout

* Attempt to fix other tests impacted by the new idle timeout test
2024-08-04 15:53:33 -07:00
Marten Seemann
d1f9af4cc6 implement qlog JSONSEQ format, bump qlog version (#4609) 2024-08-03 20:19:51 -07:00
Marten Seemann
f5ceb73171 handshake: generate CRYPTO_ERRORs for internal_error TLS alerts (#4601)
* handshake: generate CRYPTO_ERRORs for internal_error TLS alerts

* remove stray comment
2024-08-03 17:04:03 -07:00
Marten Seemann
8451b0afd7 utils: remove scarcely used time helper functions (#4593) 2024-07-23 14:16:12 -07:00
Marten Seemann
2a082f973a http3: allow re-dialing of connection after a dial error (#4573)
* http3: do not cache dial error

* add an integration test

* http3: add a unit test for dial failures

---------

Co-authored-by: 世界 <i@sekai.icu>
2024-06-22 21:38:49 -07:00
Marten Seemann
b19f2f9e3a metrics: use the default metrics tracer in integration tests (#4562) 2024-06-10 14:58:47 +08:00
Marten Seemann
cc9a5ee744 qlog: rename DefaultTracer to DefaultConnectionTracer (#4556) 2024-06-05 03:50:01 -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