Ignore parse addr error when add remote candidate (#4264)

This commit is contained in:
cnderrauber
2026-01-26 14:37:02 +08:00
committed by GitHub
parent 01bd966ff8
commit b61799ecd8
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -2389,7 +2389,10 @@ func (t *PCTransport) handleRemoteICECandidate(e event) error {
if err := t.pc.AddICECandidate(*c); err != nil {
t.params.Logger.Warnw("failed to add ICE candidate", err, "candidate", c)
return errors.Wrap(err, "add ice candidate failed")
// ignore ParseAddr error as it does not affect ICE connectivity
if !strings.Contains(err.Error(), "ParseAddr") {
return errors.Wrap(err, "add ice candidate failed")
}
} else {
t.params.Logger.Debugw("added ICE candidate", "candidate", c)
}
+1 -1
View File
@@ -446,5 +446,5 @@ func IsICECandidateMDNS(candidate ice.Candidate) bool {
return false
}
return strings.HasSuffix(candidate.Address(), ".local")
return strings.HasSuffix(candidate.Address(), ".local") || strings.HasSuffix(candidate.Address(), ".invalid")
}