mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-26 04:52:00 -08:00
clientrtsp: do not show in logs 'ERR: terminated'
This commit is contained in:
parent
639c42feca
commit
51843fc577
4 changed files with 11 additions and 8 deletions
2
go.mod
2
go.mod
|
|
@ -5,7 +5,7 @@ go 1.15
|
|||
require (
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
|
||||
github.com/aler9/gortsplib v0.0.0-20210508203529-1b9b19dd8493
|
||||
github.com/aler9/gortsplib v0.0.0-20210509121021-994cd442e361
|
||||
github.com/asticode/go-astits v0.0.0-00010101000000-000000000000
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/fsnotify/fsnotify v1.4.9
|
||||
|
|
|
|||
4
go.sum
4
go.sum
|
|
@ -4,8 +4,8 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2c
|
|||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/aler9/go-astits v0.0.0-20210423195926-582b09ed7c04 h1:CXgQLsU4uxWAmsXNOjGLbj0A+0IlRcpZpMgI13fmVwo=
|
||||
github.com/aler9/go-astits v0.0.0-20210423195926-582b09ed7c04/go.mod h1:DkOWmBNQpnr9mv24KfZjq4JawCFX1FCqjLVGvO0DygQ=
|
||||
github.com/aler9/gortsplib v0.0.0-20210508203529-1b9b19dd8493 h1:fyc2te2rF8JIRuft//GORUYH6UYfQCKuiaoEmM0JCEc=
|
||||
github.com/aler9/gortsplib v0.0.0-20210508203529-1b9b19dd8493/go.mod h1:zVCg+TQX445hh1pC5QgAuuBvvXZMWLY1XYz626dGFqY=
|
||||
github.com/aler9/gortsplib v0.0.0-20210509121021-994cd442e361 h1:GZCzLl3MiMCgQdiC+xU+eUqJ2/x8ZKba55TJhzgTNnY=
|
||||
github.com/aler9/gortsplib v0.0.0-20210509121021-994cd442e361/go.mod h1:zVCg+TQX445hh1pC5QgAuuBvvXZMWLY1XYz626dGFqY=
|
||||
github.com/aler9/rtmp v0.0.0-20210403095203-3be4a5535927 h1:95mXJ5fUCYpBRdSOnLAQAdJHHKxxxJrVCiaqDi965YQ=
|
||||
github.com/aler9/rtmp v0.0.0-20210403095203-3be4a5535927/go.mod h1:vzuE21rowz+lT1NGsWbreIvYulgBpCGnQyeTyFblUHc=
|
||||
github.com/asticode/go-astikit v0.20.0 h1:+7N+J4E4lWx2QOkRdOf6DafWJMv6O4RRfgClwQokrH8=
|
||||
|
|
|
|||
|
|
@ -27,6 +27,11 @@ func isTeardownErr(err error) bool {
|
|||
return ok
|
||||
}
|
||||
|
||||
func isTerminatedErr(err error) bool {
|
||||
_, ok := err.(liberrors.ErrServerTerminated)
|
||||
return ok
|
||||
}
|
||||
|
||||
// PathMan is implemented by pathman.PathMan.
|
||||
type PathMan interface {
|
||||
OnReadPublisherDescribe(readpublisher.DescribeReq)
|
||||
|
|
@ -35,7 +40,6 @@ type PathMan interface {
|
|||
// Parent is implemented by serverrtsp.Server.
|
||||
type Parent interface {
|
||||
Log(logger.Level, string, ...interface{})
|
||||
// OnClientClose(*Client)
|
||||
}
|
||||
|
||||
// Client is a RTSP client.
|
||||
|
|
@ -93,7 +97,7 @@ func New(
|
|||
|
||||
// Close closes a Client.
|
||||
func (c *Client) Close(err error) {
|
||||
if err != io.EOF && !isTeardownErr(err) {
|
||||
if err != io.EOF && !isTeardownErr(err) && !isTerminatedErr(err) {
|
||||
c.log(logger.Info, "ERR: %v", err)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -140,11 +140,10 @@ func (s *Session) OnAnnounce(c *clientrtsp.Client, ctx *gortsplib.ServerHandlerO
|
|||
return terr.Response, nil
|
||||
|
||||
case readpublisher.ErrAuthCritical:
|
||||
s.log(logger.Info, "ERR: %v", terr.Message)
|
||||
|
||||
// wait some seconds to stop brute force attacks
|
||||
<-time.After(pauseAfterAuthError)
|
||||
return terr.Response, errTerminated
|
||||
|
||||
return terr.Response, errors.New(terr.Message)
|
||||
|
||||
default:
|
||||
return &base.Response{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue