mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-04 23:32:44 +08:00
update gortsplib
This commit is contained in:
2
go.mod
2
go.mod
@@ -4,7 +4,7 @@ go 1.17
|
||||
|
||||
require (
|
||||
code.cloudfoundry.org/bytefmt v0.0.0-20211005130812-5bb3c17173e5
|
||||
github.com/aler9/gortsplib v0.0.0-20220219205627-d7f6567e206a
|
||||
github.com/aler9/gortsplib v0.0.0-20220219215154-bc9be686d962
|
||||
github.com/asticode/go-astits v1.10.0
|
||||
github.com/fsnotify/fsnotify v1.4.9
|
||||
github.com/gin-gonic/gin v1.7.2
|
||||
|
4
go.sum
4
go.sum
@@ -4,8 +4,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafo
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/aler9/gortsplib v0.0.0-20220219205627-d7f6567e206a h1:RhtGuPqHdqNXGs9k0E4U1vGE9NGzkJriF9PSVJtvVm4=
|
||||
github.com/aler9/gortsplib v0.0.0-20220219205627-d7f6567e206a/go.mod h1:mst8cTkmxLn8Osiug8HBjMsNFRt0u7QHt5phJQ1tFVw=
|
||||
github.com/aler9/gortsplib v0.0.0-20220219215154-bc9be686d962 h1:2vgs2fJAYbaoE6dsXJDh8tVYFWDKLu3lElFYRendxBI=
|
||||
github.com/aler9/gortsplib v0.0.0-20220219215154-bc9be686d962/go.mod h1:mst8cTkmxLn8Osiug8HBjMsNFRt0u7QHt5phJQ1tFVw=
|
||||
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=
|
||||
|
@@ -244,12 +244,12 @@ func (c *rtspConn) onDescribe(ctx *gortsplib.ServerHandlerOnDescribeCtx,
|
||||
) (*base.Response, *gortsplib.ServerStream, error) {
|
||||
res := c.pathManager.onDescribe(pathDescribeReq{
|
||||
pathName: ctx.Path,
|
||||
url: ctx.Req.URL,
|
||||
url: ctx.Request.URL,
|
||||
authenticate: func(
|
||||
pathIPs []interface{},
|
||||
pathUser conf.Credential,
|
||||
pathPass conf.Credential) error {
|
||||
return c.authenticate(ctx.Path, pathIPs, pathUser, pathPass, "read", ctx.Req, ctx.Query)
|
||||
return c.authenticate(ctx.Path, pathIPs, pathUser, pathPass, "read", ctx.Request, ctx.Query)
|
||||
},
|
||||
})
|
||||
|
||||
|
@@ -134,7 +134,7 @@ func (s *rtspSession) onAnnounce(c *rtspConn, ctx *gortsplib.ServerHandlerOnAnno
|
||||
pathIPs []interface{},
|
||||
pathUser conf.Credential,
|
||||
pathPass conf.Credential) error {
|
||||
return c.authenticate(ctx.Path, pathIPs, pathUser, pathPass, "publish", ctx.Req, ctx.Query)
|
||||
return c.authenticate(ctx.Path, pathIPs, pathUser, pathPass, "publish", ctx.Request, ctx.Query)
|
||||
},
|
||||
})
|
||||
|
||||
@@ -193,7 +193,7 @@ func (s *rtspSession) onSetup(c *rtspConn, ctx *gortsplib.ServerHandlerOnSetupCt
|
||||
pathIPs []interface{},
|
||||
pathUser conf.Credential,
|
||||
pathPass conf.Credential) error {
|
||||
return c.authenticate(ctx.Path, pathIPs, pathUser, pathPass, "read", ctx.Req, ctx.Query)
|
||||
return c.authenticate(ctx.Path, pathIPs, pathUser, pathPass, "read", ctx.Request, ctx.Query)
|
||||
},
|
||||
})
|
||||
|
||||
|
@@ -174,11 +174,6 @@ func (s *rtspSource) runInner() bool {
|
||||
readErr := make(chan error)
|
||||
go func() {
|
||||
readErr <- func() error {
|
||||
_, err = c.Options(u)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
tracks, baseURL, _, err := c.Describe(u)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@@ -52,7 +52,7 @@ func TestRTSPSource(t *testing.T) {
|
||||
authValidator = auth.NewValidator("testuser", "testpass", nil)
|
||||
}
|
||||
|
||||
err := authValidator.ValidateRequest(ctx.Req)
|
||||
err := authValidator.ValidateRequest(ctx.Request)
|
||||
if err != nil {
|
||||
return &base.Response{
|
||||
StatusCode: base.StatusUnauthorized,
|
||||
@@ -171,7 +171,7 @@ func TestRTSPSourceNoPassword(t *testing.T) {
|
||||
authValidator = auth.NewValidator("testuser", "", nil)
|
||||
}
|
||||
|
||||
err := authValidator.ValidateRequest(ctx.Req)
|
||||
err := authValidator.ValidateRequest(ctx.Request)
|
||||
if err != nil {
|
||||
return &base.Response{
|
||||
StatusCode: base.StatusUnauthorized,
|
||||
|
Reference in New Issue
Block a user