Skip to content

Commit

Permalink
update from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
WeidiDeng committed Oct 16, 2024
1 parent 015e44d commit ff07c57
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
10 changes: 1 addition & 9 deletions modules/caddyhttp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 0 additions & 3 deletions modules/caddyhttp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
}
}

Expand Down

0 comments on commit ff07c57

Please sign in to comment.