731 Commits

Author SHA1 Message Date
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
1a25053e5e update qpack to v0.5.0 (#4653)
No features were added in v0.5.0, nor were any bugs fixed.
No functional change expected.
2024-08-31 19:58:51 -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
Marten Seemann
d067fe4156 bump Go version in go.mod, stop testing on Go 1.21 (#4633)
* bump Go version in go.mod, stop testing on Go 1.21

* ci: update golangci-lint to v1.60.1

* ignore Go 1.23 0-RTT events in exhaustive linter
2024-08-17 00:30:03 -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
f96923b5b2 logging: rename VersionNumber to Version (#4621) 2024-08-03 19:32:11 -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
5f8d146836 wire: optimize parsing of long header packets (#4589) 2024-07-21 14:22:32 -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
Marten Seemann
0db354456a make Path MTU Discovery resilient to random packet loss (#4545) 2024-06-04 02:10:11 -07:00
Marten Seemann
e66a925d64 metrics: add a basic setup, collect metrics for the server 2024-06-04 13:19:29 +08:00
Marten Seemann
459a6f3df9 fix the server's 0-RTT rejection logic when using GetConfigForClient (#4550) 2024-06-03 03:42:58 -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
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
056a332ac4 retry the PMTUD integration test up to 3 times (#4519)
This test is very sensitive to packet loss, as the loss of a single Path MTU
probe packet makes DPLPMTUD clip the assumed MTU at that value.
2024-05-14 02:14:02 -07:00
Marten Seemann
508b402a19 update all golang.org/x dependencies (#4506) 2024-05-10 20:02:07 -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
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
f1b473d925 add an integration test for DPLPMTUD (#4498)
* add an integration test for DPLPMTUD

* use a v4-only socket in DPLPMTUD test

* increase DPLPMTUD test timeout
2024-05-06 22:15:20 -07:00
Marten Seemann
4f4da0423f ci: disable exhaustive linter for test files (#4499) 2024-05-06 21:36:22 -07:00
Marten Seemann
83eeb9cc66 fix incorrect reuse of UDP connection in handshake benchmark (#4491) 2024-05-05 06:17:08 -07:00
Marten Seemann
bb6f066aa5 http3: use the stream context to detect when the send side is closed (#4489) 2024-05-04 19:15:35 -07:00
Marten Seemann
c7b58b568f http3: refuse to send datagrams associated with a closed stream (#4488)
It's only valid to send datagrams associated with a stream whose send
direction is not closed.
2024-05-04 17:48:07 -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
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
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
b0eb608180 testutils: add a token parameter to ComposeInitialPacket (#4391) 2024-04-23 13:43:28 -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
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
90627f6f7c http3: simplify buffering of small responses (#4432) 2024-04-13 16:46:19 -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
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
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
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