Commit Graph

38 Commits

Author SHA1 Message Date
Marten Seemann
ca05442ab9 http3: add basic server-side qlog support (#5367)
* add Conn.QlogTrace

* http3: add basic qlog support on the server side
2025-10-10 12:35:58 +02:00
Robin Thellend
0a9c6ea4c8 http3: remove dependency on quic internal packages (#5256)
* Remove http3 dependency on quic internal packages

Remove the dependency on internal/protocol from the http3 package. This
makes it possible for a forked http3 to use the mainline quic-go
package.

* Address review comments

* Fix syntax

* Use broader pattern for http3 directory

* Copy internal/testdata

* Replace perspective with bool

* clone the supported version slice

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2025-07-07 13:41:23 +02:00
Marten Seemann
7d5e0570c4 http3: avoid reinitilising the frame parser on the stream (#5232)
No functional change expected.
2025-06-20 07:34:03 +02:00
Marten Seemann
6c82ac07cf http3: convert Connection interface to Conn struct (#5204) 2025-06-09 12:16:07 +02:00
Marten Seemann
5f3d617dec convert Connection interface to Conn struct (#5195) 2025-06-09 11:51:46 +02:00
Marten Seemann
9580396fa1 http3: simplify connection closing in the frame parser (#5196)
No functional change expected.
2025-06-07 07:21:53 +02:00
Marten Seemann
1169d97e81 convert ReceiveStream interface to a struct (#5173) 2025-06-01 06:08:18 +02:00
Marten Seemann
78e77bcfdb convert SendStream to a struct (#5172) 2025-06-01 05:53:53 +02:00
Marten Seemann
eb656df2fe convert Stream interface to a struct (#5149) 2025-06-01 05:40:05 +02:00
Marten Seemann
5c3af443c1 http3: simplify HTTP datagram handling (#5156) 2025-05-29 06:23:05 +02:00
Marten Seemann
2675d0845f http3: convert RequestStream from an interface to a struct (#5153) 2025-05-29 05:08:39 +02:00
Marten Seemann
04eab22893 http3: fix off-by-one error when processing the GOAWAY stream ID (#5145) 2025-05-20 08:43:33 +02:00
Marten Seemann
363e0ccafb http3: implement client-side GOAWAY handling (#5143)
When receiving a GOAWAY frame, the client:
* immediately closes the connection if there are no active requests
* refuses to open streams with stream IDs larger than the stream ID in
the GOAWAY frame
* closes the connection once the stream count drops to zero
2025-05-18 07:33:43 +02:00
Marten Seemann
6f8460a821 http3: keep datagram receive loop running on datagram for unknown stream (#5136) 2025-05-10 14:41:47 +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
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
920bfb46af http3: reject pseudo header fields in trailers (#4639)
* http3: reject pseudo header fields in trailers

As defined in section 4.3 of RFC 9114.

* http3: improve allocs for trailer map

* http3: rename connection.parseTrailer to decodeTrailers
2024-08-23 03:42:18 -07:00
Kevin McDonald
17fb3b96ba http3: add client-side HTTP Trailer support (#4581)
* http3: add HTTP Trailer support for clients

This change only adds support to read HTTP trailers sent to clients.

* chore: add protection against some out-of-spec behavior + tests

* chore: re-add test accidentally overwtitten

* chore: empty commit to re-trigger ci

* fix: address some review notes (wip)

* fix: simplify code in stream.Read by using a callback from requestStream.ReadResponse

* restructure where trailers are read and parsed

* WIP simplify trailer parsing design

* chore: refactor to use simpler trailer parsing strategy

* make gofumpt happy

* Update http3/headers.go

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

* remove stray TODO

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2024-08-22 22:25:58 -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
George
e2fbf3cdcd http3: fix memory leak in stream state tracking (#4523)
* fix(http3): handle streamStateSendAndReceiveClosed in onStreamStateChange

Signed-off-by: George MacRorie <me@georgemac.com>

* refactor(http3): adjust stateTrackingStream to operate over streamClearer and errorSetter

* test(http3): remove duplicate test case

* chore(http3): rename test spies to be mocks

---------

Signed-off-by: George MacRorie <me@georgemac.com>
2024-05-18 19:15:32 -07:00
Marten Seemann
5aac43549b http3: fix race condition when creating state tracking stream (#4493) 2024-05-05 06:34:55 -07:00
Marten Seemann
a3d36f1cbb http3: reject reserved frame types (#4467) 2024-05-04 15:23:40 -07:00
Marten Seemann
3122ca009b http3: avoid allocation when parsing the datagram's quarter stream ID (#4478) 2024-05-03 20:13:38 +08:00
Marten Seemann
083ceb42f2 http3: rename Settings.EnableDatagram to EnableDatagrams (#4466)
This makes it consistent with the quic.Config and the config flag on the
http3.Server and http3.RoundTripper.
2024-04-26 13:35:21 -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
Marten Seemann
9bc7bd84cc http3: use a log/slog.Logger for logging (#4449) 2024-04-20 01:59:58 -07:00
Marten Seemann
afd0b061d5 http3: remove Accept(Uni)Stream methods from the Connection interface (#4435)
Incoming streams are hijacked, not accepted.
2024-04-14 08:37:01 -07:00
Marten Seemann
b096e94092 http3: hide SendDatagram and ReceiveDatagram on the Connection (#4427)
HTTP datagrams are bound to streams. It shouldn't be possible to send
datagrams on the http3.Connection.
2024-04-11 14:13:34 -07:00
Marten Seemann
9efc324637 http3: remove Settingser, StreamCreator, return Connection from Hijacker (#4425) 2024-04-11 08:47:00 -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
97d31dad39 http3: introduce a Settingser to query the client's SETTINGS (#4389)
The http.Request.Body can be type-asserted to a http3.Settingser. The
Settings method on this interface blocks until the client's SETTINGS
frame has been received.
2024-03-31 14:44:42 -07:00
Marten Seemann
d540f545b0 http3: reject duplicate QPACK decoder and encoder streams (#4388) 2024-03-24 14:17:11 -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
b5ef99a32c remove stray http3 connection file
This was accidentally commited in #3411.
2022-05-29 11:26:00 +02:00
Marten Seemann
de5f08171b introduce a http3.RoundTripOpt to prevent closing of request stream (#3411) 2022-05-20 02:54:31 -07:00