diff options
author | WeidiDeng <[email protected]> | 2024-03-29 14:43:31 +0800 |
---|---|---|
committer | WeidiDeng <[email protected]> | 2024-03-29 14:43:31 +0800 |
commit | 6f351a1c59d66e18091103e833605d664ebcf2d2 (patch) | |
tree | b1047e7336764136d251a24ebb77c5bd09b29bc2 | |
parent | d794ab45e24b309f5008b07117e35f78da767425 (diff) | |
download | caddy-close-h3-connections.tar.gz caddy-close-h3-connections.zip |
add comment about CloseGracefullyclose-h3-connections
-rw-r--r-- | modules/caddyhttp/server.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go index ad807d520..c7e5a5f61 100644 --- a/modules/caddyhttp/server.go +++ b/modules/caddyhttp/server.go @@ -567,10 +567,12 @@ func (s *Server) serveHTTP3(addr caddy.NetworkAddress, tlsCfg *tls.Config) error // create HTTP/3 server if not done already if s.h3server == nil { - // Currently when closing a http3.Server, only listeners are closed. But caddy reuses these listeners - // if possible, requests are still read and handled by the old handler. Close these connections manually. - // see issue: https://github.com/caddyserver/caddy/issues/6195 s.h3server = &http3.Server{ + // Currently when closing a http3.Server, only listeners are closed. But caddy reuses these listeners + // if possible, requests are still read and handled by the old handler. Close these connections manually. + // see issue: https://github.com/caddyserver/caddy/issues/6195 + // Will interrupt ongoing requests. + // TODO: remove the handler wrap after http3.Server.CloseGracefully is implemented, see App.Stop Handler: http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { select { case <-s.ctx.Done(): |