Remove WebRTC-Rfc5389StunRetransmissions.

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 <terelius@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31062}
This commit is contained in:
Mirko Bonadei
2020-04-14 13:44:09 +02:00
committed by Commit Bot
parent dce61741f6
commit f387946569
2 changed files with 3 additions and 19 deletions

View File

@ -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_