mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-30 19:55:04 -04:00
check if connection implements connectionStater when it should
This commit is contained in:
parent
c537d9bc5c
commit
ff4aae6098
@ -36,14 +36,11 @@ func (h *http2Listener) Accept() (net.Conn, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if h.useTLS {
|
_, isConnectionStater := conn.(connectionStater)
|
||||||
// emit a warning
|
// emit a warning
|
||||||
if _, ok := conn.(connectionStater); !ok {
|
if h.useTLS && !isConnectionStater {
|
||||||
h.logger.Warn("tls is enabled, but listener wrapper returns a connection that doesn't implement connectionStater")
|
h.logger.Warn("tls is enabled, but listener wrapper returns a connection that doesn't implement connectionStater")
|
||||||
}
|
} else if isConnectionStater {
|
||||||
}
|
|
||||||
|
|
||||||
if _, ok := conn.(connectionStater); ok {
|
|
||||||
h.logger.Warn("tls is disabled, but listener wrapper returns a connection that implements connectionStater")
|
h.logger.Warn("tls is disabled, but listener wrapper returns a connection that implements connectionStater")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user