mirror of
https://github.com/livekit/livekit.git
synced 2026-05-14 05:25:19 +00:00
Merge remote-tracking branch 'origin/master' into raja_1833
This commit is contained in:
@@ -18,7 +18,7 @@ require (
|
||||
github.com/jxskiss/base62 v1.1.0
|
||||
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1
|
||||
github.com/livekit/mediatransportutil v0.0.0-20230919184714-b8f0fa0133c5
|
||||
github.com/livekit/protocol v1.7.3-0.20230919182418-0708b5a5bb84
|
||||
github.com/livekit/protocol v1.7.3-0.20230920084913-821c244d8ce2
|
||||
github.com/livekit/psrpc v0.3.3
|
||||
github.com/mackerelio/go-osstat v0.2.4
|
||||
github.com/magefile/mage v1.15.0
|
||||
|
||||
@@ -129,6 +129,8 @@ github.com/livekit/mediatransportutil v0.0.0-20230919184714-b8f0fa0133c5 h1:CjXY
|
||||
github.com/livekit/mediatransportutil v0.0.0-20230919184714-b8f0fa0133c5/go.mod h1:+WIOYwiBMive5T81V8B2wdAc2zQNRjNQiJIcPxMTILY=
|
||||
github.com/livekit/protocol v1.7.3-0.20230919182418-0708b5a5bb84 h1:4WOaspDesbbrjGPsu6Vp1VjcWxTXVjyjdtQAzIUXn5s=
|
||||
github.com/livekit/protocol v1.7.3-0.20230919182418-0708b5a5bb84/go.mod h1:zbh0QPUcLGOeZeIO/VeigwWWbudz4Lv+Px94FnVfQH0=
|
||||
github.com/livekit/protocol v1.7.3-0.20230920084913-821c244d8ce2 h1:yIRqvyO3qDPO+4EdcHMjsINJYl6KE9AXJUgfChsw+0s=
|
||||
github.com/livekit/protocol v1.7.3-0.20230920084913-821c244d8ce2/go.mod h1:zbh0QPUcLGOeZeIO/VeigwWWbudz4Lv+Px94FnVfQH0=
|
||||
github.com/livekit/psrpc v0.3.3 h1:+lltbuN39IdaynXhLLxRShgYqYsRMWeeXKzv60oqyWo=
|
||||
github.com/livekit/psrpc v0.3.3/go.mod h1:n6JntEg+zT6Ji8InoyTpV7wusPNwGqqtxmHlkNhDN0U=
|
||||
github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs=
|
||||
|
||||
@@ -561,10 +561,9 @@ func (p *ParticipantImpl) HandleSignalSourceClose() {
|
||||
p.TransportManager.SetSignalSourceValid(false)
|
||||
|
||||
if !p.TransportManager.HasPublisherEverConnected() && !p.TransportManager.HasSubscriberEverConnected() {
|
||||
p.params.Logger.Infow("closing disconnected participant",
|
||||
"reason", types.ParticipantCloseReasonJoinFailed,
|
||||
)
|
||||
_ = p.Close(false, types.ParticipantCloseReasonJoinFailed, false)
|
||||
reason := types.ParticipantCloseReasonJoinFailed
|
||||
p.params.Logger.Infow("closing disconnected participant", "reason", reason)
|
||||
_ = p.Close(false, reason, false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1404,10 +1403,9 @@ func (p *ParticipantImpl) setupDisconnectTimer() {
|
||||
if p.IsClosed() || p.IsDisconnected() {
|
||||
return
|
||||
}
|
||||
p.params.Logger.Infow("closing disconnected participant",
|
||||
"reason", types.ParticipantCloseReasonPeerConnectionDisconnected,
|
||||
)
|
||||
_ = p.Close(true, types.ParticipantCloseReasonPeerConnectionDisconnected, false)
|
||||
reason := types.ParticipantCloseReasonPeerConnectionDisconnected
|
||||
p.params.Logger.Infow("closing disconnected participant", "reason", reason)
|
||||
_ = p.Close(true, reason, false)
|
||||
})
|
||||
p.lock.Unlock()
|
||||
}
|
||||
|
||||
+2
-3
@@ -426,7 +426,6 @@ func (r *Room) ReplaceParticipantRequestSource(identity livekit.ParticipantIdent
|
||||
rs.Close()
|
||||
}
|
||||
r.participantRequestSources[identity] = reqSource
|
||||
|
||||
r.lock.Unlock()
|
||||
}
|
||||
|
||||
@@ -550,7 +549,7 @@ func (r *Room) UpdateSubscriptions(
|
||||
}
|
||||
|
||||
for _, pt := range participantTracks {
|
||||
for _, trackID := range livekit.StringsAsTrackIDs(pt.TrackSids) {
|
||||
for _, trackID := range livekit.StringsAsIDs[livekit.TrackID](pt.TrackSids) {
|
||||
if subscribe {
|
||||
participant.SubscribeToTrack(trackID)
|
||||
} else {
|
||||
@@ -601,7 +600,7 @@ func (r *Room) SyncState(participant types.LocalParticipant, state *livekit.Sync
|
||||
|
||||
r.UpdateSubscriptions(
|
||||
participant,
|
||||
livekit.StringsAsTrackIDs(state.Subscription.TrackSids),
|
||||
livekit.StringsAsIDs[livekit.TrackID](state.Subscription.TrackSids),
|
||||
state.Subscription.ParticipantTracks,
|
||||
state.Subscription.Subscribe,
|
||||
)
|
||||
|
||||
@@ -46,12 +46,12 @@ func HandleParticipantSignal(room types.Room, participant types.LocalParticipant
|
||||
// permission check happens later in SubscriptionManager
|
||||
room.UpdateSubscriptions(
|
||||
participant,
|
||||
livekit.StringsAsTrackIDs(msg.Subscription.TrackSids),
|
||||
livekit.StringsAsIDs[livekit.TrackID](msg.Subscription.TrackSids),
|
||||
msg.Subscription.ParticipantTracks,
|
||||
msg.Subscription.Subscribe,
|
||||
)
|
||||
case *livekit.SignalRequest_TrackSetting:
|
||||
for _, sid := range livekit.StringsAsTrackIDs(msg.TrackSetting.TrackSids) {
|
||||
for _, sid := range livekit.StringsAsIDs[livekit.TrackID](msg.TrackSetting.TrackSids) {
|
||||
participant.UpdateSubscribedTrackSettings(sid, msg.TrackSetting)
|
||||
}
|
||||
case *livekit.SignalRequest_Leave:
|
||||
|
||||
@@ -832,7 +832,7 @@ func (t *PCTransport) CreateDataChannel(label string, dci *webrtc.DataChannelIni
|
||||
}
|
||||
|
||||
dcErrorHandler := func(err error) {
|
||||
if !errors.Is(err, sctp.ErrResetPacketInStateNotExist) {
|
||||
if !errors.Is(err, sctp.ErrResetPacketInStateNotExist) && !errors.Is(err, sctp.ErrChunk) {
|
||||
t.params.Logger.Errorw(dc.Label()+" data channel error", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ func (s *RedisStore) ListRooms(_ context.Context, roomNames []livekit.RoomName)
|
||||
return nil, errors.Wrap(err, "could not get rooms")
|
||||
}
|
||||
} else {
|
||||
names := livekit.RoomNamesAsStrings(roomNames)
|
||||
names := livekit.IDsAsStrings(roomNames)
|
||||
var results []interface{}
|
||||
results, err = s.rc.HMGet(s.ctx, RoomsKey, names...).Result()
|
||||
if err != nil && err != redis.Nil {
|
||||
|
||||
@@ -674,7 +674,7 @@ func (r *RoomManager) handleRTCMessage(ctx context.Context, roomName livekit.Roo
|
||||
pLogger.Debugw("updating participant subscriptions")
|
||||
room.UpdateSubscriptions(
|
||||
participant,
|
||||
livekit.StringsAsTrackIDs(rm.UpdateSubscriptions.TrackSids),
|
||||
livekit.StringsAsIDs[livekit.TrackID](rm.UpdateSubscriptions.TrackSids),
|
||||
rm.UpdateSubscriptions.ParticipantTracks,
|
||||
rm.UpdateSubscriptions.Subscribe,
|
||||
)
|
||||
|
||||
@@ -122,7 +122,7 @@ func (s *RoomService) ListRooms(ctx context.Context, req *livekit.ListRoomsReque
|
||||
|
||||
var names []livekit.RoomName
|
||||
if len(req.Names) > 0 {
|
||||
names = livekit.StringsAsRoomNames(req.Names)
|
||||
names = livekit.StringsAsIDs[livekit.RoomName](req.Names)
|
||||
}
|
||||
rooms, err := s.roomStore.ListRooms(ctx, names)
|
||||
if err != nil {
|
||||
|
||||
@@ -257,7 +257,7 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
)
|
||||
|
||||
done := make(chan struct{})
|
||||
// function exits when websocket terminates, it'll close the event reading off of response sink as well
|
||||
// function exits when websocket terminates, it'll close the event reading off of request sink and response source as well
|
||||
defer func() {
|
||||
pLogger.Infow("finishing WS connection", "connID", cr.ConnectionID)
|
||||
cr.ResponseSource.Close()
|
||||
@@ -288,13 +288,13 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// websocket established
|
||||
sigConn := NewWSSignalConnection(conn)
|
||||
if count, err := sigConn.WriteResponse(initialResponse); err != nil {
|
||||
count, err := sigConn.WriteResponse(initialResponse)
|
||||
if err != nil {
|
||||
pLogger.Warnw("could not write initial response", err)
|
||||
return
|
||||
} else {
|
||||
if signalStats != nil {
|
||||
signalStats.AddBytes(uint64(count), true)
|
||||
}
|
||||
}
|
||||
if signalStats != nil {
|
||||
signalStats.AddBytes(uint64(count), true)
|
||||
}
|
||||
pLogger.Infow("new client WS connected",
|
||||
"connID", cr.ConnectionID,
|
||||
@@ -321,7 +321,7 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
case msg := <-cr.ResponseSource.ReadChan():
|
||||
if msg == nil {
|
||||
pLogger.Infow("nothing to read from response source", "connID", cr.ConnectionID)
|
||||
pLogger.Debugw("nothing to read from response source", "connID", cr.ConnectionID)
|
||||
return
|
||||
}
|
||||
res, ok := msg.(*livekit.SignalResponse)
|
||||
@@ -372,7 +372,7 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
websocket.CloseNormalClosure,
|
||||
websocket.CloseNoStatusReceived,
|
||||
) {
|
||||
pLogger.Debugw("exit ws read loop for closed connection", "connID", cr.ConnectionID, "wsError", err)
|
||||
pLogger.Infow("exit ws read loop for closed connection", "connID", cr.ConnectionID, "wsError", err)
|
||||
} else {
|
||||
pLogger.Errorw("error reading from websocket", err, "connID", cr.ConnectionID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user