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

Side by Side Diff: webrtc/p2p/base/p2ptransportchannel.cc

Issue 2068263003: Do not delete a connection in the turn port with permission error or refresh error. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Merge with head Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 // how a TCP connection is kicked into reconnecting on the active side. 1342 // how a TCP connection is kicked into reconnecting on the active side.
1343 bool P2PTransportChannel::IsPingable(Connection* conn, int64_t now) { 1343 bool P2PTransportChannel::IsPingable(Connection* conn, int64_t now) {
1344 const Candidate& remote = conn->remote_candidate(); 1344 const Candidate& remote = conn->remote_candidate();
1345 // We should never get this far with an empty remote ufrag. 1345 // We should never get this far with an empty remote ufrag.
1346 ASSERT(!remote.username().empty()); 1346 ASSERT(!remote.username().empty());
1347 if (remote.username().empty() || remote.password().empty()) { 1347 if (remote.username().empty() || remote.password().empty()) {
1348 // If we don't have an ICE ufrag and pwd, there's no way we can ping. 1348 // If we don't have an ICE ufrag and pwd, there's no way we can ping.
1349 return false; 1349 return false;
1350 } 1350 }
1351 1351
1352 // A failed connection will not be pinged.
1353 if (conn->state() == Connection::STATE_FAILED) {
1354 return false;
1355 }
1356
1352 // An never connected connection cannot be written to at all, so pinging is 1357 // An never connected connection cannot be written to at all, so pinging is
1353 // out of the question. However, if it has become WRITABLE, it is in the 1358 // out of the question. However, if it has become WRITABLE, it is in the
1354 // reconnecting state so ping is needed. 1359 // reconnecting state so ping is needed.
1355 if (!conn->connected() && !conn->writable()) { 1360 if (!conn->connected() && !conn->writable()) {
1356 return false; 1361 return false;
1357 } 1362 }
1358 1363
1359 // If the channel is weakly connected, ping all connections. 1364 // If the channel is weakly connected, ping all connections.
1360 if (weak()) { 1365 if (weak()) {
1361 return true; 1366 return true;
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 1715
1711 // During the initial state when nothing has been pinged yet, return the first 1716 // During the initial state when nothing has been pinged yet, return the first
1712 // one in the ordered |connections_|. 1717 // one in the ordered |connections_|.
1713 return *(std::find_if(connections_.begin(), connections_.end(), 1718 return *(std::find_if(connections_.begin(), connections_.end(),
1714 [conn1, conn2](Connection* conn) { 1719 [conn1, conn2](Connection* conn) {
1715 return conn == conn1 || conn == conn2; 1720 return conn == conn1 || conn == conn2;
1716 })); 1721 }));
1717 } 1722 }
1718 1723
1719 } // namespace cricket 1724 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698