Skip to content

Commit

Permalink
add cancellable context for registerForStats call
Browse files Browse the repository at this point in the history
  • Loading branch information
Lev Babchenko committed Oct 5, 2021
1 parent e8b97b5 commit 1cae98d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion srt/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ func (s *ServerImpl) Handle(ctx context.Context, sock *srtgo.SrtSocket, addr *ne
streamid: &streamid,
}

s.registerForStats(ctx, conn)
subctx, cancel := context.WithCancel(ctx)
defer cancel()
s.registerForStats(subctx, conn)

switch streamid.Mode() {
case stream.ModePlay:
Expand Down

0 comments on commit 1cae98d

Please sign in to comment.