Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Unified Diff: webrtc/p2p/base/p2ptransportchannel.cc

Issue 1248063002: Fix the generation mismatch assertion error. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « talk/app/webrtc/webrtcsession_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/p2ptransportchannel.cc
diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc
index 46ed40ad76f9ced65929339594e5757ae435bb32..94eb01754d459111533fa7f9a7c71e9e5e3223d1 100644
--- a/webrtc/p2p/base/p2ptransportchannel.cc
+++ b/webrtc/p2p/base/p2ptransportchannel.cc
@@ -666,6 +666,17 @@ void P2PTransportChannel::OnUseCandidate(Connection* conn) {
void P2PTransportChannel::OnCandidate(const Candidate& candidate) {
ASSERT(worker_thread_ == rtc::Thread::Current());
+ uint32 generation = candidate.generation();
+ // Network may not guarantee the order of the candidate delivery. If a
+ // remote candidate with an older generation arrives, drop it.
+ if (generation != 0 && generation < remote_candidate_generation_) {
+ LOG(LS_WARNING) << "Dropping a remote candidate because its generation "
+ << generation
+ << " is lower than the current remote generation "
+ << remote_candidate_generation_;
+ return;
+ }
+
// Create connections to this remote candidate.
CreateConnections(candidate, NULL, false);
« no previous file with comments | « talk/app/webrtc/webrtcsession_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698