mirror of
https://github.com/livekit/livekit.git
synced 2026-07-18 20:26:28 +00:00
Fix cloud-media panic: runtime error: slice bounds out of range [:-1]
This commit is contained in:
+11
-2
@@ -150,10 +150,19 @@ func (w wrappedICECandidatePairLogger) MarshalLogObject(e zapcore.ObjectEncoder)
|
||||
if w.pair.Remote != nil {
|
||||
e.AddString("remoteProtocol", w.pair.Remote.Protocol.String())
|
||||
e.AddString("remoteCandidateType", w.pair.Remote.Typ.String())
|
||||
e.AddString("remoteAdddress", w.pair.Remote.Address[:len(w.pair.Remote.Address)-3]+"...")
|
||||
|
||||
remoteAdddress := w.pair.Remote.Address
|
||||
if l := len(remoteAdddress); l > 3 {
|
||||
remoteAdddress = remoteAdddress[:l-3] + "..."
|
||||
}
|
||||
e.AddString("remoteAdddress", remoteAdddress)
|
||||
e.AddUint16("remotePort", w.pair.Remote.Port)
|
||||
if w.pair.Remote.RelatedAddress != "" {
|
||||
e.AddString("relatedAdddress", w.pair.Remote.RelatedAddress[:len(w.pair.Remote.RelatedAddress)-3]+"...")
|
||||
relatedAdddress := w.pair.Remote.RelatedAddress
|
||||
if l := len(relatedAdddress); l > 3 {
|
||||
relatedAdddress = relatedAdddress[:l-3] + "..."
|
||||
}
|
||||
e.AddString("relatedAdddress", relatedAdddress)
|
||||
e.AddUint16("relatedPort", w.pair.Remote.RelatedPort)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user