Add safeguards against signalling peer-reflexive candidates.
BUG=4208 R=juberti@google.com Review URL: https://webrtc-codereview.appspot.com/50799004 Cr-Commit-Position: refs/heads/master@{#9104}
This commit is contained in:
parent
ae331349c6
commit
019087f5bb
@ -1770,6 +1770,8 @@ void BuildCandidate(const std::vector<Candidate>& candidates,
|
||||
type = kCandidateRelay;
|
||||
} else {
|
||||
ASSERT(false);
|
||||
// Never write out candidates if we don't know the type.
|
||||
continue;
|
||||
}
|
||||
|
||||
InitAttrLine(kAttributeCandidate, &os);
|
||||
|
@ -559,6 +559,12 @@ void Transport::OnChannelRequestSignaling_s() {
|
||||
|
||||
void Transport::OnChannelCandidateReady(TransportChannelImpl* channel,
|
||||
const Candidate& candidate) {
|
||||
// We should never signal peer-reflexive candidates.
|
||||
if (candidate.type() == PRFLX_PORT_TYPE) {
|
||||
ASSERT(false);
|
||||
return;
|
||||
}
|
||||
|
||||
ASSERT(worker_thread()->IsCurrent());
|
||||
rtc::CritScope cs(&crit_);
|
||||
ready_candidates_.push_back(candidate);
|
||||
|
Loading…
x
Reference in New Issue
Block a user