http3: improve debug message when determining the listener port fails (#4214)

Fixes: #4212
This commit is contained in:
Constantine Shablia 2023-12-19 07:03:28 +02:00 committed by GitHub
parent 5d6bf7e206
commit d3c5f389d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -418,10 +418,11 @@ func (s *Server) addListener(l *QUICEarlyListener) error {
s.listeners = make(map[*QUICEarlyListener]listenerInfo)
}
if port, err := extractPort((*l).Addr().String()); err == nil {
laddr := (*l).Addr()
if port, err := extractPort(laddr.String()); err == nil {
s.listeners[l] = listenerInfo{port}
} else {
s.logger.Errorf("Unable to extract port from listener %+v, will not be announced using SetQuicHeaders: %s", err)
s.logger.Errorf("Unable to extract port from listener %s, will not be announced using SetQuicHeaders: %s", laddr, err)
s.listeners[l] = listenerInfo{}
}
s.generateAltSvcHeader()