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

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

Issue 1857453002: Do not stop a session unless the candidate of a writable connection belongs to the (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Add variables to improve readability Created 4 years, 8 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 | « no previous file | webrtc/p2p/base/p2ptransportchannel_unittest.cc » ('j') | 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 66532411b29f5241c6b0f163d87c91d7ba9cbe2a..9b0cfadc289a7f5eed07ebc57146c4c637936c8d 100644
--- a/webrtc/p2p/base/p2ptransportchannel.cc
+++ b/webrtc/p2p/base/p2ptransportchannel.cc
@@ -1400,10 +1400,14 @@ void P2PTransportChannel::OnConnectionStateChange(Connection* connection) {
}
// May stop the allocator session when at least one connection becomes
- // strongly connected after starting to get ports. It is not enough to check
+ // strongly connected after starting to get ports and the local candidate of
+ // the connection is at the latest generation. It is not enough to check
// that the connection becomes weakly connected because the connection may be
// changing from (writable, receiving) to (writable, not receiving).
- if (!connection->weak()) {
+ bool strongly_connected = !connection->weak();
+ bool latest_generation = connection->local_candidate().generation() >=
+ allocator_session()->generation();
+ if (strongly_connected && latest_generation) {
MaybeStopPortAllocatorSessions();
}
« no previous file with comments | « no previous file | webrtc/p2p/base/p2ptransportchannel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698