mirror of
https://github.com/caddyserver/caddy.git
synced 2025-10-19 07:43:17 +00:00
core: Use KeepAliveConfig to pass keepalive_interval to listener's accepted sockets (#7151)
Fix #7144
This commit is contained in:
parent
5bc2afbbb6
commit
e4447c4ba7
2 changed files with 13 additions and 12 deletions
|
@ -531,7 +531,12 @@ func (app *App) Start() error {
|
|||
|
||||
if h1ok || h2ok && useTLS || h2cok {
|
||||
// create the listener for this socket
|
||||
lnAny, err := listenAddr.Listen(app.ctx, portOffset, net.ListenConfig{KeepAlive: time.Duration(srv.KeepAliveInterval)})
|
||||
lnAny, err := listenAddr.Listen(app.ctx, portOffset, net.ListenConfig{
|
||||
KeepAliveConfig: net.KeepAliveConfig{
|
||||
Enable: srv.KeepAliveInterval != 0,
|
||||
Interval: time.Duration(srv.KeepAliveInterval),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("listening on %s: %v", listenAddr.At(portOffset), err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue