Code refactoring for RTSP auth

This commit is contained in:
Alex X
2025-02-18 12:01:55 +03:00
parent 9e673559c4
commit 02ac3a6814
3 changed files with 9 additions and 9 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
package rtsp
import (
"errors"
"io"
"net"
"net/url"
@@ -237,7 +238,7 @@ func tcpHandler(conn *rtsp.Conn) {
})
if err := conn.Accept(); err != nil {
if err == rtsp.FailedAuth {
if errors.Is(err, rtsp.FailedAuth) {
log.Warn().Str("remote_addr", conn.Connection.RemoteAddr).Msg("[rtsp] failed authentication")
} else if err != io.EOF {
log.WithLevel(level).Err(err).Caller().Send()