Commit Graph

89 Commits

Author SHA1 Message Date
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
Marten Seemann
04d46526c7 refactor HTTP/3 stream handling to use a dedicated stream
Reading from and writing onto this stream applies HTTP/3 DATA framing.
2022-06-09 10:51:23 +02:00
Aaron Riekenberg
990b1fed38 Change "HTTP/3" to "HTTP/3.0". (#3439) 2022-06-02 10:33:06 -07:00
Marten Seemann
96c0daceca pass frame / stream type parsing errors to the hijacker callbacks
When a stream is reset, we might not have received the frame / stream
type yet. The callback might be able to identify if it was a stream
intended for that application by analyzing the stream reset error.
2022-05-27 17:53:54 +02:00
Marten Seemann
de5f08171b introduce a http3.RoundTripOpt to prevent closing of request stream (#3411) 2022-05-20 02:54:31 -07:00
hareku
1a0d577854 implement HTTP/3 unidirectional stream hijacking (#3389)
* implement HTTP/3 unistream hijacking

* Apply suggestions from code review

Fixed name consistency.

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

* rename unistream to unidirectional stream

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2022-04-21 09:51:18 -07:00
Marten Seemann
a983db0301 pass the connection to the client's StreamHijacker callback 2022-04-03 14:28:15 +01:00
Marten Seemann
9c8cdeda57 allow HTTP clients to set the number of incoming streams in quic.Config 2022-04-03 14:28:15 +01:00
Marten Seemann
48a2cce9df implement HTTP/3 stream hijacking 2022-04-03 14:28:15 +01:00
Marten Seemann
a54816867f make it possible to set settings unknown to the http3 package 2022-04-03 14:28:15 +01:00
Marten Seemann
57461e01b5 add a http3.Hijacker that allows stream creation on a QUIC session from a http.Response.Body 2022-04-03 14:28:15 +01:00
Marten Seemann
332473668a remove unneeded network from custom dial function used in HTTP/3 (#3368) 2022-04-03 06:27:55 -07:00
Marten Seemann
f68b38635a rename occurrences of session in HTTP/3 server and client 2022-03-27 11:27:25 +01:00
Marten Seemann
6aaa9a817c rename the EarlySession to EarlyConnection 2022-03-27 11:27:25 +01:00
Marten Seemann
d3fab2a230 also the context when dialing an address 2022-03-25 10:11:55 +01:00
Marten Seemann
137491916b respect the request context when dialing 2022-03-25 09:47:05 +01:00
Randy Reddig
346bd63a60 quicvarint: add Reader and Writer interfaces (#3233) 2021-08-05 10:49:17 -07:00
Marten Seemann
90727cb41a introduce a quic.StreamError type and use it for stream cancelations 2021-05-01 09:39:52 +07:00
Marten Seemann
42b61729bd expose the TransportError and the ApplicationError 2021-05-01 09:38:49 +07:00
Marten Seemann
29f02e1bda set the Content-Length for HTTP/3 responses 2021-03-15 13:09:09 +08:00