Index: webrtc/p2p/base/p2ptransportchannel.cc |
diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc |
index f47f03bbd64f7276e7887f152941539799c80c22..fc7dce2f9e6ad2d283759757d491b481322ed287 100644 |
--- a/webrtc/p2p/base/p2ptransportchannel.cc |
+++ b/webrtc/p2p/base/p2ptransportchannel.cc |
@@ -71,7 +71,7 @@ static const int PING_PACKET_SIZE = 60 * 8; |
// The next two ping intervals are at the channel level. |
// STRONG_PING_INTERVAL (480ms) is applied when the selected connection is both |
// writable and receiving. |
-static const int STRONG_PING_INTERVAL = 1000 * PING_PACKET_SIZE / 1000; |
+const int STRONG_PING_INTERVAL = 1000 * PING_PACKET_SIZE / 1000; |
// WEAK_PING_INTERVAL (48ms) is applied when the selected connection is either |
// not writable or not receiving. |
const int WEAK_PING_INTERVAL = 1000 * PING_PACKET_SIZE / 10000; |
@@ -430,6 +430,12 @@ void P2PTransportChannel::SetIceConfig(const IceConfig& config) { |
LOG(LS_INFO) << "Set default nomination mode to " |
<< static_cast<int>(config_.default_nomination_mode); |
} |
+ |
+ if (config_.ice_check_min_interval != config.ice_check_min_interval) { |
+ config_.ice_check_min_interval = config.ice_check_min_interval; |
+ LOG(LS_INFO) << "Set min ping interval to " |
+ << *config_.ice_check_min_interval; |
+ } |
} |
const IceConfig& P2PTransportChannel::config() const { |
@@ -1522,8 +1528,8 @@ void P2PTransportChannel::OnCheckAndPing() { |
conn->num_pings_sent() < MIN_PINGS_AT_WEAK_PING_INTERVAL; |
}); |
int ping_interval = (weak() || need_more_pings_at_weak_interval) |
- ? weak_ping_interval_ |
- : STRONG_PING_INTERVAL; |
+ ? weak_ping_interval() |
+ : strong_ping_interval(); |
if (rtc::TimeMillis() >= last_ping_sent_ms_ + ping_interval) { |
Connection* conn = FindNextPingableConnection(); |
if (conn) { |
@@ -1607,7 +1613,7 @@ int P2PTransportChannel::CalculateActiveWritablePingInterval( |
// Ping each connection at a higher rate at least |
// MIN_PINGS_AT_WEAK_PING_INTERVAL times. |
if (conn->num_pings_sent() < MIN_PINGS_AT_WEAK_PING_INTERVAL) { |
- return weak_ping_interval_; |
+ return weak_ping_interval(); |
} |
int stable_interval = config_.stable_writable_connection_ping_interval; |