9 Commits

Author SHA1 Message Date
Nicholas S. Husin
7b75446a98 internal/http3: add shutdown support for server
Currently, our HTTP/3 server that has been registered against a net/http
Server will keep running even after the net/http Server has shutdown.

Therefore, add support for shutting down a running HTTP/3 server, and
use it as part of net/http.Server.RegisterOnShutdown.

For golang/go#70914
For golang/go#77440

Change-Id: I5d2acd2cb0fef64ecf5f8d81ae79f3399ed97b00
Reviewed-on: https://go-review.googlesource.com/c/net/+/754580
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
2026-03-26 17:43:53 -07:00
Damien Neil
d1f64cc670 quic: use testing/synctest
Replace bespoke fake time and synchronization with testing/synctest.

Change-Id: Ic3fe9635dbad36c890783c38e00708c6cb7a15f8
Reviewed-on: https://go-review.googlesource.com/c/net/+/714482
Reviewed-by: Nicholas Husin <nsh@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
2025-10-27 13:48:05 -07:00
Damien Neil
dd0b200aed quic: remove go1.21 build constraint
The x/net go.mod now depends on go1.23.

Change-Id: I24960949d84753f84f75fbdc97b7dfb92191a4d2
Reviewed-on: https://go-review.googlesource.com/c/net/+/664295
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
2025-04-09 15:11:44 -07:00
Damien Neil
56691ee141 quic: don't return EOF from ReadByte when we have a byte
Change-Id: I3be7c43fa6ceeb75582f648ee56025991eda9611
Reviewed-on: https://go-review.googlesource.com/c/net/+/642515
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Auto-Submit: Damien Neil <dneil@google.com>
2025-01-13 15:50:21 -08:00
Damien Neil
35e1007cf8 quic, internal/quic/quicwire: split wire encode/decode functions to new package
HTTP/3 also uses QUIC varints. Move the more general-purpose wire
encoding/decoding functions into a new internal/quic/quicwire package
so they can be shared.

For golang/go#70914

Change-Id: Id888baf131e90a12247e15a6f7bc7dc37c6dc572
Reviewed-on: https://go-review.googlesource.com/c/net/+/641496
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-01-09 11:12:58 -08:00
Damien Neil
4428704833 quic: surface connection errors in stream methods
When reading from or writing to a stream associated with a closed
connection, return the connection-level error.

Change-Id: I7f0a4b7f531d06ad1daa46d1942d37bca8ca5698
Reviewed-on: https://go-review.googlesource.com/c/net/+/640797
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-01-07 14:34:38 -08:00
Damien Neil
dc3b8a8dce quic: return error from Stream.Flush
Report errors (stream closed, stream reset) when flushing.

Change-Id: I94b7a35fe874372eb7969aacebc861c5f2e29b3c
Reviewed-on: https://go-review.googlesource.com/c/net/+/640796
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2025-01-07 08:52:09 -08:00
cuishuang
2124140b04 all: make function and struct comments match the names
Change-Id: I1f4a4c8daec5ac7d26f1d4df76726af664adcb36
Reviewed-on: https://go-review.googlesource.com/c/net/+/639576
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Auto-Submit: Damien Neil <dneil@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2025-01-02 13:01:20 -08:00
Damien Neil
fa11427993 quic: move package out of internal
For golang/go#58547

Change-Id: I119d820824f82bfdd236c6826f960d0c934745ca
Reviewed-on: https://go-review.googlesource.com/c/net/+/566295
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2024-02-27 18:30:56 +00:00