mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-24 02:02:26 -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
|
||||
}
|
||||
|
||||
if h.useTLS {
|
||||
_, isConnectionStater := conn.(connectionStater)
|
||||
// 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")
|
||||
}
|
||||
}
|
||||
|
||||
if _, ok := conn.(connectionStater); ok {
|
||||
} else if isConnectionStater {
|
||||
h.logger.Warn("tls is disabled, but listener wrapper returns a connection that implements connectionStater")
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user