mirror of
https://github.com/aler9/gortsplib
synced 2025-09-28 12:02:16 +08:00
server: remove dashes from session ID (#278)
This commit is contained in:
@@ -9,8 +9,6 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
"github.com/bluenviron/gortsplib/v3/pkg/base"
|
||||
"github.com/bluenviron/gortsplib/v3/pkg/liberrors"
|
||||
)
|
||||
@@ -410,9 +408,8 @@ func (s *Server) run() {
|
||||
continue
|
||||
}
|
||||
|
||||
secretID := uuid.New().String()
|
||||
ss := newServerSession(s, secretID, req.sc)
|
||||
s.sessions[secretID] = ss
|
||||
ss := newServerSession(s, req.sc)
|
||||
s.sessions[ss.secretID] = ss
|
||||
|
||||
select {
|
||||
case ss.request <- req:
|
||||
|
@@ -9,6 +9,7 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/pion/rtcp"
|
||||
"github.com/pion/rtp"
|
||||
|
||||
@@ -198,11 +199,13 @@ type ServerSession struct {
|
||||
|
||||
func newServerSession(
|
||||
s *Server,
|
||||
secretID string,
|
||||
author *ServerConn,
|
||||
) *ServerSession {
|
||||
ctx, ctxCancel := context.WithCancel(s.ctx)
|
||||
|
||||
// use an UUID without dashes, since dashes confuse some clients.
|
||||
secretID := strings.ReplaceAll(uuid.New().String(), "-", "")
|
||||
|
||||
ss := &ServerSession{
|
||||
s: s,
|
||||
secretID: secretID,
|
||||
|
Reference in New Issue
Block a user