Commit Graph

6423 Commits

Author SHA1 Message Date
Marten Seemann
a2cf43d75c remove the RequireAddressValidation callback from the Config (#4253) 2024-01-22 21:24:07 -08:00
Marten Seemann
892851eb8c add Transport config options to limit the number of handshakes (#4248)
* add Transport config options to limit the number of handshakes

* fix accounting for failed handshakes

* increase handshake limits, improve documentation
2024-01-22 21:04:25 -08:00
putyWang
bda5b7e6dc handshake: fix documentation for updatableAEAD.SetWriteKey (#4256) 2024-01-22 19:30:50 -08:00
Marten Seemann
4407c60f04 handshake: unexport Set{Read,Write}Key methods on the cryptoSetup (#4254)
No functional change expected.
These methods were exported since they were passed to the old qtls API.
2024-01-19 20:44:09 -08:00
Marten Seemann
594440b04c don't remove closed connections from the server's accept queue (#4245) 2024-01-18 22:45:38 -08:00
Marten Seemann
cb1775a08a send out the CONNECTION_REFUSED error when refusing a connection (#4250)
So far, we used Connection.destroy, which destroys a connection without
sending out a CONNECTION_CLOSE frame. This is useful (for example) when
receiving a stateless reset, but it's not what we want when the server
refuses an incoming connection. In this case, we want to send out a
packet with a CONNECTION_CLOSE frame to inform the client that the
connection attempt is being rejected.
2024-01-18 22:29:22 -08:00
Marten Seemann
b3eb375bc1 remove shutdown method on the Connection (#4249)
There's no need to have a dedicated shutdown method, as the use case
(shutting down an outgoing connection attempt on context cancellation)
can be achieved by using Connection.destroy.
2024-01-18 22:06:04 -08:00
Marten Seemann
d3c2020ecd http3: add a basic README (#4246) v0.41.0 2024-01-16 19:34:10 -08:00
Marten Seemann
3449ace5a6 example: remove -qlog flag in favor of QLOGDIR (#4243) 2024-01-13 18:30:59 -08:00
Marten Seemann
13327521a5 example: remove -v flag and custom logger configuration (#4242)
Users can adjust the log level using the QUIC_GO_LOG_LEVEL environment
variable. This is more representative of how quic-go would actually be
used, since the logger is part of an internal package.
2024-01-13 01:59:58 -08:00
Benedikt Spies
2cd9ed38f1 qlog: add a default tracer that writes to QLOGDIR (#4233)
* add qlog default tracer which writes to QLOGDIR

* gofumpt

* add qlog default tracer which writes to QLOGDIR

* fix flaky tests

* Update README.md

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

* Update README.md

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

* Update README.md

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

* Update README.md

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

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2024-01-12 03:11:53 -08:00
Marten Seemann
1e874896cd wire: improve logging of connection ID retirements (#4241) 2024-01-10 21:53:25 -08:00
Marten Seemann
0a922b4e7d example: add config flag for TLS key and cert for the server (#4237) 2024-01-05 02:21:42 -08:00
Robin Thellend
3ff50295ce http3: add ConnContext to the server (#4230)
* Add ConnContext to http3.Server

ConnContext can be used to modify the context used by a new http
Request.

* Make linter happy

* Add nil check and integration test

* Add the ServerContextKey check to the ConnContext func

* Update integrationtests/self/http_test.go

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

* Update http3/server.go

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

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2024-01-04 19:13:53 -08:00
Marten Seemann
f1b3bdbcb0 fix race condition when dropping Initial packet with short connection ID (#4236) 2024-01-04 18:59:39 -08:00
Marten Seemann
54d6f7dc51 ackhandler: refactor ACK queueing logic (#4225)
Once an ACK has been queued, there's no need to check futher conditions that
would lead to queueing of an ACK.
2024-01-03 18:39:09 -08:00
Marten Seemann
8cad3d2ea5 wire: use netip.AddrPort to encode the IPs in the Preferred Address (#4232) 2024-01-02 21:56:25 -08:00
Marten Seemann
59ed51704a README: add RoadRunner to list of projects (#4226) 2024-01-02 21:32:58 -08:00
Marten Seemann
1083d1fb8f handshake: remove unneeded mutex in cryptoSetup (#4227) 2024-01-01 23:52:08 -08:00
Marten Seemann
22b7f7744e use a ring buffer for the datagram queue (#4223) 2023-12-31 20:50:26 -08:00
Marten Seemann
1fce81f8bb queue up to 32 DATAGRAM frames to send (#4222) 2023-12-31 19:58:41 -08:00
Marten Seemann
7f080dd54b discard DATAGRAM frames that don't fit into packets without an ACK (#4221)
If the packet doesn't contain an ACK (i.e. the payload is empty),
there's no point retrying to pack it later. It's extremely unlikely that
the available packet size will suddenly increase.
2023-12-31 19:17:25 -08:00
Marten Seemann
d6e3f3229f qtls: remove unneeded type alias for the tls.QUICEncryptionLevel (#4220)
* qtls: remove unneeded type alias for the tls.QUICEncryptionLevel

* handshake: make cryptoSetup.WriteRecord private
2023-12-28 18:59:56 -08:00
Vladimir Varankin
a937959fbf http3: fix channel size in ListenAndServe (#4219)
* http3: typo in ListenAndServe docs

Also, partially prevent a goroutine leak on an error from one of the
listeners.

* http3: improve documentation for ListenAndServe

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2023-12-28 18:35:46 -08:00
Marten Seemann
22411e16d5 utils: switch to standard library min and max functions (#4218)
These functions were added in Go 1.21.
2023-12-27 21:19:13 -08:00
Marten Seemann
18c591c75a utils: use time.Duration.Abs (#4217)
This function was added in Go 1.19, and covers some corner cases that
our custom implementation didn't.
2023-12-27 20:49:47 -08:00
Marten Seemann
d795250479 drop support for Go 1.20, build on Go 1.22rc1 on CI (#4195)
* drop support for Go 1.20

* ci: udpate CircleCI to Go 1.21

* qtls: remove unnecessary type aliases

* ci: build using Go 1.22rc1
2023-12-27 20:31:58 -08:00
Benedikt Spies
31a677cacd qlog: add support for alpn_information event (#4216)
* qlog chosen alpn

* qlog chosen alpn

* qlog: fix capitalization of ALPN

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2023-12-25 21:02:47 -08:00
Marten Seemann
2243fdefbf http3: return the context cancellation error from RoundTrip (#4203) 2023-12-20 20:16:30 -08:00
Constantine Shablia
d3c5f389d4 http3: improve debug message when determining the listener port fails (#4214)
Fixes: #4212
2023-12-18 21:03:28 -08:00
Constantine Shablia
5d6bf7e206 http3: don't use error string as a format string in debug log message (#4211)
Fixes: #4209
2023-12-18 19:27:07 -08:00
WeidiDeng
e0bf13be01 http3: reset stream when a handler panics (#4181)
* interrupt the stream when a panick happened

* move the declaration of errPanicked

* check what's read is a prefix of what's written

* check errPanicked

* use MatchError instead of Equal

* use channel to notify the response has been received
2023-12-15 19:39:49 -08:00
Dominik Roos
06c6a8449b http3: add remote address to request context (#4208)
* http3: add remote address to request context

Add the remote address of the underlying packet connection to the
HTTP request context. This is useful for applications that need access
to the actual remote address (wrapped in a net.Addr) rather than just
its string representation.

Fixes #4198

* add an integration test to the self test suite.

I was not sure how deep we want to go to assure the right value is set.
For now, it asserts that a net.Addr is present in the context.

Due to the dynamic nature of the requests, it is a bit harder to know
exactly how the remote address will look like. IPv4 vs IPv6, random high
port. I think it is fine to only assert that the value is present.
2023-12-15 19:29:41 -08:00
Marten Seemann
6ffb9054a2 fuzzing: add frame validation logic (#4206) 2023-12-13 23:09:02 -08:00
Marten Seemann
048940927c ci: update golangci-lint to v1.55.2 (#4204) 2023-12-13 04:02:06 -08:00
Marten Seemann
ff6d575ee3 don't retransmit PATH_CHALLENGE and PATH_RESPONSE frames (#4200) 2023-12-12 20:22:13 -08:00
Marten Seemann
574dc84c0c limit the number of queued PATH_RESPONSE frames to 256 (#4199) 2023-12-12 20:17:09 -08:00
Marten Seemann
a7a66f6437 integrationtests: remove leftover code for Go 1.19 (#4193) 2023-12-10 03:00:26 -08:00
Marten Seemann
659da8ca08 fuzzing: update Go version used on OSS-Fuzz to 1.21 (#4192) 2023-12-09 09:20:09 -08:00
fengyun.rui
f162b948db examples: close listener, connection and stream in echo client and server (#4188)
* fix: add close func in example

Signed-off-by: rfyiamcool <rfyiamcool@163.com>

* fix: add close func in example

Signed-off-by: rfyiamcool <rfyiamcool@163.com>

* fix: add close func in example

Signed-off-by: rfyiamcool <rfyiamcool@163.com>

---------

Signed-off-by: rfyiamcool <rfyiamcool@163.com>
2023-12-09 09:05:31 -08:00
Marten Seemann
d234d62d52 qtls: only attempt 0-RTT resumption for 0-RTT enabled session tickets (#4183) 2023-12-09 06:17:47 -08:00
Charles Xu
38eafe4ad8 README: add gost project (#4154)
* chore: add project

* fix name

* revert unrelated whitespace fix

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2023-12-06 19:18:33 -08:00
Marten Seemann
9b40c50a73 http3: use the AdditionalSettings for requests (#4156) 2023-12-06 06:22:23 -08:00
Benedikt Spies
45922f76d6 reduce calls to time.Now() calls in connection (#4191) 2023-12-06 06:00:58 -08:00
Marten Seemann
87ef8ec48d fuzzing: add transport parameter validation logic (#4175) 2023-12-03 05:53:36 -08:00
chungthuang
7b9d21fbe6 send large max_datagram_frame size, introduce a DatagramTooLargeError error (#4143)
The size can be overwritten to a lower value for testing.
2023-12-02 06:27:15 -08:00
Marten Seemann
2d7ea37672 wire: reject NEW_CONNECTION_ID frames with zero-length conneciton IDs (#4180) 2023-11-23 02:41:12 -08:00
Marten Seemann
771d136fa9 interop: update Go version to 1.21.4 (#4179) 2023-11-22 20:30:26 -08:00
Marten Seemann
3bf2e19d0d logging: pass the packet number to ConnectionTracer.DroppedPacket (#4171)
In most cases the packet number is not known when a packet is dropped,
but it's useful to log the packet number when dropping a duplicate
packet.
2023-11-17 04:11:16 -08:00
Marten Seemann
96ab48eb7d fix serialization of connection ID in filenames of qlog files (#4170) 2023-11-16 22:06:42 -08:00