diff options
author | WeidiDeng <[email protected]> | 2024-10-16 08:43:28 +0800 |
---|---|---|
committer | WeidiDeng <[email protected]> | 2024-10-16 08:43:28 +0800 |
commit | ff07c57e5738201cbbd79087d56a61c2976179e3 (patch) | |
tree | 82656be2fedeeb47965b7f2ca73dd15c1cfd2af4 | |
parent | 015e44dddabd180b69609dfbb507ebe6e2e59a59 (diff) | |
download | caddy-ff07c57e5738201cbbd79087d56a61c2976179e3.tar.gz caddy-ff07c57e5738201cbbd79087d56a61c2976179e3.zip |
update from upstreamhttp3-graceful
-rw-r--r-- | modules/caddyhttp/app.go | 10 | ||||
-rw-r--r-- | modules/caddyhttp/server.go | 3 |
2 files changed, 1 insertions, 12 deletions
diff --git a/modules/caddyhttp/app.go b/modules/caddyhttp/app.go index bf14524fe..cd32e72d7 100644 --- a/modules/caddyhttp/app.go +++ b/modules/caddyhttp/app.go @@ -689,15 +689,7 @@ func (app *App) Stop() error { return } - // First close h3server then close listeners unlike stdlib for several reasons: - // 1, udp has only a single socket, once closed, no more data can be read and - // written. In contrast, closing tcp listeners won't affect established connections. - // This have something to do with graceful shutdown when upstream implements it. - // 2, h3server will only close listeners it's registered (quic listeners). Closing - // listener first and these listeners maybe unregistered thus won't be closed. caddy - // distinguishes quic-listener and underlying datagram sockets. - - if err := server.h3server.CloseGracefully(ctx); err != nil { + if err := server.h3server.Shutdown(ctx); err != nil { app.logger.Error("HTTP/3 server shutdown", zap.Error(err), zap.Strings("addresses", server.Listen)) diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go index f18297498..96001c6f9 100644 --- a/modules/caddyhttp/server.go +++ b/modules/caddyhttp/server.go @@ -622,9 +622,6 @@ func (s *Server) serveHTTP3(addr caddy.NetworkAddress, tlsCfg *tls.Config) error Tracer: qlog.DefaultConnectionTracer, }, IdleTimeout: time.Duration(s.IdleTimeout), - ConnContext: func(ctx context.Context, c quic.Connection) context.Context { - return context.WithValue(ctx, quicConnCtxKey, c) - }, } } |