From f3879465695329f76e8fc0ed75e57fc5c371f227 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Tue, 14 Apr 2020 13:44:09 +0200 Subject: [PATCH] Remove WebRTC-Rfc5389StunRetransmissions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since there is no plan to follow-up on this, this CL removes the field trial and the conditional logic based on it. Bug: webrtc:11503, webrtc:10282 Change-Id: Iaf005eba6af0e23ea50456d75c5c53f37d488f7d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173477 Reviewed-by: Björn Terelius Reviewed-by: Jonas Oreland Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#31062} --- p2p/base/stun_request.cc | 21 +++------------------ p2p/base/stun_request.h | 1 - 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/p2p/base/stun_request.cc b/p2p/base/stun_request.cc index d7c233617e..44376ced95 100644 --- a/p2p/base/stun_request.cc +++ b/p2p/base/stun_request.cc @@ -35,7 +35,6 @@ const int STUN_INITIAL_RTO = 250; // milliseconds // RFC 5389 says SHOULD retransmit 7 times. // This has been 8 for years (not sure why). const int STUN_MAX_RETRANSMISSIONS = 8; // Total sends: 9 -const int STUN_MAX_RETRANSMISSIONS_RFC_5389 = 6; // Total sends: 7 // We also cap the doubling, even though the standard doesn't say to. // This has been 1.6 seconds for years, but for networks that @@ -43,10 +42,6 @@ const int STUN_MAX_RETRANSMISSIONS_RFC_5389 = 6; // Total sends: 7 // work well. const int STUN_MAX_RTO = 8000; // milliseconds, or 5 doublings -namespace { -const char kRfc5389StunRetransmissions[] = "WebRTC-Rfc5389StunRetransmissions"; -} // namespace - StunRequestManager::StunRequestManager(rtc::Thread* thread) : thread_(thread) {} StunRequestManager::~StunRequestManager() { @@ -183,20 +178,12 @@ StunRequest::StunRequest() timeout_(false), manager_(0), msg_(new StunMessage()), - tstamp_(0), - in_rfc5389_retransmission_experiment_( - webrtc::field_trial::IsEnabled(kRfc5389StunRetransmissions)) { + tstamp_(0) { msg_->SetTransactionID(rtc::CreateRandomString(kStunTransactionIdLength)); } StunRequest::StunRequest(StunMessage* request) - : count_(0), - timeout_(false), - manager_(0), - msg_(request), - tstamp_(0), - in_rfc5389_retransmission_experiment_( - webrtc::field_trial::IsEnabled(kRfc5389StunRetransmissions)) { + : count_(0), timeout_(false), manager_(0), msg_(request), tstamp_(0) { msg_->SetTransactionID(rtc::CreateRandomString(kStunTransactionIdLength)); } @@ -266,9 +253,7 @@ void StunRequest::OnMessage(rtc::Message* pmsg) { void StunRequest::OnSent() { count_ += 1; int retransmissions = (count_ - 1); - if (retransmissions >= STUN_MAX_RETRANSMISSIONS || - (in_rfc5389_retransmission_experiment_ && - retransmissions >= STUN_MAX_RETRANSMISSIONS_RFC_5389)) { + if (retransmissions >= STUN_MAX_RETRANSMISSIONS) { timeout_ = true; } RTC_LOG(LS_VERBOSE) << "Sent STUN request " << count_ diff --git a/p2p/base/stun_request.h b/p2p/base/stun_request.h index 9a2c3a99d8..d45376ea55 100644 --- a/p2p/base/stun_request.h +++ b/p2p/base/stun_request.h @@ -148,7 +148,6 @@ class StunRequest : public rtc::MessageHandler { StunRequestManager* manager_; StunMessage* msg_; int64_t tstamp_; - bool in_rfc5389_retransmission_experiment_; friend class StunRequestManager; };