diff --git a/internal/core/path.go b/internal/core/path.go index fb0508b2..068fb282 100644 --- a/internal/core/path.go +++ b/internal/core/path.go @@ -39,7 +39,8 @@ func (e pathErrNoOnePublishing) Error() string { } type pathErrAuthNotCritical struct { - *base.Response + Message string + Response *base.Response } // Error implements the error interface. diff --git a/internal/core/rtsp_conn.go b/internal/core/rtsp_conn.go index daede0d7..34092842 100644 --- a/internal/core/rtsp_conn.go +++ b/internal/core/rtsp_conn.go @@ -147,6 +147,7 @@ func (c *rtspConn) authenticate( v := "IPCAM" return pathErrAuthNotCritical{ + Message: "unauthorized: " + err.Error(), Response: &base.Response{ StatusCode: base.StatusUnauthorized, Header: base.Header{ @@ -253,6 +254,7 @@ func (c *rtspConn) onDescribe(ctx *gortsplib.ServerHandlerOnDescribeCtx, if res.Err != nil { switch terr := res.Err.(type) { case pathErrAuthNotCritical: + c.log(logger.Debug, "non-critical authentication error: %s", terr.Message) return terr.Response, nil, nil case pathErrAuthCritical: diff --git a/internal/core/rtsp_session.go b/internal/core/rtsp_session.go index c0c4e2c0..43f77a68 100644 --- a/internal/core/rtsp_session.go +++ b/internal/core/rtsp_session.go @@ -168,6 +168,7 @@ func (s *rtspSession) onAnnounce(c *rtspConn, ctx *gortsplib.ServerHandlerOnAnno if res.Err != nil { switch terr := res.Err.(type) { case pathErrAuthNotCritical: + s.log(logger.Debug, "non-critical authentication error: %s", terr.Message) return terr.Response, nil case pathErrAuthCritical: @@ -226,6 +227,7 @@ func (s *rtspSession) onSetup(c *rtspConn, ctx *gortsplib.ServerHandlerOnSetupCt if res.Err != nil { switch terr := res.Err.(type) { case pathErrAuthNotCritical: + s.log(logger.Debug, "non-critical authentication error: %s", terr.Message) return terr.Response, nil, nil case pathErrAuthCritical: