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

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

Issue 2670113002: Pick the DTLS handshake timeout based on the ICE RTT estimate (Closed)
Patch Set: Rename InitialHandshakeRetransmissionTimeout -> InitialRetransmissionTimeout. Created 3 years, 11 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 | « webrtc/p2p/base/p2ptransportchannel_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/port.cc
diff --git a/webrtc/p2p/base/port.cc b/webrtc/p2p/base/port.cc
index 565ddb67a60e24fe28f3eb838c88d517a5641512..6fea346841f569df3bbc39517ce086aaceff2aba 100644
--- a/webrtc/p2p/base/port.cc
+++ b/webrtc/p2p/base/port.cc
@@ -1252,8 +1252,12 @@ void Connection::ReceivedPingResponse(int rtt, const std::string& request_id) {
UpdateReceiving(last_ping_response_received_);
set_write_state(STATE_WRITABLE);
set_state(IceCandidatePairState::SUCCEEDED);
+ if (rtt_samples_ > 0) {
+ rtt_ = (RTT_RATIO * rtt_ + rtt) / (RTT_RATIO + 1);
+ } else {
+ rtt_ = rtt;
+ }
rtt_samples_++;
- rtt_ = (RTT_RATIO * rtt_ + rtt) / (RTT_RATIO + 1);
}
bool Connection::dead(int64_t now) const {
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698