Commit Graph

6391 Commits

Author SHA1 Message Date
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
34f4d1443f http3: implement on the HTTPStreamer on the ResponseWriter, flush header (#4469)
Currently the HTTPStreamer is implemented on the http.Request.Body. This
complicates usage, since it's not easily possible to flush the HTTP
header, requiring users to manually flash the header before taking over
the stream.

With this change, the HTTP header is now flushed automatically as soon
as HTTPStream is called.
2024-04-27 04:30:39 -07: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
e1e5b6294d README: link to the new documentation site (#4464) 2024-04-26 11:28:49 -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
11b11594b2 http3: fix race condition in client unit test (#4463) 2024-04-26 10:32:03 -07:00
Marten Seemann
4b87539b1e delay completion of the receive stream until the reset error was read (#4460)
* delay completion of the receive stream until the reset error was read

* fix handling of CancelRead after receiving a RESET_STREAM
2024-04-26 08:48:00 -07:00
Marten Seemann
bff131e546 delay completion of the send stream until the reset error was delivered (#4445)
* delay completion of the send stream until the reset error was delivered

* mark the send stream completed on Close after receiving a STOP_SENDING

* fix handling of STOP_SENDING after Close
2024-04-26 08:31:00 -07:00
Marten Seemann
12aa63824c disable GSO and ECN on kernels older than version 5 (#4456) 2024-04-24 07:10:22 -07:00
Marten Seemann
394aa5640d flowcontrol: make it possible to call Abandon multiple times (#4459)
Abandon is called when a RESET_STREAM frame is received, and marks the
bytes between the highest read position and the final offset as
consumed. Making it possible to call Abandon multiple times makes using
this API a bit easier, since the stream doesn't need to track if it
already called it.
2024-04-24 07:06:16 -07:00
Marten Seemann
b0eb608180 testutils: add a token parameter to ComposeInitialPacket (#4391) 2024-04-23 13:43:28 -07:00
bt90
75662469a1 increase send and receive buffer size to 7 MiB (#4455)
This increases throughput on high-bandwidth connections.
7 MB is the value that WireGuard uses, see
f26efb65f2
for details.
2024-04-23 13:28:14 -07:00
Marten Seemann
6a4512a6f0 http3: fix race condition when closing the RoundTripper (#4458) 2024-04-23 13:23:48 -07:00
Marten Seemann
eb1c16bd0e fix flaky server accept queue test (#4453) 2024-04-21 07:33:41 -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
e58fa87566 catch spurious UDP sendmsg errors in multiplex integration test (#4451)
* catch spurious UDP sendmsg errors in multiplex integration test

* platform-dependent isPermissionError
2024-04-20 06:21:24 -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
George
248189d252 http3: don't remove clients on RoundTripOpt context canceled (#4448)
* fix(http3): reuse clients on RoundTripOpt context cancelled

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

* chore(http3): add comment to context canceled check on roundtrip error

---------

Signed-off-by: George MacRorie <me@georgemac.com>
2024-04-20 01:47:34 -07:00
Marten Seemann
e48e1d465d http3: simplify response header writing (#4441) 2024-04-17 09:44:36 -07:00
Marten Seemann
788b6f4409 http3: fix flaky RoundTripper test (#4442) 2024-04-17 09:44:20 -07:00
Marten Seemann
457ac2c4dc http3: move length limiting logic to the body (#4439)
The length limit is a property of the (request and response) body. As
such, it's better implemented there than by wrapping the HTTP stream.
2024-04-17 01:26:45 -07:00
Marten Seemann
29785b29bf http3: simplify tracking of content length (#4438) 2024-04-16 06:35:31 -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
25cd4b5d24 http3: simplify composition of the HTTP stream and request stream (#4433) 2024-04-13 17:18:51 -07:00
Marten Seemann
90627f6f7c http3: simplify buffering of small responses (#4432) 2024-04-13 16:46:19 -07:00
Marten Seemann
857c31dc7c fix documentation for CancelWrite after Close on the send stream (#4419) 2024-04-13 16:36:49 -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
da410a7b59 http3: expose a SingleDestinationRoundTripper (#4424) 2024-04-11 09:55:05 -07:00
Marten Seemann
9efc324637 http3: remove Settingser, StreamCreator, return Connection from Hijacker (#4425) 2024-04-11 08:47:00 -07:00
Marten Seemann
ee698b326f http3: cancel reading on request stream if request processing fails (#4417) 2024-04-09 13:34:00 -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
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
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
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
f389b638d2 http3: reference the correct RFCs in doc comments (#4399) 2024-04-01 15:56:23 -07:00
Marten Seemann
18d6d2934b don't set the Allow0RTT flag for the client in the HTTP integration test (#4397) 2024-03-31 14:45:00 -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
49b9965525 http3: rename RoundTripper.QuicConfig to RoundTripper.QUICConfig (#4385) 2024-03-23 15:29:39 -07:00
Marten Seemann
89020e380a http3: rename Server.QuicConfig to Server.QUICConfig (#4384) 2024-03-23 14:39:34 -07:00
Marten Seemann
a19f99e98b add an integration test for 0-RTT GET requests (#4386) 2024-03-23 14:26:02 -07:00
Marten Seemann
7d902549b7 http3: fix capitalization of Server.SetQUICHeaders (#4377)
Server.SetQuicHeaders is deprecated now, and will be removed at some
point in the future.
2024-03-23 14:24:51 -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
e14dd2fe5b http3: improve documentation for Server.SetQuicHeaders (#4376) 2024-03-21 17:24:37 -07:00
Marten Seemann
6325696fde quicvarint: use int return value instead of internal protocol.ByteCount (#4356) 2024-03-19 14:56:55 -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.
v0.42.0
2024-03-17 17:29:00 -07:00