Commit Graph

108 Commits

Author SHA1 Message Date
Marten Seemann
77c401dcbb http3: only retry requests for which it is safe to do so (#5141)
* add an integration test for HTTP/3 redialing logic

* http3: only retry requests for which it is safe to do so
2025-05-16 05:22:13 +02:00
Marten Seemann
3f97a011a7 http3: migrate the client tests away from Ginkgo (#5096)
* http3: migrate the client tests away from Ginkgo

* http3: add a client settings test
2025-05-10 05:24:21 +02:00
Marten Seemann
1d8f3f281a ci: update golangci-lint to v2 (#5007) 2025-03-30 07:16:14 +02: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
588b93c817 http3: add (deprecated) type aliases for RoundTripper and SingleDestinationRoundTripper (#4699)
This will make transitioning to the new types easier.
2024-10-14 00:15:46 -07:00
Marten Seemann
29f903f486 http3: improve documentation for Transport and ClientConn (#4696) 2024-10-13 23:28:23 -07:00
Marten Seemann
0a6e362879 http3: don't expose ClientConn.HandleUnidirectionalStreams (#4695) 2024-10-13 22:45:49 -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
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
5446b5f912 http3: use the connection, not the stream context, on the server side (#4510) 2024-06-03 10:23:35 +08:00
Marten Seemann
a3d36f1cbb http3: reject reserved frame types (#4467) 2024-05-04 15:23:40 -07:00
Marten Seemann
2a37c53143 http3: add support for HTTP Datagrams (RFC 9297) (#4452)
* http3: add support for HTTP Datagrams (RFC 9297)

* README: reference HTTP Datagrams (RFC 9297)
2024-04-26 11:21:04 -07:00
mchtech
86b53a2516 http3: process 1xx status codes (#4437)
* process http 1xx status code

Signed-off-by: mchtech <michu_an@126.com>

* add integration tests

Signed-off-by: mchtech <michu_an@126.com>

* fix tests

---------

Signed-off-by: mchtech <michu_an@126.com>
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2024-04-21 02:56:45 -07:00
Marten Seemann
3e7ba77a77 http3: check server SETTINGS before sending an Extended CONNECT request (#4450) 2024-04-20 06:21:36 -07:00
Marten Seemann
18422ad1c4 http3: remove RoundTripOpt.CheckSettings (#4416)
The settings can be obtained from the SingleDestinationRoundTripper.
2024-04-20 02:42:33 -07:00
Marten Seemann
9bc7bd84cc http3: use a log/slog.Logger for logging (#4449) 2024-04-20 01:59:58 -07:00
Marten Seemann
25cd4b5d24 http3: simplify composition of the HTTP stream and request stream (#4433) 2024-04-13 17:18:51 -07:00
Marten Seemann
da410a7b59 http3: expose a SingleDestinationRoundTripper (#4424) 2024-04-11 09:55:05 -07:00
Marten Seemann
eb310a6db8 http3: expose an OpenStream method on the RoundTripper (#4409)
The stream exposes two methods required for doing an HTTP request:
SendRequestHeader and ReadResponse. This can be used by applications
that wish to use the stream for non-HTTP content afterwards. This will
lead to a simplification in the API we need to expose for WebTransport,
and will make it easier to send HTTP Datagrams associated with this
stream.
2024-04-09 13:14:14 -07:00
Marten Seemann
183d42a729 http3: pass tracing ID instead of quic.Connection to stream hijackers (#4401)
The stream hijackers only need to be able to associate the stream with
the underlying QUIC connection. They are not supposed to call any
functions on the quic.Connection. As such, the better API is to just
pass them a unique identifier.
2024-04-01 21:23:40 -07:00
Marten Seemann
268208fbef http3: refactor the client's and server's unidirectional stream handling (#4387)
The logic is almost identical, so it makes sense to refactor it into
a shared implementation.
2024-03-24 13:52:44 -07:00
Marten Seemann
684b80a23f http3: don't modify any fields of the http.Request when doing 0-RTT (#4379) 2024-03-23 13:58:41 -07:00
Marten Seemann
603e07779a http3: make it possible to send HEAD requests in 0-RTT (#4378) 2024-03-23 08:24:09 +10:00
Marten Seemann
497d3f58a5 http3: add a RoundTripOpt to check the server's SETTINGS frame (#4355)
For some requests, the client is required to check the server's HTTP/3
SETTINGS. For example, a client is only allowed to send HTTP/3 datagrams
if the server explicitly enabled support.

SETTINGS are sent asynchronously on a control stream (usually the first
unidirectional stream). This means that the SETTINGS might not be
available at the beginning of the connection. This is not expected to be
the common case, since the server can send the SETTINGS in 0.5-RTT data,
but we have to be able to deal with arbitrary delays.

For WebTransport, there are even more SETTINGS values that the client
needs to check. By making CheckSettings a callback on the RoundTripOpt,
this entire validation logic can live at the WebTransport layer.
2024-03-12 01:03:00 -07:00
Marten Seemann
c5f7096f00 http3: reject duplicate control streams opened by the server (#4342) 2024-03-02 23:28:24 -08:00
Marten Seemann
0405634108 http3: don't automatically set RoundTripper.QuicConfig.EnableDatagrams (#4340)
If the user provides a quic.Config, we shouldn't modify it. Instead, we
should return an error if the user enables HTTP Datagrams but fails to
enable datagrams on the QUIC layer.
2024-03-02 22:39:21 -08:00
Marten Seemann
fbaa941ea1 protocol: rename VersionNumber to Version (#4295) 2024-01-31 21:57:33 -08:00
Marten Seemann
2243fdefbf http3: return the context cancellation error from RoundTrip (#4203) 2023-12-20 20:16:30 -08:00
Marten Seemann
d8cc4cb3ef http3: introduce an HTTP/3 error type (#4039)
* http3: introduce an HTTP/3 error type

* http3: use a pointer receiver for the Error
2023-09-16 04:57:50 -07:00
roc
32f8b20ae5 http3: fix check for content length of the response (#3998)
* fix: check response content-length other than request content-length

* Update http3/client.go

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2023-07-28 21:18:26 -07:00
Marten Seemann
5a22ac8970 http3: enforce that DATA frames don't exceed Content-Length (#3980) 2023-07-20 09:47:01 -07:00
Marten Seemann
bb296b8c17 http3: unify handling of request and response headers (#3969) 2023-07-18 21:39:05 -07:00
Marten Seemann
3dea8f8a9b http3: don't send more than http.Request.ContentLength bytes (#3960) 2023-07-16 19:16:52 -07:00
Marten Seemann
3d89e545d3 use the new crypto/tls QUIC Transport (#3860) 2023-07-01 11:15:00 -07:00
Glonee
21549fcb4a http3: set tls.Config.ServerName for outgoing requests, if unset (#3867)
* fix #3865

* add test case

* Update http3/client, client_test.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2023-05-31 22:45:56 -07:00
Marten Seemann
aee7706d5d clean up dial functions
* add a context to all Dial functions
* remove the explicit Dial{*}Context functions
2023-05-01 13:59:54 +02:00
Marten Seemann
2b0a03a988 set the QUIC version for integration tests using a command line flag 2023-05-01 13:43:34 +02:00
Marten Seemann
1f57d4e789 protocol: remove VersionTLS, used during the gQUIC -> TLS 1.3 transition (#3764) 2023-04-19 07:24:34 -07:00
Jean-Francois Giorgi
af517bdef1 http3: make error codes public and consistent with http2 package (#3744)
* make http3 error codes public and consistent with http2 package

* typo on ErrNoError

* renaming of ErrCode values
2023-04-07 21:53:14 -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
e0d4ffffef http3: fix race condition when accessing the client's connection (#3696)
* http3: fix race condition when accessing the client's connection

* add an integration test for concurrent HTTP requests

---------

Co-authored-by: Bulat Khasanov <afti@yandex.ru>
2023-02-13 14:54:09 -08:00
Marten Seemann
89769f409f http3: correctly handle closed clients (#3684)
* http3: use a mock roundTripCloser in tests

* http3: correctly handle failed clients

Specifically,
* immediately remove a client when a request errored
* if that error was an idle error, and the client was a reused client
(from an earlier request that already completed the handshake),
re-dial the connection
2023-01-28 00:49:52 -08:00
Avi Rosenberg
7b2c69451e http3: change status codes to const (#3683)
Signed-off-by: Avi Rosenberg <avrumi96@gmail.com>
2023-01-27 14:40:59 -08: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
9488539a49 update imports to use qtls and qpack from quic-go GitHub organization (#3676) 2023-01-20 13:42:54 -08:00
David Brouwer
047f9b6ffa http3: add request to response (#3608) 2022-11-02 13:39:34 -07:00
Marten Seemann
424a66389c http3: fix double close of chan when using DontCloseRequestStream (#3561) 2022-09-23 03:10:25 -07:00
Marten Seemann
62b82789c0 http3: reduce usage of bytes.Buffer (#3539) 2022-09-01 06:39:21 -07:00
Marten Seemann
61ca8e89fe http3: ignore context after response when using DontCloseRequestStream (#3473) 2022-07-24 11:58:12 -07:00
Nuno Diegues
4c96cf75bf make the keep alive interval configurable (#3444)
* Make keep alive configurable

* Fix unit tests
2022-06-09 08:31:37 -07:00