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

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

Issue 2670113002: Pick the DTLS handshake timeout based on the ICE RTT estimate (Closed)
Patch Set: 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
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;
Taylor Brandstetter 2017/02/02 18:07:41 May make more sense in a separate CL, but it would
pthatcher2 2017/02/02 20:09:44 I agree that we should split it into "smoothed_rtt
skvlad 2017/02/02 22:19:33 Let's make it rtc::Optional in a separate CL. Ther
+ }
rtt_samples_++;
- rtt_ = (RTT_RATIO * rtt_ + rtt) / (RTT_RATIO + 1);
}
bool Connection::dead(int64_t now) const {
« webrtc/p2p/base/p2ptransportchannel.h ('K') | « webrtc/p2p/base/p2ptransportchannel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698