Merge pull request #1522 from subbyte/authlog

Improve RTSP server authentication handling and auditing
This commit is contained in:
Alex X
2025-02-18 12:26:54 +03:00
committed by GitHub
3 changed files with 17 additions and 7 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
package rtsp
import (
"errors"
"io"
"net"
"net/url"
@@ -237,7 +238,9 @@ func tcpHandler(conn *rtsp.Conn) {
})
if err := conn.Accept(); err != nil {
if err != io.EOF {
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()
}
if closer != nil {