mirror of
https://github.com/aler9/gortsplib
synced 2025-10-04 14:52:46 +08:00
make most methods thread safe (#882)
Client: Stats ServerConn: Session, Stats ServerSession: State, Stats, Medias, Path, Query, Stream, SetuppedSecure, SetuppedTransport, AnnouncedDescription
This commit is contained in:
@@ -602,7 +602,14 @@ func TestServerRecord(t *testing.T) {
|
||||
|
||||
close(sessionClosed)
|
||||
},
|
||||
onAnnounce: func(_ *ServerHandlerOnAnnounceCtx) (*base.Response, error) {
|
||||
onAnnounce: func(ctx *ServerHandlerOnAnnounceCtx) (*base.Response, error) {
|
||||
// test that properties can be accessed in parallel
|
||||
go func() {
|
||||
ctx.Session.State()
|
||||
ctx.Session.Stats()
|
||||
ctx.Session.AnnouncedDescription()
|
||||
}()
|
||||
|
||||
return &base.Response{
|
||||
StatusCode: base.StatusOK,
|
||||
}, nil
|
||||
@@ -1732,7 +1739,13 @@ func TestServerRecordPausePause(t *testing.T) {
|
||||
StatusCode: base.StatusOK,
|
||||
}, nil
|
||||
},
|
||||
onPause: func(_ *ServerHandlerOnPauseCtx) (*base.Response, error) {
|
||||
onPause: func(ctx *ServerHandlerOnPauseCtx) (*base.Response, error) {
|
||||
// test that properties can be accessed in parallel
|
||||
go func() {
|
||||
ctx.Session.State()
|
||||
ctx.Session.Stats()
|
||||
}()
|
||||
|
||||
return &base.Response{
|
||||
StatusCode: base.StatusOK,
|
||||
}, nil
|
||||
|
Reference in New Issue
Block a user